- 'add': (AddNode, [ArgUnknown(min=1, max=1)],
- [DEBUG_OPT,
- cli_option("-s", "--secondary-ip", dest="secondary_ip",
- help="Specify the secondary ip for the node",
- metavar="ADDRESS", default=None),
- cli_option("--readd", dest="readd",
- default=False, action="store_true",
- help="Readd old node after replacing it"),
- cli_option("--no-ssh-key-check", dest="ssh_key_check",
- default=True, action="store_false",
- help="Disable SSH key fingerprint checking"),
- ],
- "[-s ip] [--readd] [--no-ssh-key-check] <node_name>",
- "Add a node to the cluster"),
- 'evacuate': (EvacuateNode, [ArgNode(min=1, max=1)],
- [DEBUG_OPT, FORCE_OPT,
- cli_option("-n", "--new-secondary", dest="dst_node",
- help="New secondary node", metavar="NODE",
- default=None),
- cli_option("-I", "--iallocator", metavar="<NAME>",
- help="Select new secondary for the instance"
- " automatically using the"
- " <NAME> iallocator plugin",
- default=None, type="string"),
- ],
- "[-f] {-I <iallocator> | -n <dst>} <node>",
- "Relocate the secondary instances from a node"
- " to other nodes (only for instances with drbd disk template)"),
- 'failover': (FailoverNode, [ArgNode(min=1, max=1)],
- [DEBUG_OPT, FORCE_OPT,
- cli_option("--ignore-consistency", dest="ignore_consistency",
- action="store_true", default=False,
- help="Ignore the consistency of the disks on"
- " the secondary"),
- ],
- "[-f] <node>",
- "Stops the primary instances on a node and start them on their"
- " secondary node (only for instances with drbd disk template)"),
- 'migrate': (MigrateNode, [ArgNode(min=1, max=1)],
- [DEBUG_OPT, FORCE_OPT,
- cli_option("--non-live", dest="live",
- default=True, action="store_false",
- help="Do a non-live migration (this usually means"
- " freeze the instance, save the state,"
- " transfer and only then resume running on the"
- " secondary node)"),
- ],
- "[-f] <node>",
- "Migrate all the primary instance on a node away from it"
- " (only for instances of type drbd)"),
- 'info': (ShowNodeConfig, [ArgNode()], [DEBUG_OPT],
- "[<node_name>...]", "Show information about the node(s)"),
- 'list': (ListNodes, [ArgNode()],
- [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT],
- "[nodes...]",
- "Lists the nodes in the cluster. The available fields"
- " are (see the man page for details): %s"
- " The default field list is (in order): %s." %
- (", ".join(_LIST_HEADERS), ", ".join(_LIST_DEF_FIELDS))),
- 'modify': (SetNodeParams, [ArgNode(min=1, max=1)],
- [DEBUG_OPT, FORCE_OPT,
- SUBMIT_OPT,
- cli_option("-C", "--master-candidate", dest="master_candidate",
- choices=('yes', 'no'), default=None,
- metavar="yes|no",
- help="Set the master_candidate flag on the node"),
- cli_option("-O", "--offline", dest="offline", metavar="yes|no",
- choices=('yes', 'no'), default=None,
- help="Set the offline flag on the node"),
- cli_option("-D", "--drained", dest="drained", metavar="yes|no",
- choices=('yes', 'no'), default=None,
- help="Set the drained flag on the node"),
- ],
- "<node>", "Alters the parameters of a node"),
- 'powercycle': (PowercycleNode, [ArgNode(min=1, max=1)],
- [DEBUG_OPT, FORCE_OPT, CONFIRM_OPT],
- "<node_name>", "Tries to forcefully powercycle a node"),
- 'remove': (RemoveNode, [ArgNode(min=1, max=1)], [DEBUG_OPT],
- "<node_name>", "Removes a node from the cluster"),
- 'volumes': (ListVolumes, [ArgNode()],
- [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
- "[<node_name>...]", "List logical volumes on node(s)"),
- 'physical-volumes': (ListPhysicalVolumes, [ArgNode()],
- [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT,
- FIELDS_OPT, _STORAGE_TYPE_OPT],
- "[<node_name>...]",
- "List physical volumes on node(s)"),
- 'modify-volume': (ModifyVolume,
- [ArgNode(min=1, max=1),
- ArgChoice(min=1, max=1,
- choices=_MODIFIABLE_STORAGE_TYPES),
- ArgFile(min=1, max=1)],
- [DEBUG_OPT,
- cli_option("--allocatable", dest="allocatable",
- choices=["yes", "no"], default=None,
- metavar="yes|no",
- help="Set the allocatable flag on a volume"),
- ],
- "<node_name> <storage_type> <name>",
- "Modify storage volume on a node"),
- 'repair-volume': (RepairVolume,
- [ArgNode(min=1, max=1),
- ArgChoice(min=1, max=1,
- choices=_REPAIRABLE_STORAGE_TYPES),
- ArgFile(min=1, max=1)],
- [DEBUG_OPT],
- "<node_name> <storage_type> <name>",
- "Repairs a storage volume on a node"),
- 'list-tags': (ListTags, [ArgNode(min=1, max=1)], [DEBUG_OPT],
- "<node_name>", "List the tags of the given node"),
- 'add-tags': (AddTags, [ArgNode(min=1, max=1), ArgUnknown()],
- [DEBUG_OPT, TAG_SRC_OPT],
- "<node_name> tag...", "Add tags to the given node"),
- 'remove-tags': (RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()],
- [DEBUG_OPT, TAG_SRC_OPT],
- "<node_name> tag...", "Remove tags from the given node"),
+ 'add': (
+ AddNode, [ArgHost(min=1, max=1)],
+ [SECONDARY_IP_OPT, READD_OPT, NOSSH_KEYCHECK_OPT],
+ "[-s ip] [--readd] [--no-ssh-key-check] <node_name>",
+ "Add a node to the cluster"),
+ 'evacuate': (
+ EvacuateNode, [ArgNode(min=1)],
+ [FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT, EARLY_RELEASE_OPT],
+ "[-f] {-I <iallocator> | -n <dst>} <node>",
+ "Relocate the secondary instances from a node"
+ " to other nodes (only for instances with drbd disk template)"),
+ 'failover': (
+ FailoverNode, ARGS_ONE_NODE, [FORCE_OPT, IGNORE_CONSIST_OPT],
+ "[-f] <node>",
+ "Stops the primary instances on a node and start them on their"
+ " secondary node (only for instances with drbd disk template)"),
+ 'migrate': (
+ MigrateNode, ARGS_ONE_NODE, [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT],
+ "[-f] <node>",
+ "Migrate all the primary instance on a node away from it"
+ " (only for instances of type drbd)"),
+ 'info': (
+ ShowNodeConfig, ARGS_MANY_NODES, [],
+ "[<node_name>...]", "Show information about the node(s)"),
+ 'list': (
+ ListNodes, ARGS_MANY_NODES,
+ [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT, ROMAN_OPT],
+ "[nodes...]",
+ "Lists the nodes in the cluster. The available fields are (see the man"
+ " page for details): %s. The default field list is (in order): %s." %
+ (utils.CommaJoin(_LIST_HEADERS), utils.CommaJoin(_LIST_DEF_FIELDS))),
+ 'modify': (
+ SetNodeParams, ARGS_ONE_NODE,
+ [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT,
+ AUTO_PROMOTE_OPT],
+ "<node_name>", "Alters the parameters of a node"),
+ 'powercycle': (
+ PowercycleNode, ARGS_ONE_NODE,
+ [FORCE_OPT, CONFIRM_OPT],
+ "<node_name>", "Tries to forcefully powercycle a node"),
+ 'remove': (
+ RemoveNode, ARGS_ONE_NODE, [],
+ "<node_name>", "Removes a node from the cluster"),
+ 'volumes': (
+ ListVolumes, [ArgNode()],
+ [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
+ "[<node_name>...]", "List logical volumes on node(s)"),
+ 'list-storage': (
+ ListStorage, ARGS_MANY_NODES,
+ [NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, _STORAGE_TYPE_OPT],
+ "[<node_name>...]", "List physical volumes on node(s). The available"
+ " fields are (see the man page for details): %s." %
+ (utils.CommaJoin(_LIST_STOR_HEADERS))),
+ 'modify-storage': (
+ ModifyStorage,
+ [ArgNode(min=1, max=1),
+ ArgChoice(min=1, max=1, choices=_MODIFIABLE_STORAGE_TYPES),
+ ArgFile(min=1, max=1)],
+ [ALLOCATABLE_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],
+ "<node_name> <storage_type> <name>",
+ "Repairs a storage volume on a node"),
+ 'list-tags': (
+ ListTags, ARGS_ONE_NODE, [],
+ "<node_name>", "List the tags of the given node"),
+ 'add-tags': (
+ AddTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT],
+ "<node_name> tag...", "Add tags to the given node"),
+ 'remove-tags': (
+ RemoveTags, [ArgNode(min=1, max=1), ArgUnknown()], [TAG_SRC_OPT],
+ "<node_name> tag...", "Remove tags from the given node"),