"USE_REPL_NET_OPT",
"VERBOSE_OPT",
"VG_NAME_OPT",
+ "WFSYNC_OPT",
"YES_DOIT_OPT",
"DISK_STATE_OPT",
"HV_STATE_OPT",
default=True, action="store_false",
help="Don't wait for sync (DANGEROUS!)")
+WFSYNC_OPT = cli_option("--wait-for-sync", dest="wait_for_sync",
+ default=False, action="store_true",
+ help="Wait for disks to sync")
+
ONLINE_INST_OPT = cli_option("--online", dest="online_inst",
action="store_true", default=False,
help="Enable offline instance")
"""
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)
"<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,
ACTIVATE-DISKS
^^^^^^^^^^^^^^
-**activate-disks** [\--submit] [\--ignore-size] {*instance*}
+**activate-disks** [\--submit] [\--ignore-size] [\--wait-for-sync] {*instance*}
Activates the block devices of the given instance. If successful, the
command will show the location and name of the block devices::
in LVM devices). This should not be used in normal cases, but only
when activate-disks fails without it.
+The ``--wait-for-sync`` option will ensure that the command returns only
+after the instance's disks are synchronised (mostly for DRBD); this can
+be useful to ensure consistency, as otherwise there are no commands that
+can wait until synchronisation is done. However when passing this
+option, the command will have additional output, making it harder to
+parse the disk information.
+
Note that it is safe to run this command while the instance is already
running.