- 'init': (InitCluster, ARGS_ONE,
- [DEBUG_OPT,
- make_option("-s", "--secondary-ip", dest="secondary_ip",
- help="Specify the secondary ip for this node;"
- " if given, the entire cluster must have secondary"
- " addresses",
- metavar="ADDRESS", default=None),
- make_option("-m", "--mac-prefix", dest="mac_prefix",
- help="Specify the mac prefix for the instance IP"
- " addresses, in the format XX:XX:XX",
- metavar="PREFIX",
- default=constants.DEFAULT_MAC_PREFIX,),
- make_option("-g", "--vg-name", dest="vg_name",
- help="Specify the volume group name "
- " (cluster-wide) for disk allocation [xenvg]",
- metavar="VG",
- default=None,),
- make_option("--master-netdev", dest="master_netdev",
- help="Specify the node interface (cluster-wide)"
- " on which the master IP address will be added "
- " [%s]" % constants.DEFAULT_BRIDGE,
- metavar="NETDEV",
- default=constants.DEFAULT_BRIDGE,),
- make_option("--file-storage-dir", dest="file_storage_dir",
- help="Specify the default directory (cluster-wide)"
- " for storing the file-based disks [%s]" %
- constants.DEFAULT_FILE_STORAGE_DIR,
- metavar="DIR",
- default=constants.DEFAULT_FILE_STORAGE_DIR,),
- make_option("--no-lvm-storage", dest="lvm_storage",
- help="No support for lvm based instances"
- " (cluster-wide)",
- action="store_false", default=True,),
- make_option("--no-etc-hosts", dest="modify_etc_hosts",
- help="Don't modify /etc/hosts"
- " (cluster-wide)",
- action="store_false", default=True,),
- make_option("--enabled-hypervisors", dest="enabled_hypervisors",
- help="Comma-separated list of hypervisors",
- type="string",
- default=constants.DEFAULT_ENABLED_HYPERVISOR),
- ikv_option("-H", "--hypervisor-parameters", dest="hvparams",
- help="Hypervisor and hypervisor options, in the"
- " format"
- " hypervisor:option=value,option=value,...",
- default=[],
- action="append",
- type="identkeyval"),
- keyval_option("-B", "--backend-parameters", dest="beparams",
- type="keyval", default={},
- help="Backend parameters"),
- keyval_option("-N", "--nic-parameters", dest="nicparams",
- type="keyval", default={},
- help="NIC parameters"),
- make_option("-C", "--candidate-pool-size",
- default=constants.MASTER_POOL_SIZE_DEFAULT,
- help="Set the candidate pool size",
- dest="candidate_pool_size", type="int"),
- ],
- "[opts...] <cluster_name>",
- "Initialises a new cluster configuration"),
- 'destroy': (DestroyCluster, ARGS_NONE,
- [DEBUG_OPT,
- make_option("--yes-do-it", dest="yes_do_it",
- help="Destroy cluster",
- action="store_true"),
- ],
- "", "Destroy cluster"),
- 'rename': (RenameCluster, ARGS_ONE, [DEBUG_OPT, FORCE_OPT],
- "<new_name>",
- "Renames the cluster"),
- 'redist-conf': (RedistributeConfig, ARGS_NONE, [DEBUG_OPT, SUBMIT_OPT],
- "",
- "Forces a push of the configuration file and ssconf files"
- " to the nodes in the cluster"),
- 'verify': (VerifyCluster, ARGS_NONE, [DEBUG_OPT,
- make_option("--no-nplus1-mem", dest="skip_nplusone_mem",
- help="Skip N+1 memory redundancy tests",
- action="store_true",
- default=False,),
- ],
- "", "Does a check on the cluster configuration"),
- 'verify-disks': (VerifyDisks, ARGS_NONE, [DEBUG_OPT],
- "", "Does a check on the cluster disk status"),
- 'repair-disk-sizes': (RepairDiskSizes, ARGS_ANY, [DEBUG_OPT],
- "", "Updates mismatches in recorded disk sizes"),
- 'masterfailover': (MasterFailover, ARGS_NONE, [DEBUG_OPT,
- make_option("--no-voting", dest="no_voting",
- help="Skip node agreement check (dangerous)",
- action="store_true",
- default=False,),
- ],
- "", "Makes the current node the master"),
- 'version': (ShowClusterVersion, ARGS_NONE, [DEBUG_OPT],
- "", "Shows the cluster version"),
- 'getmaster': (ShowClusterMaster, ARGS_NONE, [DEBUG_OPT],
- "", "Shows the cluster master"),
- 'copyfile': (ClusterCopyFile, ARGS_ONE, [DEBUG_OPT, node_option],
- "[-n node...] <filename>",
- "Copies a file to all (or only some) nodes"),
- 'command': (RunClusterCommand, ARGS_ATLEAST(1), [DEBUG_OPT, node_option],
- "[-n node...] <command>",
- "Runs a command on all (or only some) nodes"),
- 'info': (ShowClusterConfig, ARGS_NONE, [DEBUG_OPT],
- "", "Show cluster configuration"),
- 'list-tags': (ListTags, ARGS_NONE,
- [DEBUG_OPT], "", "List the tags of the cluster"),
- 'add-tags': (AddTags, ARGS_ANY, [DEBUG_OPT, TAG_SRC_OPT],
- "tag...", "Add tags to the cluster"),
- 'remove-tags': (RemoveTags, ARGS_ANY, [DEBUG_OPT, TAG_SRC_OPT],
- "tag...", "Remove tags from the cluster"),
- 'search-tags': (SearchTags, ARGS_ONE,
- [DEBUG_OPT], "", "Searches the tags on all objects on"
- " the cluster for a given pattern (regex)"),
- 'queue': (QueueOps, ARGS_ONE, [DEBUG_OPT],
- "drain|undrain|info", "Change queue properties"),
- 'modify': (SetClusterParams, ARGS_NONE,
- [DEBUG_OPT,
- make_option("-g", "--vg-name", dest="vg_name",
- help="Specify the volume group name "
- " (cluster-wide) for disk allocation "
- "and enable lvm based storage",
- metavar="VG",),
- make_option("--no-lvm-storage", dest="lvm_storage",
- help="Disable support for lvm based instances"
- " (cluster-wide)",
- action="store_false", default=True,),
- make_option("--enabled-hypervisors", dest="enabled_hypervisors",
- help="Comma-separated list of hypervisors",
- type="string", default=None),
- ikv_option("-H", "--hypervisor-parameters", dest="hvparams",
- help="Hypervisor and hypervisor options, in the"
- " format"
- " hypervisor:option=value,option=value,...",
- default=[],
- action="append",
- type="identkeyval"),
- keyval_option("-B", "--backend-parameters", dest="beparams",
- type="keyval", default={},
- help="Backend parameters"),
- keyval_option("-N", "--nic-parameters", dest="nicparams",
- type="keyval", default={},
- help="NIC parameters"),
- make_option("-C", "--candidate-pool-size", default=None,
- help="Set the candidate pool size",
- dest="candidate_pool_size", type="int"),
- ],
- "[opts...]",
- "Alters the parameters of the cluster"),
+ 'init': (
+ InitCluster, [ArgHost(min=1, max=1)],
+ [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT,
+ HVLIST_OPT, MAC_PREFIX_OPT, MASTER_NETDEV_OPT, NIC_PARAMS_OPT,
+ NOLVM_STORAGE_OPT, NOMODIFY_ETCHOSTS_OPT, NOMODIFY_SSH_SETUP_OPT,
+ SECONDARY_IP_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
+ UIDPOOL_OPT, DRBD_HELPER_OPT, NODRBD_STORAGE_OPT,
+ DEFAULT_IALLOCATOR_OPT, PRIMARY_IP_VERSION_OPT, PREALLOC_WIPE_DISKS_OPT],
+ "[opts...] <cluster_name>", "Initialises a new cluster configuration"),
+ 'destroy': (
+ DestroyCluster, ARGS_NONE, [YES_DOIT_OPT],
+ "", "Destroy cluster"),
+ 'rename': (
+ RenameCluster, [ArgHost(min=1, max=1)],
+ [FORCE_OPT, DRY_RUN_OPT],
+ "<new_name>",
+ "Renames the cluster"),
+ 'redist-conf': (
+ RedistributeConfig, ARGS_NONE, [SUBMIT_OPT, DRY_RUN_OPT, PRIORITY_OPT],
+ "", "Forces a push of the configuration file and ssconf files"
+ " to the nodes in the cluster"),
+ 'verify': (
+ VerifyCluster, ARGS_NONE,
+ [VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT,
+ DRY_RUN_OPT, PRIORITY_OPT],
+ "", "Does a check on the cluster configuration"),
+ 'verify-disks': (
+ VerifyDisks, ARGS_NONE, [PRIORITY_OPT],
+ "", "Does a check on the cluster disk status"),
+ 'repair-disk-sizes': (
+ RepairDiskSizes, ARGS_MANY_INSTANCES, [DRY_RUN_OPT, PRIORITY_OPT],
+ "", "Updates mismatches in recorded disk sizes"),
+ 'master-failover': (
+ MasterFailover, ARGS_NONE, [NOVOTING_OPT],
+ "", "Makes the current node the master"),
+ 'master-ping': (
+ MasterPing, ARGS_NONE, [],
+ "", "Checks if the master is alive"),
+ 'version': (
+ ShowClusterVersion, ARGS_NONE, [],
+ "", "Shows the cluster version"),
+ 'getmaster': (
+ ShowClusterMaster, ARGS_NONE, [],
+ "", "Shows the cluster master"),
+ 'copyfile': (
+ ClusterCopyFile, [ArgFile(min=1, max=1)],
+ [NODE_LIST_OPT, USE_REPL_NET_OPT],
+ "[-n node...] <filename>", "Copies a file to all (or only some) nodes"),
+ 'command': (
+ RunClusterCommand, [ArgCommand(min=1)],
+ [NODE_LIST_OPT],
+ "[-n node...] <command>", "Runs a command on all (or only some) nodes"),
+ 'info': (
+ ShowClusterConfig, ARGS_NONE, [ROMAN_OPT],
+ "[--roman]", "Show cluster configuration"),
+ 'list-tags': (
+ ListTags, ARGS_NONE, [], "", "List the tags of the cluster"),
+ 'add-tags': (
+ AddTags, [ArgUnknown()], [TAG_SRC_OPT, PRIORITY_OPT],
+ "tag...", "Add tags to the cluster"),
+ 'remove-tags': (
+ RemoveTags, [ArgUnknown()], [TAG_SRC_OPT, PRIORITY_OPT],
+ "tag...", "Remove tags from the cluster"),
+ 'search-tags': (
+ SearchTags, [ArgUnknown(min=1, max=1)], [PRIORITY_OPT], "",
+ "Searches the tags on all objects on"
+ " the cluster for a given pattern (regex)"),
+ 'queue': (
+ QueueOps,
+ [ArgChoice(min=1, max=1, choices=["drain", "undrain", "info"])],
+ [], "drain|undrain|info", "Change queue properties"),
+ 'watcher': (
+ WatcherOps,
+ [ArgChoice(min=1, max=1, choices=["pause", "continue", "info"]),
+ ArgSuggest(min=0, max=1, choices=["30m", "1h", "4h"])],
+ [],
+ "{pause <timespec>|continue|info}", "Change watcher properties"),
+ 'modify': (
+ SetClusterParams, ARGS_NONE,
+ [BACKEND_OPT, CP_SIZE_OPT, ENABLED_HV_OPT, HVLIST_OPT,
+ NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, VG_NAME_OPT, MAINTAIN_NODE_HEALTH_OPT,
+ UIDPOOL_OPT, ADD_UIDS_OPT, REMOVE_UIDS_OPT, DRBD_HELPER_OPT,
+ NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, RESERVED_LVS_OPT,
+ DRY_RUN_OPT, PRIORITY_OPT],
+ "[opts...]",
+ "Alters the parameters of the cluster"),
+ "renew-crypto": (
+ RenewCrypto, ARGS_NONE,
+ [NEW_CLUSTER_CERT_OPT, NEW_RAPI_CERT_OPT, RAPI_CERT_OPT,
+ NEW_CONFD_HMAC_KEY_OPT, FORCE_OPT,
+ NEW_CLUSTER_DOMAIN_SECRET_OPT, CLUSTER_DOMAIN_SECRET_OPT],
+ "[opts...]",
+ "Renews cluster certificates, keys and secrets"),