Instance filtering¶
Migration Manager uses expr-lang for selecting instances to be assigned to batches. See Batches for more information about batch configuration.
Expr is an expression language that uses a Go-like syntax with some more human-readable operators.
Note
For a full list of available functions and examples for more advanced expressions, see the full language definition at https://expr-lang.org/docs/language-definition
Migration Manager has the following extended functions:
path_base(string)– returns the final part of a path tree (e.g. /path/to/foo -> foo)has_tag(<category>, <tag>)– returns whether the<tag>exists in the<category>(Use * for all categories)matches_tag(<category>, <tag>)– returns whether any tag contains the text<tag>in the(use * for all categories)
Common examples¶
Expression |
Description |
|---|---|
|
Match the instances whose |
|
Match the instances whose |
|
Of the instances whose |
|
Match the instances whose number of disks is greater than 2 |
|
Match the instances where the number of disks whose |
|
Match the instances whose first disk is |
|
Match the instances that have more than one disk, where the second disk is not |
|
Match the instances where all NICs have a non-empty |
|
Match the instances whose |
|
Match the instances whose |
|
Match the instances whose |
|
Match the instances whose |
|
Match the instances where that have 3 tags in category |
|
Match the instances that have the tag |
|
Match the instances that have the tag |
|
Match the instances that have any tag under |
|
Match the instances that have the tag |
|
Match the instances that have any tag under any category that contain the text |
|
Match the instances under the resource pool |
Note
Expressions evaluate on instances after overrides have been applied.
Note
Field names of instances are the same as the properties field of the JSON or YAML representation shown over the API or in the migration-manager instance show commands with the addition of source and source_type.