Commit f5c0c206 authored by Michael Hanselmann's avatar Michael Hanselmann

gnt-backup: Add "--submit" to two commands

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 13ddcb50
...@@ -80,7 +80,7 @@ def ExportInstance(opts, args): ...@@ -80,7 +80,7 @@ def ExportInstance(opts, args):
remove_instance=opts.remove_instance, remove_instance=opts.remove_instance,
ignore_remove_failures=ignore_remove_failures) ignore_remove_failures=ignore_remove_failures)
SubmitOpCode(op, opts=opts) SubmitOrSend(op, opts)
return 0 return 0
...@@ -106,7 +106,7 @@ def RemoveExport(opts, args): ...@@ -106,7 +106,7 @@ def RemoveExport(opts, args):
""" """
op = opcodes.OpBackupRemove(instance_name=args[0]) op = opcodes.OpBackupRemove(instance_name=args[0])
SubmitOpCode(op, opts=opts) SubmitOrSend(op, opts)
return 0 return 0
...@@ -128,7 +128,7 @@ commands = { ...@@ -128,7 +128,7 @@ commands = {
ExportInstance, ARGS_ONE_INSTANCE, ExportInstance, ARGS_ONE_INSTANCE,
[FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT, [FORCE_OPT, SINGLE_NODE_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT,
REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT, DRY_RUN_OPT, REMOVE_INSTANCE_OPT, IGNORE_REMOVE_FAILURES_OPT, DRY_RUN_OPT,
PRIORITY_OPT], PRIORITY_OPT, SUBMIT_OPT],
"-n <target_node> [opts...] <name>", "-n <target_node> [opts...] <name>",
"Exports an instance to an image"), "Exports an instance to an image"),
"import": ( "import": (
...@@ -136,7 +136,8 @@ commands = { ...@@ -136,7 +136,8 @@ commands = {
"[...] -t disk-type -n node[:secondary-node] <name>", "[...] -t disk-type -n node[:secondary-node] <name>",
"Imports an instance from an exported image"), "Imports an instance from an exported image"),
"remove": ( "remove": (
RemoveExport, [ArgUnknown(min=1, max=1)], [DRY_RUN_OPT, PRIORITY_OPT], RemoveExport, [ArgUnknown(min=1, max=1)],
[DRY_RUN_OPT, PRIORITY_OPT, SUBMIT_OPT],
"<name>", "Remove exports of named instance from the filesystem."), "<name>", "Remove exports of named instance from the filesystem."),
} }
......
...@@ -24,8 +24,9 @@ COMMANDS ...@@ -24,8 +24,9 @@ COMMANDS
EXPORT EXPORT
~~~~~~ ~~~~~~
**export** {-n *node*} [\--shutdown-timeout=*N*] [\--noshutdown] | **export** {-n *node*} [\--shutdown-timeout=*N*] [\--noshutdown]
[\--remove-instance] [\--ignore-remove-failures] {*instance*} | [\--remove-instance] [\--ignore-remove-failures] [\--submit]
| {*instance*}
Exports an instance to the target node. All the instance data and Exports an instance to the target node. All the instance data and
its configuration will be exported under the its configuration will be exported under the
...@@ -53,6 +54,9 @@ execution (and will be stored in the job log). It is recommended ...@@ -53,6 +54,9 @@ execution (and will be stored in the job log). It is recommended
that for any non-zero exit code, the backup is considered invalid, that for any non-zero exit code, the backup is considered invalid,
and retried. and retried.
See **ganeti(7)** for a description of ``--submit`` and other common
options.
Example:: Example::
# gnt-backup export -n node1.example.com instance3.example.com # gnt-backup export -n node1.example.com instance3.example.com
...@@ -71,6 +75,7 @@ IMPORT ...@@ -71,6 +75,7 @@ IMPORT
| [-t [diskless | plain | drbd | file]] | [-t [diskless | plain | drbd | file]]
| [\--identify-defaults] | [\--identify-defaults]
| [\--ignore-ipolicy] | [\--ignore-ipolicy]
| [\--submit]
| {*instance*} | {*instance*}
Imports a new instance from an export residing on *source-node* in Imports a new instance from an export residing on *source-node* in
...@@ -205,6 +210,9 @@ value matches the current cluster default and mark it as such ...@@ -205,6 +210,9 @@ value matches the current cluster default and mark it as such
affect the hypervisor, backend and NIC parameters, both read from affect the hypervisor, backend and NIC parameters, both read from
the export file and passed in via the command line. the export file and passed in via the command line.
See **ganeti(7)** for a description of ``--submit`` and other common
options.
Example for identical instance import:: Example for identical instance import::
# gnt-backup import -n node1.example.com instance3.example.com # gnt-backup import -n node1.example.com instance3.example.com
......
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