class documentation

class TemporaryDisk(object):

View In Hierarchy

Creates a new temporary bootable disk, and makes sure it is destroyed.

Is a context manager, and should be used with the ``with`` statement as such.

The disk is guaranteed to be created at index 0, shifting any other disks of the instance by one place, and allowing the instance to be booted with the content of the disk.

Method __enter__ Context manager entry function, creating the disk.
Method __exit__ Context manager exit function, destroying the disk.
Method __init__ Constructor storing arguments until used later.
Method _EnsureInstanceDiskState Ensures that the instance is down, and its disks inactive.
Instance Variable _disks Undocumented
Instance Variable _feedback_fn Undocumented
Instance Variable _instance Undocumented
Instance Variable _lu Undocumented
Instance Variable _new_disks Undocumented
Instance Variable _shutdown_timeout Undocumented
Instance Variable _undoing_info Undocumented
def __enter__(self):

Context manager entry function, creating the disk.

Returns
ganeti.objects.DiskThe disk object created.
def __exit__(self, exc_type, _value, _traceback):

Context manager exit function, destroying the disk.

def __init__(self, lu, instance, disks, feedback_fn, shutdown_timeout=constants.DEFAULT_SHUTDOWN_TIMEOUT):

Constructor storing arguments until used later.

Parameters
lu:ganeti.cmdlib.base.LogicalUnitThe LU within which this disk is created.
instance:ganeti.objects.InstanceThe instance to which the disk should be added
disks:list of triples (disk template, disk access mode, int)disk specification, which is a list of triples containing the disk template (e.g., constants.DT_PLAIN), the disk access mode (i.e., constants.DISK_RDONLY or constants.DISK_RDWR), and size in MiB.
feedback_fn:functionFunction used to log progress
shutdown_timeoutUndocumented
def _EnsureInstanceDiskState(self):

Ensures that the instance is down, and its disks inactive.

All the operations related to the creation and destruction of disks require that the instance is down and that the disks are inactive. This function is invoked to make it so.

_disks =

Undocumented

_feedback_fn =

Undocumented

_instance =

Undocumented

_lu =

Undocumented

_new_disks =

Undocumented

_shutdown_timeout =

Undocumented

_undoing_info =

Undocumented