class documentation

class LUNodeAdd(LogicalUnit):

View In Hierarchy

Logical unit for adding node to the cluster.

Method BuildHooksEnv Build hooks env.
Method BuildHooksNodes Build hooks nodes.
Method CheckArguments Check syntactic validity for the opcode arguments.
Method CheckPrereq Check prerequisites.
Method Exec Adds the new node to the cluster.
Method PreparePostHookNodes Extend list of nodes to run the post LU hook.
Constant HPATH Undocumented
Instance Variable changed_primary_ip Undocumented
Instance Variable hostname Undocumented
Instance Variable master_candidate Undocumented
Instance Variable new_disk_state Undocumented
Instance Variable new_hv_state Undocumented
Instance Variable new_node Undocumented
Instance Variable node_group Undocumented
Instance Variable primary_ip_family Undocumented
Method _InitOpenVSwitch Undocumented
Method _SshUpdate Update the SSH setup of all nodes after adding a new node.
Constant _NFLAGS Undocumented

Inherited from LogicalUnit:

Method __init__ Constructor for LogicalUnit.
Method AssertReleasedLocks Raise AssertionError if the LU holds some locks of the given level.
Method DeclareLocks Declare LU locking needs for a level
Method ExpandNames Expand names for this LU.
Method HooksCallBack Notify the LU about the results of its hooks.
Method owned_locks Return the list of locks owned by the LU at a given level.
Method PrepareRetry Prepare the LU to run again.
Method release_request Return a request to release the specified locks of the given level.
Method WConfdClient Undocumented
Constant HTYPE Undocumented
Constant REQ_BGL Undocumented
Instance Variable add_locks Undocumented
Instance Variable cfg Undocumented
Instance Variable dont_collate_locks Undocumented
Instance Variable dry_run_result the value (if any) that will be returned to the caller in dry-run mode (signalled by opcode dry_run parameter)
Instance Variable Log Undocumented
Instance Variable LogInfo Undocumented
Instance Variable LogStep Undocumented
Instance Variable LogWarning Undocumented
Instance Variable needed_locks Undocumented
Instance Variable op Undocumented
Instance Variable opportunistic_locks Undocumented
Instance Variable opportunistic_locks_count Undocumented
Instance Variable proc Undocumented
Instance Variable recalculate_locks Undocumented
Instance Variable rpc Undocumented
Instance Variable share_locks Undocumented
Instance Variable tasklets Undocumented
Instance Variable wconfd Undocumented
Instance Variable wconfdcontext Undocumented
Instance Variable wconfdlocks Undocumented
Method _ExpandAndLockInstance Helper function to expand and lock an instance.
Method _LockInstancesNodes Helper function to declare instances' nodes for locking.
def BuildHooksEnv(self):

Build hooks env.

This will run on all nodes before, and on all nodes + the new node after.

def BuildHooksNodes(self):

Build hooks nodes.

def CheckArguments(self):

Check syntactic validity for the opcode arguments.

This method is for doing a simple syntactic check and ensure validity of opcode parameters, without any cluster-related checks. While the same can be accomplished in ExpandNames and/or CheckPrereq, doing these separate is better because:

  • ExpandNames is left as as purely a lock-related function
  • CheckPrereq is run after we have acquired locks (and possible waited for them)

The function is allowed to change the self.op attribute so that later methods can no longer worry about missing parameters.

def CheckPrereq(self):

Check prerequisites.

This checks:

  • the new node is not already in the config
  • it is resolvable
  • its parameters (single/dual homed) matches the cluster

Any errors are signaled by raising errors.OpPrereqError.

def Exec(self, feedback_fn):

Adds the new node to the cluster.

def PreparePostHookNodes(self, post_hook_node_uuids):

Extend list of nodes to run the post LU hook.

This method allows LUs to change the list of node UUIDs on which the post hook should run after the LU has been executed but before the post hook is run.

Parameters
post_hook_node_uuids:listThe initial list of node UUIDs to run the post hook on, as returned by BuildHooksNodes.
Returns
listlist of node UUIDs on which the post hook should run. The default implementation returns the passed in post_hook_node_uuids, but custom implementations can choose to alter the list.
HPATH: str =

Undocumented

Value
'node-add'
changed_primary_ip: bool =

Undocumented

hostname =

Undocumented

master_candidate =

Undocumented

new_disk_state =

Undocumented

new_hv_state =

Undocumented

new_node =

Undocumented

node_group =

Undocumented

primary_ip_family =

Undocumented

def _InitOpenVSwitch(self):

Undocumented

def _SshUpdate(self, new_node_uuid, new_node_name, is_master_candidate, is_potential_master_candidate, rpcrunner, readd, feedback_fn):

Update the SSH setup of all nodes after adding a new node.

Parameters
new_node_uuidUndocumented
new_node_nameUndocumented
is_master_candidateUndocumented
is_potential_master_candidateUndocumented
rpcrunnerUndocumented
readd:booleanwhether or not this node is readded
feedback_fnUndocumented
_NFLAGS: list[str] =

Undocumented

Value
['master_capable', 'vm_capable']