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

Class LUCreateInstance

source code


Create an instance.

Instance Methods [hide private]
 
CheckArguments(self)
Check arguments.
source code
 
ExpandNames(self)
ExpandNames for CreateInstance.
source code
 
_RunAllocator(self)
Run the allocator based on input opcode.
source code
 
BuildHooksEnv(self)
Build hooks env.
source code
 
_ReadExportInfo(self)
Reads the export information from disk.
source code
 
_ReadExportParams(self, einfo)
Use export parameters as defaults.
source code
 
_RevertToDefaults(self, cluster)
Revert the instance parameters to the default values.
source code
 
CheckPrereq(self)
Check prerequisites.
source code
 
Exec(self, feedback_fn)
Create and add the instance to the cluster.
source code

Inherited from LogicalUnit: DeclareLocks, HooksCallBack, __init__

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

Class Variables [hide private]
  HPATH = "instance-add"
  HTYPE = "INSTANCE"
  _OP_PARAMS = [_PInstanceName, ("mode", ht.NoDefault, ht.TElemO...
a list of opcode attributes, their defaults values they should get if not already defined, and types they must match
  REQ_BGL = False

Inherited from LogicalUnit: 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 arguments.

Overrides: LogicalUnit.CheckArguments

ExpandNames(self)

source code 

ExpandNames for CreateInstance.

Figure out the right locks for instance creation.

Overrides: LogicalUnit.ExpandNames

BuildHooksEnv(self)

source code 

Build hooks env.

This runs on master, primary and secondary nodes of the instance.

Overrides: LogicalUnit.BuildHooksEnv

_ReadExportInfo(self)

source code 

Reads the export information from disk.

It will override the opcode source node and path with the actual information, if these two were not specified before.

Returns:
the export information

_ReadExportParams(self, einfo)

source code 

Use export parameters as defaults.

In case the opcode doesn't specify (as in override) some instance parameters, then try to use them from the export information, if that declares them.

CheckPrereq(self)

source code 

Check prerequisites.

Overrides: LogicalUnit.CheckPrereq

Exec(self, feedback_fn)

source code 

Create and add the instance 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:
[_PInstanceName, ("mode", ht.NoDefault, ht.TElemOf(constants.INSTANCE_\
CREATE_MODES)), ("start", True, ht.TBool), ("wait_for_sync", True, ht.\
TBool), ("ip_check", True, ht.TBool), ("name_check", True, ht.TBool), \
("disks", ht.NoDefault, ht.TListOf(ht.TDict)), ("nics", ht.NoDefault, \
ht.TListOf(ht.TDict)), ("hvparams", ht.EmptyDict, ht.TDict), ("beparam\
s", ht.EmptyDict, ht.TDict), ("osparams", ht.EmptyDict, ht.TDict), ("n\
o_install", None, ht.TMaybeBool), ("os_type", None, ht.TMaybeString), \
("force_variant", False, ht.TBool), ("source_handshake", None, ht.TOr(\
...