diff --git a/lib/cli.py b/lib/cli.py index 77ebfcb744e045d8b066a86d48aae6ad1fc425bf..25e3d7690dc5cfb07f9328896ea5cec8ba1778db 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -108,6 +108,7 @@ __all__ = [ "NODE_PLACEMENT_OPT", "NODEGROUP_OPT", "NODE_PARAMS_OPT", + "NODE_POWERED_OPT", "NODRBD_STORAGE_OPT", "NOHDR_OPT", "NOIPCHECK_OPT", diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py index ee712585bcd1a3940214511e4b16bd0576297e3b..24a9b25e0239b651994b40143667a08cb6811316 100644 --- a/lib/client/gnt_node.py +++ b/lib/client/gnt_node.py @@ -680,7 +680,8 @@ def SetNodeParams(opts, args): secondary_ip=opts.secondary_ip, force=opts.force, ndparams=opts.ndparams, - auto_promote=opts.auto_promote) + auto_promote=opts.auto_promote, + powered=opts.node_powered) # even if here we process the result, we allow submit only result = SubmitOrSend(op, opts) @@ -739,7 +740,8 @@ commands = { SetNodeParams, ARGS_ONE_NODE, [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT, CAPAB_MASTER_OPT, CAPAB_VM_OPT, SECONDARY_IP_OPT, - AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT, NODE_PARAMS_OPT], + AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT, NODE_PARAMS_OPT, + NODE_POWERED_OPT], "<node_name>", "Alters the parameters of a node"), 'powercycle': ( PowercycleNode, ARGS_ONE_NODE, diff --git a/man/gnt-node.rst b/man/gnt-node.rst index da5722f7cb67accbf51e0c9e4da390895ebecedb..01b4e72ddc91167dd9372a182b71a9d6e2df18b3 100644 --- a/man/gnt-node.rst +++ b/man/gnt-node.rst @@ -354,6 +354,7 @@ MODIFY | [--master-capable=``yes|no``] [--vm-capable=``yes|no``] [--auto-promote] | [-s *secondary_ip*] | [--node-parameters *ndparams*] +| [--node-powered=``yes|no``] | {*node*} This command changes the role of the node. Each options takes @@ -361,6 +362,9 @@ either a literal yes or no, and only one option should be given as yes. The meaning of the roles and flags are described in the manpage **ganeti**(7). +``--node-powered`` can be used to modify state-of-record if it doesn't reflect +the reality anymore. + In case a node is demoted from the master candidate role, the operation will be refused unless you pass the ``--auto-promote`` option. This option will cause the operation to lock all cluster nodes