_PAllowRuntimeChgs = ("allow_runtime_changes", True, ht.TBool,
"Allow runtime changes (eg. memory ballooning)")
+#: IAllocator field builder
+_PIAllocFromDesc = lambda desc: ("iallocator", None, ht.TMaybeString, desc)
+
#: a required network name
_PNetworkName = ("network_name", ht.NoDefault, ht.TNonEmptyString,
"Set network name")
_PMigrationTargetNode,
_PAllowRuntimeChgs,
_PIgnoreIpolicy,
- ("iallocator", None, ht.TMaybeString,
- "Iallocator for deciding the target node for shared-storage instances"),
+ _PIAllocFromDesc("Iallocator for deciding the target node"
+ " for shared-storage instances"),
]
OP_RESULT = TJobIdListOnly
_PEarlyRelease,
_PNodeName,
("remote_node", None, ht.TMaybeString, "New secondary node"),
- ("iallocator", None, ht.TMaybeString, "Iallocator for computing solution"),
+ _PIAllocFromDesc("Iallocator for computing solution"),
("mode", ht.NoDefault, ht.TElemOf(constants.NODE_EVAC_MODES),
"Node evacuation mode"),
]
("hvparams", ht.EmptyDict, ht.TDict,
"Hypervisor parameters for instance, hypervisor-dependent"),
("hypervisor", None, ht.TMaybeString, "Hypervisor"),
- ("iallocator", None, ht.TMaybeString,
- "Iallocator for deciding which node(s) to use"),
+ _PIAllocFromDesc("Iallocator for deciding which node(s) to use"),
("identify_defaults", False, ht.TBool,
"Reset instance parameters to default if equal"),
("ip_check", True, ht.TBool, _PIpCheckDoc),
"""
OP_PARAMS = [
- ("iallocator", None, ht.TMaybeString,
- "Iallocator used to allocate all the instances"),
+ _PIAllocFromDesc("Iallocator used to allocate all the instances"),
("instances", ht.EmptyList, ht.TListOf(ht.TInstanceOf(OpInstanceCreate)),
"List of instance create opcodes describing the instances to allocate"),
]
("disks", ht.EmptyList, ht.TListOf(ht.TNonNegativeInt),
"Disk indexes"),
("remote_node", None, ht.TMaybeString, "New secondary node"),
- ("iallocator", None, ht.TMaybeString,
- "Iallocator for deciding new secondary node"),
+ _PIAllocFromDesc("Iallocator for deciding new secondary node"),
]
OP_RESULT = ht.TNone
_PIgnoreConsistency,
_PMigrationTargetNode,
_PIgnoreIpolicy,
- ("iallocator", None, ht.TMaybeString,
- "Iallocator for deciding the target node for shared-storage instances"),
+ _PIAllocFromDesc("Iallocator for deciding the target node for"
+ " shared-storage instances"),
]
OP_RESULT = ht.TNone
_PIgnoreIpolicy,
("cleanup", False, ht.TBool,
"Whether a previously failed migration should be cleaned up"),
- ("iallocator", None, ht.TMaybeString,
- "Iallocator for deciding the target node for shared-storage instances"),
+ _PIAllocFromDesc("Iallocator for deciding the target node for"
+ " shared-storage instances"),
("allow_failover", False, ht.TBool,
"Whether we can fallback to failover if migration is not possible"),
]
" index and a possibly empty dictionary with disk parameter changes"),
("nodes", ht.EmptyList, ht.TListOf(ht.TNonEmptyString),
"New instance nodes, if relocation is desired"),
- ("iallocator", None, ht.TMaybeString,
- "Iallocator for deciding new nodes"),
+ _PIAllocFromDesc("Iallocator for deciding new nodes"),
]
OP_RESULT = ht.TNone
OP_PARAMS = [
_PInstanceName,
_PEarlyRelease,
- ("iallocator", None, ht.TMaybeString, "Iallocator for computing solution"),
+ _PIAllocFromDesc("Iallocator for computing solution"),
("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString),
"Destination group names or UUIDs (defaults to \"all but current group\""),
]
OP_PARAMS = [
_PGroupName,
_PEarlyRelease,
- ("iallocator", None, ht.TMaybeString, "Iallocator for computing solution"),
+ _PIAllocFromDesc("Iallocator for computing solution"),
("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString),
"Destination group names or UUIDs"),
]