class FakeHypervisor(hv_base.BaseHypervisor):
Fake hypervisor interface.
This can be used for testing the ganeti code without having to have a real virtualisation software installed.
Class Method |
|
Return information for connecting to the console of an instance. |
Class Method |
|
Fake hypervisor powercycle, just a wrapper over Linux powercycle. |
Method | __init__ |
Undocumented |
Method |
|
Prepare to accept an instance. |
Method |
|
Balloon an instance memory to a certain value. |
Method |
|
Finalize the instance migration on the target node. |
Method |
|
Finalize the instance migration on the source node. |
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 | CAN |
Undocumented |
Constant | PARAMETERS |
Undocumented |
Class Method | _ |
Compute the instance file for an instance name. |
Method | _ |
Checks if an instance is alive. |
Method | _ |
Mark the instance as running. |
Method | _ |
Mark the instance as running. |
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 |
|
Cleanup after a stopped instance |
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 |
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 |
Fake hypervisor powercycle, just a wrapper over Linux powercycle.
Parameters | |
hvparams:dict of strings | hypervisor params to be used on this node |
Prepare to accept an instance.
Parameters | |
instance:objects.Instance | instance to be accepted |
info:string | instance info, not used |
target:string | target host (usually ip), 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 |
Finalize the instance migration on the target node.
For the fake hv, this just marks the instance up.
Parameters | |
instance:objects.Instance | instance whose migration is being finalized |
info:string/data (opaque) | migration information, from the source node |
success:boolean | whether the migration was a success or a failure |
Finalize the instance migration on the source node.
Parameters | |
instance:objects.Instance | the instance that was migrated |
success:bool | whether the migration succeeded or not |
live:bool | whether the user requested a live migration or not |
Get properties of all instances.
Parameters | |
hvparams:dict of strings | hypervisor parameter |
Returns | |
list of tuples (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 | |
tuple of (name, id, memory, vcpus, stat, times) |
Get the migration status
The fake hypervisor migration always succeeds.
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 fake hypervisor, it just creates a file in the base dir, creating an exception if it already exists. We don't actually handle race conditions properly, since these are *FAKE* instances.
Stop an instance.
For the fake hypervisor, this just removes the file in the base dir, if it exist, otherwise we raise an exception.
Verify the hypervisor.
For the fake hypervisor, it just checks the existence of the base dir.
Parameters | |
hvparams:dict of strings | hypervisor parameters to be verified against; not used for fake hypervisors |
Returns | |
Problem description if something is wrong, None otherwise |