Commit 94ab995a authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Add --compress option to gnt-instance move



Add a new command line parameter to gnt-instance and pass its value to
OpInstanceMove. Also document the option in the man page.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent f198cf91
......@@ -182,6 +182,7 @@ __all__ = [
"SEP_OPT",
"SHOWCMD_OPT",
"SHOW_MACHINE_OPT",
"COMPRESS_OPT",
"SHUTDOWN_TIMEOUT_OPT",
"SINGLE_NODE_OPT",
"SPECS_CPU_COUNT_OPT",
......@@ -1345,6 +1346,11 @@ TIMEOUT_OPT = cli_option("--timeout", dest="timeout", type="int",
default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
help="Maximum time to wait")
COMPRESS_OPT = cli_option("--compress", dest="compress",
default=constants.IEC_NONE,
help="The compression mode to use",
choices=list(constants.IEC_ALL))
SHUTDOWN_TIMEOUT_OPT = cli_option("--shutdown-timeout",
dest="shutdown_timeout", type="int",
default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
......
......@@ -822,6 +822,7 @@ def MoveInstance(opts, args):
op = opcodes.OpInstanceMove(instance_name=instance_name,
target_node=opts.node,
compress=opts.compress,
shutdown_timeout=opts.shutdown_timeout,
ignore_consistency=opts.ignore_consistency,
ignore_ipolicy=opts.ignore_ipolicy)
......@@ -1486,7 +1487,7 @@ commands = {
"move": (
MoveInstance, ARGS_ONE_INSTANCE,
[FORCE_OPT] + SUBMIT_OPTS +
[SINGLE_NODE_OPT,
[SINGLE_NODE_OPT, COMPRESS_OPT,
SHUTDOWN_TIMEOUT_OPT, DRY_RUN_OPT, PRIORITY_OPT, IGNORE_CONSIST_OPT,
IGNORE_IPOLICY_OPT],
"[-f] <instance>", "Move instance to an arbitrary node"
......
......@@ -1871,8 +1871,8 @@ MOVE
^^^^
| **move** [-f] [\--ignore-consistency]
| [-n *node*] [\--shutdown-timeout=*N*] [\--submit] [\--print-job-id]
| [\--ignore-ipolicy]
| [-n *node*] [\--compress=*compression-mode*] [\--shutdown-timeout=*N*]
| [\--submit] [\--print-job-id] [\--ignore-ipolicy]
| {*instance*}
Move will move the instance to an arbitrary node in the cluster. This
......@@ -1882,6 +1882,10 @@ Note that since this operation is done via data copy, it will take a
long time for big disks (similar to replace-disks for a drbd
instance).
The ``--compress`` option is used to specify which compression mode
is used during the move. Valid values are 'none' (the default) and
'gzip'.
The ``--shutdown-timeout`` is used to specify how much time to wait
before forcing the shutdown (e.g. ``xm destroy`` in XEN, killing the
kvm process for KVM, etc.). By default two minutes are given to each
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment