Package ganeti :: Package hypervisor :: Module hv_base :: Class BaseHypervisor
[hide private]
[frames] | no frames]

Class BaseHypervisor

source code


Abstract virtualisation technology interface

The goal is that all aspects of the virtualisation technology are abstracted away from the rest of code.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
StartInstance(self, instance, block_devices)
Start an instance.
source code
 
StopInstance(self, instance, force=False)
Stop an instance.
source code
 
RebootInstance(self, instance)
Reboot an instance.
source code
 
ListInstances(self)
Get the list of running instances.
source code
 
GetInstanceInfo(self, instance_name)
Get instance properties.
source code
 
GetAllInstancesInfo(self)
Get properties of all instances.
source code
 
GetNodeInfo(self)
Return information about the node.
source code
 
Verify(self)
Verify the hypervisor.
source code
string/data (opaque)
MigrationInfo(self, instance)
Get instance information to perform a migration.
source code
 
AcceptInstance(self, instance, info, target)
Prepare to accept an instance.
source code
 
FinalizeMigration(self, instance, info, success)
Finalized an instance migration.
source code
 
MigrateInstance(self, name, target, live)
Migrate an instance.
source code
 
ValidateParameters(self, hvparams)
Check the given parameters for validity.
source code
 
GetLinuxNodeInfo(self)
For linux systems, return actual OS information.
source code

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

Class Methods [hide private]
 
GetShellCommandForConsole(cls, instance, hvparams, beparams)
Return a command for connecting to the console of an instance.
source code
 
CheckParameterSyntax(cls, hvparams)
Check the given parameters for validity.
source code
Class Variables [hide private]
  PARAMETERS = []
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

GetInstanceInfo(self, instance_name)

source code 

Get instance properties.

Parameters:
  • instance_name (string) - the instance name
Returns:
tuple (name, id, memory, vcpus, state, times)

GetAllInstancesInfo(self)

source code 

Get properties of all instances.

Returns:
list of tuples (name, id, memory, vcpus, stat, times)

GetNodeInfo(self)

source code 

Return information about the node.

Returns:
a dict with the following keys (values in MiB):
  • memory_total: the total memory size on the node
  • memory_free: the available memory on the node for instances
  • memory_dom0: the memory used by the node itself, if available

MigrationInfo(self, instance)

source code 

Get instance information to perform a migration.

By default assume no information is needed.

Parameters:
Returns: string/data (opaque)
instance migration information - serialized form

AcceptInstance(self, instance, info, target)

source code 

Prepare to accept an instance.

By default assume no preparation is needed.

Parameters:
  • instance (objects.Instance) - instance to be accepted
  • info (string/data (opaque)) - migration information, from the source node
  • target (string) - target host (usually ip), on this node

FinalizeMigration(self, instance, info, success)

source code 

Finalized an instance migration.

Should finalize or revert any preparation done to accept the instance. Since by default we do no preparation, we also don't have anything to do

Parameters:
  • instance (objects.Instance) - instance whose migration is being aborted
  • info (string/data (opaque)) - migration information, from the source node
  • success (boolean) - whether the migration was a success or a failure

MigrateInstance(self, name, target, live)

source code 

Migrate an instance.

Parameters:
  • name (string) - name of the instance to be migrated
  • target (string) - hostname (usually ip) of the target node
  • live (boolean) - whether to do a live or non-live migration

CheckParameterSyntax(cls, hvparams)
Class Method

source code 

Check the given parameters for validity.

This should check the passed set of parameters for validity. Classes should extend, not replace, this function.

Parameters:
  • hvparams (dict) - dictionary with parameter names/value
Raises:

ValidateParameters(self, hvparams)

source code 

Check the given parameters for validity.

This should check the passed set of parameters for validity. Classes should extend, not replace, this function.

Parameters:
  • hvparams (dict) - dictionary with parameter names/value
Raises:

GetLinuxNodeInfo(self)

source code 

For linux systems, return actual OS information.

This is an abstraction for all non-hypervisor-based classes, where the node actually sees all the memory and CPUs via the /proc interface and standard commands. The other case if for example xen, where you only see the hardware resources via xen-specific tools.

Returns:
a dict with the following keys (values in MiB):
  • memory_total: the total memory size on the node
  • memory_free: the available memory on the node for instances
  • memory_dom0: the memory used by the node itself, if available