class ChrootManager(hv_base.BaseHypervisor):
Chroot manager.
This not-really hypervisor allows ganeti to manage chroots. It has special behaviour and requirements on the OS definition and the node environemnt:
- the start and stop of the chroot environment are done via a script called ganeti-chroot located in the root directory of the first drive, which should be created by the OS definition
- this script must accept the start and stop argument and, on shutdown, it should cleanly shutdown the daemons/processes using the chroot
- the daemons run in chroot should only bind to the instance IP (to which the OS create script has access via the instance name)
- since some daemons in the node could be listening on the wildcard address, some ports might be unavailable
- the instance listing will show no memory usage
- on shutdown, the chroot manager will try to find all mountpoints under the root dir of the instance and unmount them
- instance alive check is based on whether any process is using the chroot
| Class Method | |
Return information for connecting to the console of an instance. |
| Class Method | |
Chroot powercycle, just a wrapper over Linux powercycle. |
| Method | __init__ |
Undocumented |
| Method | |
Balloon an instance memory to a certain value. |
| Method | |
Cleanup after a stopped instance |
| Method | |
Get properties of all instances. |
| Method | |
Get instance properties. |
| Method | |
Get the migration status |
| Method | |
Return information about the node. |
| Method | |
Get the list of running instances. |
| Method | |
Migrate an instance. |
| Method | |
Reboot an instance. |
| Method | |
Start an instance. |
| Method | |
Stop an instance. |
| Method | |
Verify the hypervisor. |
| Constant | PARAMETERS |
Undocumented |
| Class Method | _ |
Return the root directory for an instance. |
| Static Method | _ |
Return the list of mountpoints under a given path. |
| Static Method | _ |
Check if a directory looks like a live chroot. |
| Constant | _ROOT |
Undocumented |
Inherited from BaseHypervisor:
| Class Method | |
Check the given parameters for validity. |
| Class Method | |
Return a list of ancillary files to be copied to all nodes as ancillary configuration files. |
| Class Method | |
Linux-specific powercycle method. |
| Class Method | |
Check the given parameters for validity. |
| Static Method | |
For linux systems, return actual OS information. |
| Static Method | |
Decide if migration between those version is likely to suceed. |
| Method | |
Prepare to accept an instance. |
| Method | |
Finalize the instance migration on the target node. |
| Method | |
Finalize the instance migration on the source node. |
| Method | |
Hot-add a device. |
| Method | |
Hot-del a device. |
| Method | |
Hot-mod a device. |
| Method | |
Checks if hotplug is supported. |
| Method | |
Get instance information to perform a migration. |
| Method | |
Fixup running instance's (config) state. |
| Method | |
Verifies that hotplug is supported. |
| Method | |
Verify if running instance (config) is in correct state. |
| Constant | ANCILLARY |
Undocumented |
| Constant | ANCILLARY |
Undocumented |
| Constant | CAN |
whether this hypervisor can do migration (either live or non-live) |
| Class Method | _ |
Check if the parameter value is a kind of value meaning unspecified. |
| Static Method | _ |
Formats the verification results, given a list of errors. |
| Method | _ |
Get the correct startup memory for an instance |
def GetInstanceConsole(cls, instance, primary_node, node_group, hvparams, beparams, root_dir=None): ¶
Return information for connecting to the console of an instance.
Chroot powercycle, just a wrapper over Linux powercycle.
| Parameters | |
| hvparams:dict of strings | hypervisor params to be used on this node |
Balloon an instance memory to a certain value.
| Parameters | |
instance:objects.Instance | instance to be accepted |
| mem:int | actual memory size to use for instance runtime |
Get properties of all instances.
| Parameters | |
| hvparams:dict of strings | hypervisor parameter |
| Returns | |
| [(name, id, memory, vcpus, stat, times),...] | |
Get instance properties.
| Parameters | |
| instance | the instance name |
| hvparams:dict of strings | hvparams to be used with this instance |
| Returns | |
| (name, id, memory, vcpus, stat, times) | |
Get the migration status
| Parameters | |
instance:objects.Instance | the instance that is being migrated |
| Returns | |
objects.MigrationStatus | the status of the current migration (one of constants.HV_MIGRATION_VALID_STATUSES), plus any additional progress info that can be retrieved from the hypervisor |
Migrate an instance.
| Parameters | |
| cluster | name of the cluster |
instance:objects.Instance | 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 |
Start an instance.
For the chroot manager, we try to mount the block device and execute '/ganeti-chroot start'.
Stop an instance.
This method has complicated cleanup tests, as we must:
- try to kill all leftover processes
- try to unmount any additional sub-mountpoints
- finally unmount the instance dir
Verify the hypervisor.
For the chroot manager, it just checks the existence of the base dir.
| Parameters | |
| hvparams:dict of strings | hypervisor parameters to be verified against, not used in for chroot |
| Returns | |
| Problem description if something is wrong, None otherwise | |
Undocumented
| Value |
|