A connection to a hypervisor through libvirt.
Supports KVM, LXC, QEMU, UML, and XEN.
Related Flags
libvirt_type: | Libvirt domain type. Can be kvm, qemu, uml, xen (default: kvm). |
---|---|
libvirt_uri: | Override for the default libvirt URI (depends on libvirt_type). |
libvirt_disk_prefix: | |
Override the default disk prefix for the devices attached to a server. | |
rescue_image_id: | |
Rescue ami image (None = original image). | |
rescue_kernel_id: | |
Rescue aki image (None = original image). | |
rescue_ramdisk_id: | |
Rescue ari image (None = original image). | |
injected_network_template: | |
Template file for injected network | |
allow_same_net_traffic: | |
Whether to allow in project network traffic |
Bases: object
Manages information about the compute node through libvirt
Return the current state of the host.
If ‘refresh’ is True, run update the stats first.
Retrieve status info from libvirt.
Bases: nova.virt.driver.ComputeDriver
Add a compute host to an aggregate.
Note that this function takes an instance name.
Check if it is possible to execute live migration.
This runs checks on the destination host, and then calls back to the source host to check the results.
Parameters: |
|
---|
Do required cleanup on dest host after check_can_live_migrate calls
Parameters: |
|
---|
Check if it is possible to execute live migration.
This checks if the live migration can succeed, based on the results from check_can_live_migrate_destination.
Parameters: |
|
---|
Confirms a resize, destroying the source VM
Ensure that an instance’s filtering rules are enabled.
When migrating an instance, we need the filtering rules to be configured on the destination host before starting the migration.
Also, when restarting the compute service, we need to ensure that filtering rules exist for all running services.
Return all block devices in use on this node.
Retrieve resource info.
This method is called as a periodic task and is used only in live migration currently.
Returns: | dictionary containing resource info |
---|
Get cpuinfo information.
Obtains cpu feature from virConnect.getCapabilities, and returns as a json string.
Returns: | see above description |
---|
Return disk available least size.
The size of available disk, when block_migration command given disk_over_commit param is FALSE.
The size that deducted real nstance disk size from the total size of the virtual disk of all instances.
Note that this function takes an instance name.
Returns a list of all block devices for this domain.
Get config data for parameters.
Parameters: | rescue – optional dictionary that should contain the key ‘ramdisk_id’ if a ramdisk is needed for the rescue image and ‘kernel_id’ if a kernel is needed for the rescue image. |
---|
Returns an instance of config.LibvirtConfigCaps representing the capabilities of the host
Returns an instance of config.LibvirtConfigGuestCPU representing the host’s CPU model & topology with policy for configuring a guest to match
Return the current state of the host.
If ‘refresh’ is True, run update the stats first.
Returns the result of calling “uptime”.
Returns the hostname of the hypervisor.
Get hypervisor type.
Returns: | hypervisor type (ex. qemu) |
---|
Get hypervisor version.
Returns: | hypervisor version (ex. 12003) |
---|
Retrieve information from libvirt for a specific instance name.
If a libvirt error is encountered during lookup, we might raise a NotFound exception or Error exception depending on how severe the libvirt error is.
Get hypervisor instance capabilities
Returns a list of tuples that describe instances the hypervisor is capable of hosting. Each tuple consists of the triplet (arch, hypervisor_type, vm_mode).
Returns: | List of tuples describing instance capabilities |
---|
Preparation block migration.
Params ctxt: | security context |
---|---|
Params instance_ref: | |
nova.db.sqlalchemy.models.Instance object instance object that is migrated. | |
Returns: | json strings with below format:"[{'path':'disk', 'type':'raw',
'virt_disk_size':'10737418240',
'backing_file':'backing_file',
'disk_size':'83886080'},...]"
|
Note that this function takes an domain xml.
Returns a list of all network interfaces for this instance.
Get the total hdd size(GB) of physical computer.
Returns: | The total amount of HDD(GB). Note that this value shows a partition where NOVA-INST-DIR/instances mounts. |
---|
Get the free hdd size(GB) of physical computer.
Returns: | The total usage of HDD(GB). Note that this value shows a partition where NOVA-INST-DIR/instances mounts. |
---|
Get the total memory size(MB) of physical computer.
Returns: | the total amount of memory(MB). |
---|
Get the free memory size(MB) of physical computer.
Returns: | the total usage of memory(MB). |
---|
Efficient override of base instance_exists method.
Get vcpu number of physical computer.
Returns: | the number of cpu core. |
---|
Get vcpu usage number of physical computer.
Returns: | The total number of vcpu that currently used. |
---|
Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.
Reboots, shuts down or powers up the host.
Efficient override of base instance_exists method.
Note that this function takes an instance name.
Spawning live_migration operation for distributing high-load.
Params ctxt: | security context |
---|---|
Params instance_ref: | |
nova.db.sqlalchemy.models.Instance object instance object that is migrated. | |
Params dest: | destination host |
Params block_migration: | |
destination host | |
Params post_method: | |
post operation method. expected nova.compute.manager.post_live_migration. | |
Params recover_method: | |
recovery method when any exception occurs. expected nova.compute.manager.recover_live_migration. | |
Params block_migration: | |
if true, do block migration. | |
Params migrate_data: | |
implementation specific params |
Manage the local cache of images.
Pause VM instance
Plug VIFs into networks.
Post operation of live migration at destination host.
Parameters: |
|
---|
Power off the specified instance
Power on the specified instance
Preparation block migration.
Params ctxt: | security context |
---|---|
Params instance: | |
nova.db.sqlalchemy.models.Instance object instance object that is migrated. | |
Params disk_info_json: | |
json strings specified in get_instance_disk_info |
Preparation live migration.
Reboot a virtual machine, given an instance reference.
Remove a compute host from an aggregate.
Loads a VM using rescue images.
A rescue is normally performed when something goes wrong with the primary images and data needs to be corrected/recovered. Rescuing should not edit or over-ride the original image, only allow for data recovery.
resume the specified instance
resume guest state when a host is booted
Sets the specified host’s ability to accept new instances.
Create snapshot from a running VM instance.
This command only works with qemu 0.14+
Suspend the specified instance
only used for Resource Pools
See comments of same method in firewall_driver.
Unpause paused VM instance
Unplug VIFs from networks.
Reboot the VM which is being rescued back into primary images.
Retrieve status info from libvirt.
Query libvirt to get the state of the compute node, such as memory and disk usage.
eventlet.tpool.Proxy doesn’t work with old-style class in __str__() or __repr__() calls. See bug #962840 for details. We perform a monkey patch to replace those two instance methods.