module documentation

Node related commands

Class ReplyStatus Class holding a reply status for synchronous confd clients.
Function AddNode Add a node to the cluster.
Function ConvertStorageType Converts a user storage type to its internal name.
Function EvacuateNode Relocate all secondary instance from a node.
Function FailoverNode Failover all primary instance on a node.
Function Health Show health of a node using OOB.
Function ListDrbd Modifies a node.
Function ListNodeFields List node fields.
Function ListNodes List nodes and their properties.
Function ListStorage List physical volumes on node(s).
Function ListVolumes List logical volumes on node(s).
Function Main Undocumented
Function MigrateNode Migrate all primary instance on a node.
Function ModifyStorage Modify storage volume on a node.
Function PowercycleNode Remove a node from the cluster.
Function PowerNode Change/ask power state of a node.
Function RemoveNode Remove a node from the cluster.
Function RepairStorage Repairs a storage volume on a node.
Function RestrictedCommand Runs a remote command on node(s).
Function SetNodeParams Modifies a node.
Function ShowNodeConfig Show node information.
Constant IGNORE_STATUS_OPT Undocumented
Constant NONODE_SETUP_OPT Undocumented
Variable aliases Undocumented
Variable commands Undocumented
Function _FormatNodeInfo Format node information for cli.PrintGenericInfo().
Function _ReadSshKeys Reads the DSA SSH keys according to keyfiles.
Function _SetupSSH Configures a destination node's SSH daemon.
Function _TryReadFile Tries to read a file.
Constant _ENV_OVERRIDE Undocumented
Constant _LIST_DEF_FIELDS Undocumented
Constant _LIST_POWER_COMMANDS Undocumented
Constant _LIST_STOR_DEF_FIELDS Undocumented
Constant _LIST_STOR_HEADERS Undocumented
Constant _LIST_VOL_DEF_FIELDS Undocumented
Constant _MODIFIABLE_STORAGE_TYPES Undocumented
Constant _OOB_COMMAND_ASK Undocumented
Constant _REPAIRABLE_STORAGE_TYPES Undocumented
Constant _STORAGE_TYPE_OPT Undocumented
Constant _USER_STORAGE_TYPE Undocumented
@RunWithRPC
def AddNode(opts, args):

Add a node to the cluster.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the new node name
Returns
intthe desired exit code
def ConvertStorageType(user_storage_type):

Converts a user storage type to its internal name.

def EvacuateNode(opts, args):

Relocate all secondary instance from a node.

Parameters
optsthe command line options selected by the user
args:listshould be an empty list
Returns
intthe desired exit code
def FailoverNode(opts, args):

Failover all primary instance on a node.

Parameters
optsthe command line options selected by the user
args:listshould be an empty list
Returns
intthe desired exit code
def Health(opts, args):

Show health of a node using OOB.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the name of the node to be removed
Returns
intthe desired exit code
def ListDrbd(opts, args):

Modifies a node.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the node name
Returns
intthe desired exit code
def ListNodeFields(opts, args):

List node fields.

Parameters
optsthe command line options selected by the user
args:listfields to list, or empty for all
Returns
intthe desired exit code
def ListNodes(opts, args):

List nodes and their properties.

Parameters
optsthe command line options selected by the user
args:listnodes to list, or empty for all
Returns
intthe desired exit code
def ListStorage(opts, args):

List physical volumes on node(s).

Parameters
optsthe command line options selected by the user
args:listshould either be an empty list, in which case we list data for all nodes, or contain a list of nodes to display data only for those
Returns
intthe desired exit code
def ListVolumes(opts, args):

List logical volumes on node(s).

Parameters
optsthe command line options selected by the user
args:listshould either be an empty list, in which case we list data for all nodes, or contain a list of nodes to display data only for those
Returns
intthe desired exit code
def Main():

Undocumented

def MigrateNode(opts, args):

Migrate all primary instance on a node.

def ModifyStorage(opts, args):

Modify storage volume on a node.

Parameters
optsthe command line options selected by the user
args:listshould contain 3 items: node name, storage type and volume name
Returns
intthe desired exit code
def PowercycleNode(opts, args):

Remove a node from the cluster.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the name of the node to be removed
Returns
intthe desired exit code
def PowerNode(opts, args):

Change/ask power state of a node.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the name of the node to be removed
Returns
intthe desired exit code
def RemoveNode(opts, args):

