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): ...@@ -324,7 +324,7 @@ def EvacuateNode(opts, args):
remote_node=opts.dst_node, remote_node=opts.dst_node,
iallocator=opts.iallocator, iallocator=opts.iallocator,
early_release=opts.early_release) early_release=opts.early_release)
result = SubmitOpCode(op, cl=cl, opts=opts) result = SubmitOrSend(op, opts, cl=cl)
# Keep track of submitted jobs # Keep track of submitted jobs
jex = JobExecutor(cl=cl, opts=opts) jex = JobExecutor(cl=cl, opts=opts)
...@@ -430,7 +430,7 @@ def MigrateNode(opts, args): ...@@ -430,7 +430,7 @@ def MigrateNode(opts, args):
allow_runtime_changes=opts.allow_runtime_chgs, allow_runtime_changes=opts.allow_runtime_chgs,
ignore_ipolicy=opts.ignore_ipolicy) ignore_ipolicy=opts.ignore_ipolicy)
result = SubmitOpCode(op, cl=cl, opts=opts) result = SubmitOrSend(op, opts, cl=cl)
# Keep track of submitted jobs # Keep track of submitted jobs
jex = JobExecutor(cl=cl, opts=opts) jex = JobExecutor(cl=cl, opts=opts)
...@@ -537,7 +537,7 @@ def PowercycleNode(opts, args): ...@@ -537,7 +537,7 @@ def PowercycleNode(opts, args):
return 2 return 2
op = opcodes.OpNodePowercycle(node_name=node, force=opts.force) op = opcodes.OpNodePowercycle(node_name=node, force=opts.force)
result = SubmitOpCode(op, opts=opts) result = SubmitOrSend(op, opts)
if result: if result:
ToStderr(result) ToStderr(result)
return 0 return 0
...@@ -799,7 +799,7 @@ def ModifyStorage(opts, args): ...@@ -799,7 +799,7 @@ def ModifyStorage(opts, args):
storage_type=storage_type, storage_type=storage_type,
name=volume_name, name=volume_name,
changes=changes) changes=changes)
SubmitOpCode(op, opts=opts) SubmitOrSend(op, opts)
else: else:
ToStderr("No changes to perform, exiting.") ToStderr("No changes to perform, exiting.")
...@@ -822,7 +822,7 @@ def RepairStorage(opts, args): ...@@ -822,7 +822,7 @@ def RepairStorage(opts, args):
storage_type=storage_type, storage_type=storage_type,
name=volume_name, name=volume_name,
ignore_consistency=opts.ignore_consistency) ignore_consistency=opts.ignore_consistency)
SubmitOpCode(op, opts=opts) SubmitOrSend(op, opts)
def SetNodeParams(opts, args): def SetNodeParams(opts, args):
...@@ -888,7 +888,7 @@ commands = { ...@@ -888,7 +888,7 @@ commands = {
"evacuate": ( "evacuate": (
EvacuateNode, ARGS_ONE_NODE, EvacuateNode, ARGS_ONE_NODE,
[FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT, EARLY_RELEASE_OPT, [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>", "[-f] {-I <iallocator> | -n <dst>} [-p | -s] [options...] <node>",
"Relocate the primary and/or secondary instances from a node"), "Relocate the primary and/or secondary instances from a node"),
"failover": ( "failover": (
...@@ -901,7 +901,7 @@ commands = { ...@@ -901,7 +901,7 @@ commands = {
MigrateNode, ARGS_ONE_NODE, MigrateNode, ARGS_ONE_NODE,
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT, [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT, IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT,
NORUNTIME_CHGS_OPT], NORUNTIME_CHGS_OPT, SUBMIT_OPT, PRIORITY_OPT],
"[-f] <node>", "[-f] <node>",
"Migrate all the primary instance on a node away from it" "Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"), " (only for instances of type drbd)"),
...@@ -931,7 +931,7 @@ commands = { ...@@ -931,7 +931,7 @@ commands = {
"<node_name>", "Alters the parameters of a node"), "<node_name>", "Alters the parameters of a node"),
"powercycle": ( "powercycle": (
PowercycleNode, ARGS_ONE_NODE, 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"), "<node_name>", "Tries to forcefully powercycle a node"),
"power": ( "power": (
PowerNode, PowerNode,
...@@ -960,14 +960,14 @@ commands = { ...@@ -960,14 +960,14 @@ commands = {
[ArgNode(min=1, max=1), [ArgNode(min=1, max=1),
ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES), ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES),
ArgFile(min=1, max=1)], 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"), "<node_name> <storage_type> <name>", "Modify storage volume on a node"),
"repair-storage": ( "repair-storage": (
RepairStorage, RepairStorage,
[ArgNode(min=1, max=1), [ArgNode(min=1, max=1),
ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES), ArgChoice(min=1, max=1, choices=_REPAIRABLE_STORAGE_TYPES),
ArgFile(min=1, max=1)], 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>", "<node_name> <storage_type> <name>",
"Repairs a storage volume on a node"), "Repairs a storage volume on a node"),
"list-tags": ( "list-tags": (
......
...@@ -95,7 +95,7 @@ interpreted as stdin. ...@@ -95,7 +95,7 @@ interpreted as stdin.
EVACUATE EVACUATE
~~~~~~~~ ~~~~~~~~
| **evacuate** [-f] [\--early-release] | **evacuate** [-f] [\--early-release] [\--submit]
| [{-I|\--iallocator} *NAME* \| {-n|\--new-secondary} *destination\_node*] | [{-I|\--iallocator} *NAME* \| {-n|\--new-secondary} *destination\_node*]
| [{-p|\--primary-only} \| {-s|\--secondary-only} ] | [{-p|\--primary-only} \| {-s|\--secondary-only} ]
| {*node*} | {*node*}
...@@ -138,6 +138,9 @@ each affected instance individually: ...@@ -138,6 +138,9 @@ each affected instance individually:
in the secondary node change mode (only valid for DRBD instances) 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 - 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:: Example::
# gnt-node evacuate -I hail node3.example.com # gnt-node evacuate -I hail node3.example.com
...@@ -250,8 +253,8 @@ List the tags of the given node. ...@@ -250,8 +253,8 @@ List the tags of the given node.
MIGRATE MIGRATE
~~~~~~~ ~~~~~~~
**migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live] | **migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live]
[\--ignore-ipolicy] {*node*} | [\--ignore-ipolicy] [\--submit] {*node*}
This command will migrate all instances having the given node as This command will migrate all instances having the given node as
primary to their secondary nodes. This works only for instances primary to their secondary nodes. This works only for instances
...@@ -264,6 +267,9 @@ can be given to influence the migration type. ...@@ -264,6 +267,9 @@ can be given to influence the migration type.
If ``--ignore-ipolicy`` is given any instance policy violations occuring If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored. during this operation are ignored.
See **ganeti(7)** for a description of ``--submit`` and other common
options.
Example:: Example::
# gnt-node migrate node1.example.com # gnt-node migrate node1.example.com
...@@ -471,8 +477,8 @@ Example:: ...@@ -471,8 +477,8 @@ Example::
MODIFY-STORAGE MODIFY-STORAGE
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
**modify-storage** [``--allocatable=yes|no``] | **modify-storage** [\--allocatable={yes|no}] [\--submit]
{*node*} {*storage-type*} {*volume-name*} | {*node*} {*storage-type*} {*volume-name*}
Modifies storage volumes on a node. Only LVM physical volumes can Modifies storage volumes on a node. Only LVM physical volumes can
be modified at the moment. They have a storage type of "lvm-pv". be modified at the moment. They have a storage type of "lvm-pv".
...@@ -485,8 +491,8 @@ Example:: ...@@ -485,8 +491,8 @@ Example::
REPAIR-STORAGE REPAIR-STORAGE
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
**repair-storage** [\--ignore-consistency] {*node*} {*storage-type*} | **repair-storage** [\--ignore-consistency] ]\--submit]
{*volume-name*} | {*node*} {*storage-type*} {*volume-name*}
Repairs a storage volume on a node. Only LVM volume groups can be Repairs a storage volume on a node. Only LVM volume groups can be
repaired at this time. They have the storage type "lvm-vg". repaired at this time. They have the storage type "lvm-vg".
...@@ -511,7 +517,7 @@ Example:: ...@@ -511,7 +517,7 @@ Example::
POWERCYCLE POWERCYCLE
~~~~~~~~~~ ~~~~~~~~~~
**powercycle** [``--yes``] [``--force``] {*node*} **powercycle** [\--yes] [\--force] [\--submit] {*node*}
This command (tries to) forcefully reboot a node. It is a command 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 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 ...@@ -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 ``--force`` option is needed if the target node is the master
node. node.
See **ganeti(7)** for a description of ``--submit`` and other common
options.
POWER 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