Package ganeti :: Package client :: Module gnt_group
[hide private]
[frames] | no frames]

Module gnt_group

source code

Node group related commands

Functions [hide private]
int
AddGroup(opts, args)
Add a node group to the cluster.
source code
int
AssignNodes(opts, args)
Assign nodes to a group.
source code
 
_FmtDict(data)
Format dict data into command-line format.
source code
int
ListGroups(opts, args)
List node groups and their properties.
source code
int
ListGroupFields(opts, args)
List node fields.
source code
int
SetGroupParams(opts, args)
Modifies a node group's parameters.
source code
int
RemoveGroup(opts, args)
Remove a node group from the cluster.
source code
int
RenameGroup(opts, args)
Rename a node group.
source code
 
EvacuateGroup(opts, args)
Evacuate a node group.
source code
 
_FormatGroupInfo(group) source code
 
GroupInfo(_, args)
Shows info about node group.
source code
 
_GetCreateCommand(group) source code
 
ShowCreateCommand(opts, args)
Shows the command that can be used to re-create a node group.
source code
 
Main() source code
Variables [hide private]
  _LIST_DEF_FIELDS = ["name", "node_cnt", "pinst_cnt", "alloc_po...
default list of fields for ListGroups
  _ENV_OVERRIDE = compat.UniqueFrozenset(["list"])
  commands = {"add":(AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALL...

Imports: StringIO, ARGS_ONE_INSTANCE, POWER_DELAY_OPT, NEW_RAPI_CERT_OPT, OOB_TIMEOUT_OPT, TO_GROUP_OPT, MAC_PREFIX_OPT, IPOLICY_STD_SPECS_OPT, CONFIRM_OPT, NOSHUTDOWN_OPT, SHUTDOWN_TIMEOUT_OPT, ParseFields, PRIMARY_IP_VERSION_OPT, ARGS_NONE, ARGS_ONE_GROUP, ARGS_MANY_NODES, UsesRPC, ALLOC_POLICY_OPT, NEW_NODE_CERT_OPT, NOVOTING_OPT, INSTANCE_POLICY_OPTS, ArgUnknown, ERROR_CODES_OPT, SPECS_CPU_COUNT_OPT, SPECS_DISK_SIZE_OPT, SECONDARY_IP_OPT, ARGS_ONE_NETWORK, GATEWAY_OPT, REMOVE_INSTANCE_OPT, RQL_OPT, IPOLICY_DISK_TEMPLATES, FormatTimestamp, GenerateTable, ABSOLUTE_OPT, DEFAULT_IALLOCATOR_PARAMS_OPT, IGNORE_SIZE_OPT, COMMON_CREATE_OPTS, READD_OPT, NO_REMEMBER_OPT, SUBMIT_OPTS, ConfirmOperation, SubmitOrSend, RAPI_CERT_OPT, ROMAN_OPT, HV_STATE_OPT, HOTPLUG_IF_POSSIBLE_OPT, ARGS_MANY_NETWORKS, FILESTORE_DIR_OPT, RUNTIME_MEM_OPT, SEP_OPT, RESERVED_LVS_OPT, USE_EXTERNAL_MIP_SCRIPT, GLOBAL_SHARED_FILEDIR_OPT, FormatPolicyInfo, NOMODIFY_SSH_SETUP_OPT, GenericInstanceCreate, SubmitOpCodeToDrainedQueue, ArgChoice, ENABLED_USER_SHUTDOWN_OPT, TRANSPORT_COMPRESSION_OPT, NODE_FORCE_JOIN_OPT, DRY_RUN_OPT, CAPAB_VM_OPT, NODE_POWERED_OPT, NODE_PLACEMENT_OPT, JobExecutor, FixHvParams, ToStderr, SELECT_OS_OPT, SINGLE_NODE_OPT, ArgExtStorage, ArgOs, SPICE_CACERT_OPT, PrintIPolicyCommand, IGNORE_ERRORS_OPT, AUTO_REPLACE_OPT, HVLIST_OPT, cli_option, AskUser, ENABLED_DISK_TEMPLATES_OPT, DISK_STATE_OPT, USEUNITS_OPT, EARLY_RELEASE_OPT, VERBOSE_OPT, ArgHost, UIDPOOL_OPT, ALL_OPT, HOTPLUG_OPT, CalculateOSNames, OS_OPT, OFFLINE_OPT, ARGS_ONE_NODE, ArgCommand, FAILURE_ONLY_OPT, ALLOW_FAILOVER_OPT, NOSTART_OPT, SPECS_NIC_COUNT_OPT, OS_SIZE_OPT, DEBUG_OPT, ON_PRIMARY_OPT, JobSubmittedException, SUBMIT_OPT, MASTER_NETMASK_OPT, SPICE_CERT_OPT, NEW_CLUSTER_CERT_OPT, INTERVAL_OPT, ToStdout, FORCE_FILTER_OPT, OSPARAMS_OPT, AddTags, NONICS_OPT, NODE_PARAMS_OPT, ArgNetwork, RunWhileClusterStopped, BLK_OS_OPT, GLOBAL_FILEDIR_OPT, SRC_NODE_OPT, CAPAB_MASTER_OPT, MODIFY_ETCHOSTS_OPT, GenericListFields, SPECS_MEM_SIZE_OPT, GetNodesSshPorts, TAG_SRC_OPT, NOSSH_KEYCHECK_OPT, NET_OPT, IGNORE_FAILURES_OPT, ADD_UIDS_OPT, MASTER_NETDEV_OPT, USE_REPL_NET_OPT, NODEGROUP_OPT, SRC_DIR_OPT, SYNC_OPT, IDENTIFY_DEFAULTS_OPT, REMOVE_UIDS_OPT, HYPERVISOR_OPT, IGNORE_IPOLICY_OPT, MC_OPT, ONLINE_INST_OPT, IGNORE_SECONDARIES_OPT, SplitNodeOption, REBOOT_TYPE_OPT, NONPLUS1_OPT, IGNORE_CONSIST_OPT, NOHDR_OPT, NEW_SPICE_CERT_OPT, TAG_ADD_OPT, SPECS_DISK_COUNT_OPT, NONLIVE_OPT, ARGS_ONE_OS, DISK_OPT, PRIMARY_ONLY_OPT, RemoveTags, AUTO_PROMOTE_OPT, ListTags, DEFAULT_IALLOCATOR_OPT, NEW_PRIMARY_OPT, FORCE_VARIANT_OPT, GetOnlineNodes, NETWORK_OPT, TIMEOUT_OPT, NODE_LIST_OPT, GenericList, ON_SECONDARY_OPT, FormatLogMessage, ArgInstance, CLEANUP_OPT, CreateIPolicyFromOpts, MIGRATION_MODE_OPT, NIC_PARAMS_OPT, NOIPCHECK_OPT, ArgJobId, SEQUENTIAL_OPT, DRBD_HELPER_OPT, DEBUG_SIMERR_OPT, STATIC_OPT, DISK_TEMPLATE_OPT, FORCE_FAILOVER_OPT, ARGS_MANY_GROUPS, REASON_OPT, NO_INSTALL_OPT, YES_DOIT_OPT, FORCE_OPT, PRINT_JOBID_OPT, SHOWCMD_OPT, SPLIT_ISPECS_OPTS, ArgGroup, OFFLINE_INST_OPT, NWSYNC_OPT, NOCONFLICTSCHECK_OPT, PRIORITY_OPT, SECONDARY_ONLY_OPT, NEW_CLUSTER_DOMAIN_SECRET_OPT, FormatParamsDictInfo, SubmitOpCode, DRAINED_OPT, ParseTimespec, REMOVE_RESERVED_IPS_OPT, GenericMain, ArgFile, WFSYNC_OPT, PrintGenericInfo, NORUNTIME_CHGS_OPT, ArgNode, IGNORE_REMOVE_FAILURES_OPT, CP_SIZE_OPT, ADD_RESERVED_IPS_OPT, CLUSTER_DOMAIN_SECRET_OPT, HID_OS_OPT, SHOW_MACHINE_OPT, GATEWAY6_OPT, ALLOCATABLE_OPT, ARGS_MANY_INSTANCES, PREALLOC_WIPE_DISKS_OPT, NONAMECHECK_OPT, FormatQueryResult, FormatError, COMPRESS_OPT, MAINTAIN_NODE_HEALTH_OPT, ArgSuggest, HVOPTS_OPT, IPOLICY_VCPU_RATIO, GetClient, NETWORK6_OPT, NOMODIFY_ETCHOSTS_OPT, ENABLED_HV_OPT, NEW_SECONDARY_OPT, IGNORE_OFFLINE_OPT, VG_NAME_OPT, DISK_PARAMS_OPT, FIELDS_OPT, GLOBAL_GLUSTER_FILEDIR_OPT, DST_NODE_OPT, IALLOCATOR_OPT, NEW_CONFD_HMAC_KEY_OPT, FILESTORE_DRIVER_OPT, INCLUDEDEFAULTS_OPT, STARTUP_PAUSED_OPT, DISKIDX_OPT, BACKEND_OPT, constants, opcodes, utils, compat


Function Details [hide private]

AddGroup(opts, args)

source code 

Add a node group to the cluster.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - a list of length 1 with the name of the group to create
Returns: int
the desired exit code

AssignNodes(opts, args)

source code 

Assign nodes to a group.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - args[0]: group to assign nodes to; args[1:]: nodes to assign
Returns: int
the desired exit code

_FmtDict(data)

source code 

Format dict data into command-line format.

Parameters:
  • data - The input dict to be formatted
Returns:
The formatted dict

ListGroups(opts, args)

source code 

List node groups and their properties.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - groups to list, or empty for all
Returns: int
the desired exit code

ListGroupFields(opts, args)

source code 

List node fields.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - fields to list, or empty for all
Returns: int
the desired exit code

SetGroupParams(opts, args)

source code 

Modifies a node group's parameters.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain only one element, the node group name
Returns: int
the desired exit code

RemoveGroup(opts, args)

source code 

Remove a node group from the cluster.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - a list of length 1 with the name of the group to remove
Returns: int
the desired exit code

RenameGroup(opts, args)

source code 

Rename a node group.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - a list of length 2, [old_name, new_name]
Returns: int
the desired exit code

ShowCreateCommand(opts, args)

source code 

Shows the command that can be used to re-create a node group.

Currently it works only for ipolicy specs.


Variables Details [hide private]

_LIST_DEF_FIELDS

default list of fields for ListGroups

Value:
["name", "node_cnt", "pinst_cnt", "alloc_policy", "ndparams"]

commands

Value:
{"add":(AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALLOC_POLICY_OPT, NODE\
_PARAMS_OPT, DISK_PARAMS_OPT, HV_STATE_OPT, DISK_STATE_OPT, PRIORITY_O\
PT]+ SUBMIT_OPTS+ INSTANCE_POLICY_OPTS, "<group_name>", "Add a new nod\
e group to the cluster"), "assign-nodes":(AssignNodes, ARGS_ONE_GROUP+\
 ARGS_MANY_NODES, [DRY_RUN_OPT, FORCE_OPT, PRIORITY_OPT]+ SUBMIT_OPTS,\
 "<group_name> <node>...", "Assign nodes to a group"), "list":(ListGro\
ups, ARGS_MANY_GROUPS, [NOHDR_OPT, SEP_OPT, FIELDS_OPT, VERBOSE_OPT, F\
ORCE_FILTER_OPT], "[<group_name>...]", "Lists the node groups in the c\
...