Commit 8ca22fef authored by Thomas Thrainer's avatar Thomas Thrainer

Add --compress option to gnt-backup import

Add a new command line parameter to gnt-backup import and pass
its value to OpInstanceCreate. 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 0a6e6e6d
......@@ -2707,6 +2707,7 @@ def GenericInstanceCreate(mode, opts, args):
src_path = None
no_install = opts.no_install
identify_defaults = False
compress = constants.IEC_NONE
elif mode == constants.INSTANCE_IMPORT:
start = False
os_type = None
......@@ -2715,6 +2716,7 @@ def GenericInstanceCreate(mode, opts, args):
src_path = opts.src_dir
no_install = None
identify_defaults = opts.identify_defaults
compress = opts.compress
else:
raise errors.ProgrammerError("Invalid creation mode %s" % mode)
......@@ -2740,6 +2742,7 @@ def GenericInstanceCreate(mode, opts, args):
force_variant=force_variant,
src_node=src_node,
src_path=src_path,
compress=compress,
tags=tags,
no_install=no_install,
identify_defaults=identify_defaults,
......
......@@ -133,6 +133,7 @@ import_opts = [
IDENTIFY_DEFAULTS_OPT,
SRC_DIR_OPT,
SRC_NODE_OPT,
COMPRESS_OPT,
IGNORE_IPOLICY_OPT,
]
......
......@@ -34,8 +34,8 @@ its configuration will be exported under the
``@CUSTOM_EXPORT_DIR@/$instance`` directory on the target node.
The ``--compress`` option is used to specify which compression mode
is used during the export. Valid values are 'none' (the default) and
'gzip'.
is used for moves during the export. Valid values are 'none'
(the default) and 'gzip'.
The ``--shutdown-timeout`` is used to specify how much time to wait
before forcing the shutdown (xm destroy in xen, killing the kvm
......@@ -72,6 +72,7 @@ IMPORT
| **import**
| {-n *node[:secondary-node]* | \--iallocator *name*}
| [\--compress=*compression-mode*]
| [\--disk *N*:size=*VAL* [,vg=*VG*], [,mode=*ro|rw*]...]
| [\--net *N* [:options...] | \--no-nics]
| [-B *BEPARAMS*]
......@@ -189,7 +190,6 @@ file
get a directory (as its own name) under this path, and each disk
is stored as individual files in this (instance-specific) directory.
The ``--iallocator`` option specifies the instance allocator plugin
to use. If you pass in this option the allocator will select nodes
for this instance automatically, so you don't need to pass them
......@@ -199,6 +199,10 @@ instance allocator documentation.
The optional second value of the ``--node`` is used for the drbd
template and specifies the remote node.
The ``--compress`` option is used to specify which compression mode
is used for moves during the import. Valid values are 'none'
(the default) and 'gzip'.
The ``--src-dir`` option allows importing instances from a directory
below ``@CUSTOM_EXPORT_DIR@``.
......
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