Revision 3c049cd3

b/lib/client/gnt_debug.py
175 175
                               allocator=opts.iallocator,
176 176
                               evac_mode=opts.evac_mode,
177 177
                               target_groups=target_groups,
178
                               spindle_use=opts.spindle_use)
178
                               spindle_use=opts.spindle_use,
179
                               count=opts.count)
179 180
  result = SubmitOpCode(op, opts=opts)
180 181
  ToStdout("%s" % result)
181 182
  return 0
......
676 677
                default=[], action="append"),
677 678
     cli_option("--spindle-use", help="How many spindles to use",
678 679
                default=1, type="int"),
680
     cli_option("--count", help="How many instances to allocate",
681
                default=2, type="int"),
679 682
     DRY_RUN_OPT, PRIORITY_OPT,
680 683
     ],
681 684
    "{opts...} <instance>", "Executes a TestAllocator OpCode"),
b/lib/cmdlib.py
14824 14824
    This checks the opcode parameters depending on the director and mode test.
14825 14825

  
14826 14826
    """
14827
    if self.op.mode == constants.IALLOCATOR_MODE_ALLOC:
14827
    if self.op.mode in (constants.IALLOCATOR_MODE_ALLOC,
14828
                        constants.IALLOCATOR_MODE_MULTI_ALLOC):
14828 14829
      for attr in ["memory", "disks", "disk_template",
14829 14830
                   "os", "tags", "nics", "vcpus"]:
14830 14831
        if not hasattr(self.op, attr):
......
14896 14897
    elif self.op.mode == constants.IALLOCATOR_MODE_NODE_EVAC:
14897 14898
      req = iallocator.IAReqNodeEvac(instances=self.op.instances,
14898 14899
                                     evac_mode=self.op.evac_mode)
14900
    elif self.op.mode == constants.IALLOCATOR_MODE_MULTI_ALLOC:
14901
      disk_template = self.op.disk_template
14902
      insts = [iallocator.IAReqInstanceAlloc(name="%s%s" % (self.op.name, idx),
14903
                                             memory=self.op.memory,
14904
                                             disks=self.op.disks,
14905
                                             disk_template=disk_template,
14906
                                             os=self.op.os,
14907
                                             tags=self.op.tags,
14908
                                             nics=self.op.nics,
14909
                                             vcpus=self.op.vcpus,
14910
                                             spindle_use=self.op.spindle_use,
14911
                                             hypervisor=self.op.hypervisor)
14912
               for idx in range(self.op.count)]
14913
      req = iallocator.IAReqMultiInstanceAlloc(instances=insts)
14899 14914
    else:
14900 14915
      raise errors.ProgrammerError("Uncatched mode %s in"
14901 14916
                                   " LUTestAllocator.Exec", self.op.mode)
b/lib/opcodes.py
1839 1839
     ht.TOr(ht.TNone, ht.TElemOf(constants.IALLOCATOR_NEVAC_MODES)), None),
1840 1840
    ("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString), None),
1841 1841
    ("spindle_use", 1, ht.TPositiveInt, None),
1842
    ("count", 1, ht.TPositiveInt, None),
1842 1843
    ]
1843 1844

  
1844 1845

  

Also available in: Unified diff