Skip to content
Snippets Groups Projects
Commit c5a66db3 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

gnt-node: Add "--submit" and "--priority" to commands


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent f70bb622
No related branches found
No related tags found
No related merge requests found
......@@ -324,7 +324,7 @@ def EvacuateNode(opts, args):
remote_node=opts.dst_node,
iallocator=opts.iallocator,
early_release=opts.early_release)
result = SubmitOpCode(op, cl=cl, opts=opts)
result = SubmitOrSend(op, opts, cl=cl)
# Keep track of submitted jobs
jex = JobExecutor(cl=cl, opts=opts)
......@@ -430,7 +430,7 @@ def MigrateNode(opts, args):
allow_runtime_changes=opts.allow_runtime_chgs,
ignore_ipolicy=opts.ignore_ipolicy)
result = SubmitOpCode(op, cl=cl, opts=opts)
result = SubmitOrSend(op, opts, cl=cl)
# Keep track of submitted jobs
jex = JobExecutor(cl=cl, opts=opts)
......@@ -537,7 +537,7 @@ def PowercycleNode(opts, args):
return 2
op = opcodes.OpNodePowercycle(node_name=node, force=opts.force)
result = SubmitOpCode(op, opts=opts)
result = SubmitOrSend(op, opts)
if result:
ToStderr(result)
return 0
......@@ -799,7 +799,7 @@ def ModifyStorage(opts, args):
storage_type=storage_type,
name=volume_name,
changes=changes)
SubmitOpCode(op, opts=opts)
SubmitOrSend(op, opts)
else:
ToStderr("No changes to perform, exiting.")
......@@ -822,7 +822,7 @@ def RepairStorage(opts, args):
storage_type=storage_type,
name=volume_name,
ignore_consistency=opts.ignore_consistency)
SubmitOpCode(op, opts=opts)
SubmitOrSend(op, opts)
def SetNodeParams(opts, args):
......@@ -888,7 +888,7 @@ commands = {
"evacuate": (
EvacuateNode, ARGS_ONE_NODE,
[FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT, EARLY_RELEASE_OPT,
PRIORITY_OPT, PRIMARY_ONLY_OPT, SECONDARY_ONLY_OPT],
PRIORITY_OPT, PRIMARY_ONLY_OPT, SECONDARY_ONLY_OPT, SUBMIT_OPT],
"[-f] {-I <iallocator> | -n <dst>} [-p | -s] [options...] <node>",
"Relocate the primary and/or secondary instances from a node"),
"failover": (
......@@ -901,7 +901,7 @@ commands = {
MigrateNode, ARGS_ONE_NODE,
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT,
NORUNTIME_CHGS_OPT],
NORUNTIME_CHGS_OPT, SUBMIT_OPT, PRIORITY_OPT],
"[-f] <node>",
"Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"),
......@@ -931,7 +931,7 @@ commands = {
"<node_name>", "Alters the parameters of a node"),
"powercycle": (
PowercycleNode, ARGS_ONE_NODE,
[FORCE_OPT, CONFIRM_OPT, DRY_RUN_OPT, PRIORITY_OPT],
[FORCE_OPT, CONFIRM_OPT, DRY_RUN_OPT, PRIORITY_OPT, SUBMIT_OPT],
"<node_name>", "Tries to forcefully powercycle a node"),
"power": (
PowerNode,
......@@ -960,14 +960,14 @@ commands = {
[ArgNode(min=1, max=1),
ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES),
ArgFile(min=1, max=1)],
[ALLOCATABLE_OPT, DRY_RUN_OPT, PRIORITY_OPT],
[ALLOCATABLE_OPT, DRY_RUN_OPT, PRIORITY_OPT, SUBMIT_OPT],
"<node_name> <storage_type> <name>", "Modify storage volume on a node"),
"repair-storage": (
RepairStorage,
[ArgNode(min=1, max=1),
ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES),
ArgFile(min=1, max=1)],
[IGNORE_CONSIST_OPT, DRY_RUN_OPT, PRIORITY_OPT],
[IGNORE_CONSIST_OPT, DRY_RUN_OPT, PRIORITY_OPT, SUBMIT_OPT],
"<node_name> <storage_type> <name>",
"Repairs a storage volume on a node"),
"list-tags": (
......
......@@ -95,7 +95,7 @@ interpreted as stdin.
EVACUATE
~~~~~~~~
| **evacuate** [-f] [\--early-release]
| **evacuate** [-f] [\--early-release] [\--submit]
| [{-I|\--iallocator} *NAME* \| {-n|\--new-secondary} *destination\_node*]
| [{-p|\--primary-only} \| {-s|\--secondary-only} ]
| {*node*}
......@@ -138,6 +138,9 @@ each affected instance individually:
in the secondary node change mode (only valid for DRBD instances)
- when neither of the above is done a combination of the two cases is run
See **ganeti(7)** for a description of ``--submit`` and other common
options.
Example::
# gnt-node evacuate -I hail node3.example.com
......@@ -250,8 +253,8 @@ List the tags of the given node.
MIGRATE
~~~~~~~
**migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live]
[\--ignore-ipolicy] {*node*}
| **migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live]
| [\--ignore-ipolicy] [\--submit] {*node*}
This command will migrate all instances having the given node as
primary to their secondary nodes. This works only for instances
......@@ -264,6 +267,9 @@ can be given to influence the migration type.
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.
See **ganeti(7)** for a description of ``--submit`` and other common
options.
Example::
# gnt-node migrate node1.example.com
......@@ -471,8 +477,8 @@ Example::
MODIFY-STORAGE
~~~~~~~~~~~~~~
**modify-storage** [``--allocatable=yes|no``]
{*node*} {*storage-type*} {*volume-name*}
| **modify-storage** [\--allocatable={yes|no}] [\--submit]
| {*node*} {*storage-type*} {*volume-name*}
Modifies storage volumes on a node. Only LVM physical volumes can
be modified at the moment. They have a storage type of "lvm-pv".
......@@ -485,8 +491,8 @@ Example::
REPAIR-STORAGE
~~~~~~~~~~~~~~
**repair-storage** [\--ignore-consistency] {*node*} {*storage-type*}
{*volume-name*}
| **repair-storage** [\--ignore-consistency] ]\--submit]
| {*node*} {*storage-type*} {*volume-name*}
Repairs a storage volume on a node. Only LVM volume groups can be
repaired at this time. They have the storage type "lvm-vg".
......@@ -511,7 +517,7 @@ Example::
POWERCYCLE
~~~~~~~~~~
**powercycle** [``--yes``] [``--force``] {*node*}
**powercycle** [\--yes] [\--force] [\--submit] {*node*}
This command (tries to) forcefully reboot a node. It is a command
that can be used if the node environment is broken, such that the
......@@ -527,6 +533,9 @@ The ``--yes`` option can be used to skip confirmation, while the
``--force`` option is needed if the target node is the master
node.
See **ganeti(7)** for a description of ``--submit`` and other common
options.
POWER
~~~~~
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment