+IGNORE_CONSIST_OPT = cli_option("--ignore-consistency",
+ dest="ignore_consistency",
+ action="store_true", default=False,
+ help="Ignore the consistency of the disks on"
+ " the secondary")
+
+NONLIVE_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)")
+
+NODE_PLACEMENT_OPT = cli_option("-n", "--node", dest="node",
+ help="Target node and optional secondary node",
+ metavar="<pnode>[:<snode>]",
+ completion_suggest=OPT_COMPL_INST_ADD_NODES)
+
+NODE_LIST_OPT = cli_option("-n", "--node", dest="nodes", default=[],
+ action="append", metavar="<node>",
+ help="Use only this node (can be used multiple"
+ " times, if not given defaults to all nodes)",
+ completion_suggest=OPT_COMPL_ONE_NODE)
+
+SINGLE_NODE_OPT = cli_option("-n", "--node", dest="node", help="Target node",
+ metavar="<node>",
+ completion_suggest=OPT_COMPL_ONE_NODE)
+
+NOSTART_OPT = cli_option("--no-start", dest="start", default=True,
+ action="store_false",
+ help="Don't start the instance after creation")
+
+SHOWCMD_OPT = cli_option("--show-cmd", dest="show_command",
+ action="store_true", default=False,
+ help="Show command instead of executing it")
+
+CLEANUP_OPT = cli_option("--cleanup", dest="cleanup",
+ default=False, action="store_true",
+ help="Instead of performing the migration, try to"
+ " recover from a failed cleanup. This is safe"
+ " to run even if the instance is healthy, but it"
+ " will create extra replication traffic and "
+ " disrupt briefly the replication (like during the"
+ " migration")
+
+STATIC_OPT = cli_option("-s", "--static", dest="static",
+ action="store_true", default=False,
+ help="Only show configuration data, not runtime data")
+
+ALL_OPT = cli_option("--all", dest="show_all",
+ default=False, action="store_true",
+ help="Show info on all instances on the cluster."
+ " This can take a long time to run, use wisely")
+
+SELECT_OS_OPT = cli_option("--select-os", dest="select_os",
+ action="store_true", default=False,
+ help="Interactive OS reinstall, lists available"
+ " OS templates for selection")
+
+IGNORE_FAILURES_OPT = cli_option("--ignore-failures", dest="ignore_failures",
+ action="store_true", default=False,
+ help="Remove the instance from the cluster"
+ " configuration even if there are failures"
+ " during the removal process")
+
+NEW_SECONDARY_OPT = cli_option("-n", "--new-secondary", dest="dst_node",
+ help="Specifies the new secondary node",
+ metavar="NODE", default=None,
+ completion_suggest=OPT_COMPL_ONE_NODE)
+
+ON_PRIMARY_OPT = cli_option("-p", "--on-primary", dest="on_primary",
+ default=False, action="store_true",
+ help="Replace the disk(s) on the primary"
+ " node (only for the drbd template)")
+
+ON_SECONDARY_OPT = cli_option("-s", "--on-secondary", dest="on_secondary",
+ default=False, action="store_true",
+ help="Replace the disk(s) on the secondary"
+ " node (only for the drbd template)")
+
+AUTO_REPLACE_OPT = cli_option("-a", "--auto", dest="auto",
+ default=False, action="store_true",
+ help="Automatically replace faulty disks"
+ " (only for the drbd template)")
+
+IGNORE_SIZE_OPT = cli_option("--ignore-size", dest="ignore_size",
+ default=False, action="store_true",
+ help="Ignore current recorded size"
+ " (useful for forcing activation when"
+ " the recorded size is wrong)")
+
+SRC_NODE_OPT = cli_option("--src-node", dest="src_node", help="Source node",
+ metavar="<node>",
+ completion_suggest=OPT_COMPL_ONE_NODE)
+
+SRC_DIR_OPT = cli_option("--src-dir", dest="src_dir", help="Source directory",
+ metavar="<dir>")
+
+SECONDARY_IP_OPT = cli_option("-s", "--secondary-ip", dest="secondary_ip",
+ help="Specify the secondary ip for the node",
+ metavar="ADDRESS", default=None)
+
+READD_OPT = cli_option("--readd", dest="readd",
+ default=False, action="store_true",
+ help="Readd old node after replacing it")
+
+NOSSH_KEYCHECK_OPT = cli_option("--no-ssh-key-check", dest="ssh_key_check",
+ default=True, action="store_false",
+ help="Disable SSH key fingerprint checking")
+
+
+MC_OPT = cli_option("-C", "--master-candidate", dest="master_candidate",
+ choices=_YESNO, default=None, metavar=_YORNO,
+ help="Set the master_candidate flag on the node")
+
+OFFLINE_OPT = cli_option("-O", "--offline", dest="offline", metavar=_YORNO,
+ choices=_YESNO, default=None,
+ help="Set the offline flag on the node")
+
+DRAINED_OPT = cli_option("-D", "--drained", dest="drained", metavar=_YORNO,
+ choices=_YESNO, default=None,
+ help="Set the drained flag on the node")
+
+ALLOCATABLE_OPT = cli_option("--allocatable", dest="allocatable",
+ choices=_YESNO, default=None, metavar=_YORNO,
+ help="Set the allocatable flag on a volume")
+
+NOLVM_STORAGE_OPT = cli_option("--no-lvm-storage", dest="lvm_storage",
+ help="Disable support for lvm based instances"
+ " (cluster-wide)",
+ action="store_false", default=True)
+
+ENABLED_HV_OPT = cli_option("--enabled-hypervisors",
+ dest="enabled_hypervisors",
+ help="Comma-separated list of hypervisors",
+ type="string", default=None)
+
+NIC_PARAMS_OPT = cli_option("-N", "--nic-parameters", dest="nicparams",
+ type="keyval", default={},
+ help="NIC parameters")
+
+CP_SIZE_OPT = cli_option("-C", "--candidate-pool-size", default=None,
+ dest="candidate_pool_size", type="int",
+ help="Set the candidate pool size")
+
+VG_NAME_OPT = cli_option("-g", "--vg-name", dest="vg_name",
+ help="Enables LVM and specifies the volume group"
+ " name (cluster-wide) for disk allocation [xenvg]",
+ metavar="VG", default=None)
+
+YES_DOIT_OPT = cli_option("--yes-do-it", dest="yes_do_it",
+ help="Destroy cluster", action="store_true")
+
+NOVOTING_OPT = cli_option("--no-voting", dest="no_voting",
+ help="Skip node agreement check (dangerous)",
+ action="store_true", default=False)
+
+MAC_PREFIX_OPT = cli_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=None)
+
+MASTER_NETDEV_OPT = cli_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)
+
+
+GLOBAL_FILEDIR_OPT = cli_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)
+
+NOMODIFY_ETCHOSTS_OPT = cli_option("--no-etc-hosts", dest="modify_etc_hosts",
+ help="Don't modify /etc/hosts",
+ action="store_false", default=True)
+
+NOMODIFY_SSH_SETUP_OPT = cli_option("--no-ssh-init", dest="modify_ssh_setup",
+ help="Don't initialize SSH keys",
+ action="store_false", default=True)
+
+ERROR_CODES_OPT = cli_option("--error-codes", dest="error_codes",
+ help="Enable parseable error messages",
+ action="store_true", default=False)
+
+NONPLUS1_OPT = cli_option("--no-nplus1-mem", dest="skip_nplusone_mem",
+ help="Skip N+1 memory redundancy tests",
+ action="store_true", default=False)
+
+REBOOT_TYPE_OPT = cli_option("-t", "--type", dest="reboot_type",
+ help="Type of reboot: soft/hard/full",
+ default=constants.INSTANCE_REBOOT_HARD,
+ metavar="<REBOOT>",
+ choices=list(constants.REBOOT_TYPES))
+
+IGNORE_SECONDARIES_OPT = cli_option("--ignore-secondaries",
+ dest="ignore_secondaries",
+ default=False, action="store_true",
+ help="Ignore errors from secondaries")
+
+NOSHUTDOWN_OPT = cli_option("--noshutdown", dest="shutdown",
+ action="store_false", default=True,
+ help="Don't shutdown the instance (unsafe)")
+
+TIMEOUT_OPT = cli_option("--timeout", dest="timeout", type="int",
+ default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
+ help="Maximum time to wait")
+
+SHUTDOWN_TIMEOUT_OPT = cli_option("--shutdown-timeout",
+ dest="shutdown_timeout", type="int",
+ default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
+ help="Maximum time to wait for instance shutdown")
+