"""
instance_name = args[0]
op = opcodes.OpInstanceActivateDisks(instance_name=instance_name,
- ignore_size=opts.ignore_size)
+ ignore_size=opts.ignore_size,
+ wait_for_sync=opts.wait_for_sync)
disks_info = SubmitOrSend(op, opts)
for host, iname, nname in disks_info:
ToStdout("%s:%s:%s", host, iname, nname)
# LUInstanceRecreateDisks, but it'd be nice to have in the client)
if opts.node:
+ if opts.iallocator:
+ msg = "At most one of either --nodes or --iallocator can be passed"
+ raise errors.OpPrereqError(msg, errors.ECODE_INVAL)
pnode, snode = SplitNodeOption(opts.node)
nodes = [pnode]
if snode is not None:
nodes = []
op = opcodes.OpInstanceRecreateDisks(instance_name=instance_name,
- disks=disks, nodes=nodes)
+ disks=disks, nodes=nodes,
+ iallocator=opts.iallocator)
SubmitOrSend(op, opts)
return 0
"<instance>", "Reboots an instance"),
"activate-disks": (
ActivateDisks, ARGS_ONE_INSTANCE,
- [SUBMIT_OPT, IGNORE_SIZE_OPT, PRIORITY_OPT],
+ [SUBMIT_OPT, IGNORE_SIZE_OPT, PRIORITY_OPT, WFSYNC_OPT],
"<instance>", "Activate an instance's disks"),
"deactivate-disks": (
DeactivateDisks, ARGS_ONE_INSTANCE,
"[-f] <instance>", "Deactivate an instance's disks"),
"recreate-disks": (
RecreateDisks, ARGS_ONE_INSTANCE,
- [SUBMIT_OPT, DISK_OPT, NODE_PLACEMENT_OPT, DRY_RUN_OPT, PRIORITY_OPT],
+ [SUBMIT_OPT, DISK_OPT, NODE_PLACEMENT_OPT, DRY_RUN_OPT, PRIORITY_OPT,
+ IALLOCATOR_OPT],
"<instance>", "Recreate an instance's disks"),
"grow-disk": (
GrowDisk,