Revision f5118ade scripts/gnt-node
b/scripts/gnt-node | ||
---|---|---|
391 | 391 |
return 0 |
392 | 392 |
|
393 | 393 |
|
394 |
def PowercycleNode(opts, args): |
|
395 |
"""Remove a node from the cluster. |
|
396 |
|
|
397 |
@param opts: the command line options selected by the user |
|
398 |
@type args: list |
|
399 |
@param args: should contain only one element, the name of |
|
400 |
the node to be removed |
|
401 |
@rtype: int |
|
402 |
@return: the desired exit code |
|
403 |
|
|
404 |
""" |
|
405 |
node = args[0] |
|
406 |
if (not opts.confirm and |
|
407 |
not AskUser("Are you sure you want to hard powercycle node %s?" % node)): |
|
408 |
return 2 |
|
409 |
|
|
410 |
op = opcodes.OpPowercycleNode(node_name=node, force=opts.force) |
|
411 |
result = SubmitOpCode(op) |
|
412 |
ToStderr(result) |
|
413 |
return 0 |
|
414 |
|
|
415 |
|
|
394 | 416 |
def ListVolumes(opts, args): |
395 | 417 |
"""List logical volumes on node(s). |
396 | 418 |
|
... | ... | |
552 | 574 |
help="Set the drained flag on the node"), |
553 | 575 |
], |
554 | 576 |
"<instance>", "Alters the parameters of an instance"), |
577 |
'powercycle': (PowercycleNode, ARGS_ONE, [DEBUG_OPT, FORCE_OPT, CONFIRM_OPT], |
|
578 |
"<node_name>", "Tries to forcefully powercycle a node"), |
|
555 | 579 |
'remove': (RemoveNode, ARGS_ONE, [DEBUG_OPT], |
556 | 580 |
"<node_name>", "Removes a node from the cluster"), |
557 | 581 |
'volumes': (ListVolumes, ARGS_ANY, |
Also available in: Unified diff