Remove a node from the cluster.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the name of the node to be removed
Returns
intthe desired exit code
def RepairStorage(opts, args):

Repairs a storage volume on a node.

Parameters
optsthe command line options selected by the user
args:listshould contain 3 items: node name, storage type and volume name
Returns
intthe desired exit code
def RestrictedCommand(opts, args):

Runs a remote command on node(s).

Parameters
optsCommand line options selected by user
args:listCommand line arguments
Returns
intExit code
def SetNodeParams(opts, args):

Modifies a node.

Parameters
optsthe command line options selected by the user
args:listshould contain only one element, the node name
Returns
intthe desired exit code
def ShowNodeConfig(opts, args):

Show node information.

Parameters
optsthe command line options selected by the user
args:listshould either be an empty list, in which case we show information about all nodes, or should contain a list of nodes to be queried for information
Returns
intthe desired exit code
IGNORE_STATUS_OPT =

Undocumented

Value
cli_option('--ignore-status',
           default=False,
           action='store_true',
           dest='ignore_status',
           help='Ignore the Node(s) offline status (potentially DANGEROUS)')
NONODE_SETUP_OPT =

Undocumented

Value
cli_option('--no-node-setup',
           default=True,
           action='store_false',
           dest='node_setup',
           help='Do not make initial SSH setup on remote node (needs to be done 
manually)')
aliases: dict[str, str] =

Undocumented

commands =

Undocumented

def _FormatNodeInfo(node_info):

Format node information for cli.PrintGenericInfo().

def _ReadSshKeys(keyfiles, _tostderr_fn=ToStderr):

Reads the DSA SSH keys according to keyfiles.

Parameters
keyfiles:dictDictionary with keys of constants.SSHK_ALL and two-values tuples (private and public key file)
_tostderr_fnUndocumented
Returns
listList of three-values tuples (constants.SSHK_ALL, private and public key as strings)
def _SetupSSH(options, cluster_name, node, ssh_port, cl):

Configures a destination node's SSH daemon.

Parameters
optionsCommand line options @type cluster_name
cluster_nameCluster name
node:stringDestination node name
ssh_port:intDestination node ssh port
clluxi client
def _TryReadFile(path):

Tries to read a file.

If the file is not found, None is returned.

Parameters
path:stringFilename
Returns
None or stringUndocumented
Unknown Field: todo
Consider adding a generic ENOENT wrapper
_ENV_OVERRIDE =

Undocumented

Value
compat.UniqueFrozenset(['list'])
_LIST_DEF_FIELDS: list[str] =

Undocumented

Value
['name',
 'dtotal',
 'dfree',
 'mtotal',
 'mnode',
 'mfree',
 'pinst_cnt',
...
_LIST_POWER_COMMANDS: list[str] =

Undocumented

Value
['on', 'off', 'cycle', 'status']
_LIST_STOR_HEADERS =

Undocumented

Value
{constants.SF_NODE: 'Node',
 constants.SF_TYPE: 'Type',
 constants.SF_NAME: 'Name',
 constants.SF_SIZE: 'Size',
 constants.SF_USED: 'Used',
 constants.SF_FREE: 'Free',
 constants.SF_ALLOCATABLE: 'Allocatable'}
_LIST_VOL_DEF_FIELDS: list[str] =

Undocumented

Value
['node', 'phys', 'vg', 'name', 'size', 'instance']
_MODIFIABLE_STORAGE_TYPES =

Undocumented

Value
list(constants.MODIFIABLE_STORAGE_FIELDS)
_REPAIRABLE_STORAGE_TYPES =

Undocumented

Value
[st for st, so in constants.VALID_STORAGE_OPERATIONS.items() if constants.
    SO_FIX_CONSISTENCY in so]
_STORAGE_TYPE_OPT =

Undocumented

Value
cli_option('-t', '--storage-type',
           dest='user_storage_type',
           choices=list(_USER_STORAGE_TYPE),
           default=None,
           metavar='STORAGE_TYPE',
           help='Storage type (%s)'%utils.CommaJoin(list(_USER_STORAGE_TYPE)))
_USER_STORAGE_TYPE =

Undocumented

Value
{constants.ST_FILE: 'file',
 constants.ST_LVM_PV: 'lvm-pv',
 constants.ST_LVM_VG: 'lvm-vg',
 constants.ST_SHARED_FILE: 'sharedfile',
 constants.ST_GLUSTER: 'gluster'}