diff --git a/lib/client/gnt_debug.py b/lib/client/gnt_debug.py index 228733b5d27b7ab02d0db59b1dc39d03db7d6bb7..5eb58a29fa91e9e5597f91134532cea8e9f81289 100644 --- a/lib/client/gnt_debug.py +++ b/lib/client/gnt_debug.py @@ -174,7 +174,8 @@ def TestAllocator(opts, args): direction=opts.direction, allocator=opts.iallocator, evac_mode=opts.evac_mode, - target_groups=target_groups) + target_groups=target_groups, + spindle_use=opts.spindle_use) result = SubmitOpCode(op, opts=opts) ToStdout("%s" % result) return 0 @@ -672,6 +673,8 @@ commands = { utils.CommaJoin(constants.IALLOCATOR_NEVAC_MODES))), cli_option("--target-groups", help="Target groups for relocation", default=[], action="append"), + cli_option("--spindle-use", help="How many spindles to use", + default=1, type="int"), DRY_RUN_OPT, PRIORITY_OPT, ], "{opts...} <instance>", "Executes a TestAllocator OpCode"), diff --git a/lib/cmdlib.py b/lib/cmdlib.py index cf2769e82e9bc3e443b46a35702e4064bb88b58e..3860d559d678a84ff8bac43d3f28f0c78fcffdc0 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -15295,6 +15295,7 @@ class LUTestAllocator(NoHooksLU): nics=self.op.nics, vcpus=self.op.vcpus, hypervisor=self.op.hypervisor, + spindle_use=self.op.spindle_use, ) elif self.op.mode == constants.IALLOCATOR_MODE_RELOC: ial = IAllocator(self.cfg, self.rpc, diff --git a/lib/opcodes.py b/lib/opcodes.py index aa7cce1e0ade0abcec689d9070d4e53eeb284baa..3243e0ea75024a519e3460d02ba9c60eda407c26 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -1853,6 +1853,7 @@ class OpTestAllocator(OpCode): ("evac_mode", None, ht.TOr(ht.TNone, ht.TElemOf(constants.IALLOCATOR_NEVAC_MODES)), None), ("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString), None), + ("spindle_use", 1, ht.TPositiveInt, None), ]