class documentation
class TemporaryDisk(object):
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 | _ |
Ensures that the instance is down, and its disks inactive. |
Instance Variable | _disks |
Undocumented |
Instance Variable | _feedback |
Undocumented |
Instance Variable | _instance |
Undocumented |
Instance Variable | _lu |
Undocumented |
Instance Variable | _new |
Undocumented |
Instance Variable | _shutdown |
Undocumented |
Instance Variable | _undoing |
Undocumented |
Context manager entry function, creating the disk.
Returns | |
ganeti.objects.Disk | The disk object created. |
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.LogicalUnit | The LU within which this disk is created. |
instance:ganeti.objects.Instance | The 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 | Function used to log progress |
shutdown | Undocumented |