Package ganeti :: Module cmdlib :: Class LUAddNode
[hide private]
[frames] | no frames]

Class LUAddNode

source code


Logical unit for adding node to the cluster.

Instance Methods [hide private]
 
CheckArguments(self)
Check syntactic validity for the opcode arguments.
source code
 
BuildHooksEnv(self)
Build hooks env.
source code
 
CheckPrereq(self)
Check prerequisites.
source code
 
Exec(self, feedback_fn)
Adds the new node to the cluster.
source code

Inherited from LogicalUnit: DeclareLocks, ExpandNames, HooksCallBack, __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  HPATH = "node-add"
  HTYPE = "NODE"
  _OP_PARAMS = [_PNodeName, ("primary_ip", None, _NoType), ("sec...
a list of opcode attributes, their defaults values they should get if not already defined, and types they must match

Inherited from LogicalUnit: REQ_BGL, ssh

Instance Variables [hide private]

Inherited from LogicalUnit: dry_run_result

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

CheckArguments(self)

source code 

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.

Overrides: LogicalUnit.CheckArguments
(inherited documentation)

BuildHooksEnv(self)

source code 

Build hooks env.

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

Overrides: LogicalUnit.BuildHooksEnv

CheckPrereq(self)

source code 

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.

Overrides: LogicalUnit.CheckPrereq

Exec(self, feedback_fn)

source code 

Adds the new node to the cluster.

Overrides: LogicalUnit.Exec

Class Variable Details [hide private]

_OP_PARAMS

a list of opcode attributes, their defaults values they should get if not already defined, and types they must match
Value:
[_PNodeName, ("primary_ip", None, _NoType), ("secondary_ip", None, _TM\
aybeString), ("readd", False, _TBool),]