diff --git a/tools/burnin b/tools/burnin index 0a3a64056f5a8b7f3d20ccdc61e0f95da39a4dad..82c8511499954ed2bb5a925fc508e858489ed213 100755 --- a/tools/burnin +++ b/tools/burnin @@ -138,6 +138,11 @@ class Burner(object): parser.add_option("-n", "--nodes", dest="nodes", default="", help="Comma separated list of nodes to perform" " the burnin on (defaults to all nodes)") + parser.add_option("--iallocator", dest="iallocator", + default=None, type="string", + help="Perform the allocation using an iallocator" + " instead of fixed node spread (node restrictions no" + " longer apply, therefore -n/--nodes must not be used") options, args = parser.parse_args() if len(args) < 1 or options.os is None: @@ -151,6 +156,10 @@ class Burner(object): Log("Unknown disk template '%s'" % options.disk_template) sys.exit(1) + if options.nodes and options.iallocator: + Log("Give either the nodes option or the iallocator option, not both") + sys.exit(1) + self.opts = options self.instances = args @@ -192,6 +201,8 @@ class Burner(object): islice(cycle(self.nodes), 1, None), self.instances) for pnode, snode, instance in mytor: + if self.opts.iallocator: + pnode = snode = None op = opcodes.OpCreateInstance(instance_name=instance, mem_size=128, disk_size=self.opts.os_size, @@ -210,7 +221,8 @@ class Burner(object): initrd_path=None, hvm_boot_order=None, file_driver="loop", - file_storage_dir=None) + file_storage_dir=None, + iallocator=self.opts.iallocator) Log("- Add instance %s on nodes %s/%s" % (instance, pnode, snode)) self.ExecOp(op) self.to_rem.append(instance)