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

Class LUInstanceCreate

source code


Create an instance.

Instance Methods [hide private]
 
_CheckDiskTemplateValid(self)
Checks validity of disk template.
source code
 
_CheckDiskArguments(self)
Checks validity of disk-related arguments.
source code
 
_CheckVLANArguments(self)
Check validity of VLANs if given
source code
 
CheckArguments(self)
Check arguments.
source code
 
ExpandNames(self)
ExpandNames for CreateInstance.
source code
 
_RunAllocator(self)
Run the allocator based on input opcode.
source code
dict
BuildHooksEnv(self)
Build hooks env.
source code
tuple; (list, list)
BuildHooksNodes(self)
Build hooks nodes.
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
 
_CalculateFileStorageDir(self)
Calculate final instance file storage dir.
source code
 
CheckPrereq(self)
Check prerequisites.
source code
 
Exec(self, feedback_fn)
Create and add the instance to the cluster.
source code

Inherited from base.LogicalUnit: DeclareLocks, HooksCallBack, PreparePostHookNodes, __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 = constants.HTYPE_INSTANCE
  REQ_BGL = False
Instance Variables [hide private]

Inherited from base.LogicalUnit: dry_run_result

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

CheckArguments(self)

source code 

Check arguments.

Overrides: base.LogicalUnit.CheckArguments

ExpandNames(self)

source code 

ExpandNames for CreateInstance.

Figure out the right locks for instance creation.

Overrides: base.LogicalUnit.ExpandNames

BuildHooksEnv(self)

source code 

Build hooks env.

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

Returns: dict
Dictionary containing the environment that will be used for running the hooks for this LU. The keys of the dict must not be prefixed with "GANETI_"--that'll be added by the hooks runner. The hooks runner will extend the environment with additional variables. If no environment should be defined, an empty dictionary should be returned (not None).
Overrides: base.LogicalUnit.BuildHooksEnv

BuildHooksNodes(self)

source code 

Build hooks nodes.

Returns: tuple; (list, list)
Tuple containing a list of node UUIDs on which the hook should run before the execution and a list of node UUIDs on which the hook should run after the execution. No nodes should be returned as an empty list (and not None).
Overrides: base.LogicalUnit.BuildHooksNodes

_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: base.LogicalUnit.CheckPrereq

Exec(self, feedback_fn)

source code 

Create and add the instance to the cluster.

Overrides: base.LogicalUnit.Exec