Manages information about the host OS and hypervisor.
This class encapsulates a connection to the libvirt daemon and provides certain higher level APIs around the raw libvirt API. These APIs are then used by all the other libvirt related classes
Bases: object
Information about libvirt background jobs
This class encapsulates information about libvirt background jobs. It provides a mapping from either the old virDomainGetJobInfo API which returned a fixed list of fields, or the modern virDomainGetJobStats which returns an extendable dict of fields.
Get job info for the domain
Query the libvirt job info for the domain (ie progress of migration, or snapshot operation)
Returns: a DomainJobInfo instance
Bases: object
Compares the given CPU description with the host CPU.
Create a secret.
Parameters: |
|
---|
Delete a secret.
usage_type: one of ‘iscsi’, ‘ceph’, ‘rbd’ or ‘volume’ usage_id: name of resource in secret
Lookup a node device by its name.
Returns: | a virNodeDevice instance |
---|
Find a secret.
usage_type: one of ‘iscsi’, ‘ceph’, ‘rbd’ or ‘volume’ usage_id: name of resource in secret
Returns the host capabilities information
Returns an instance of config.LibvirtConfigCaps representing the capabilities of the host.
Note: The result is cached in the member attribute _caps.
Returns: | a config.LibvirtConfigCaps object |
---|
Returns a connection to the hypervisor
This method should be used to create and return a well configured connection to the hypervisor.
Returns: | a libvirt.virConnect object |
---|
Returns the total numbers of cpu in the host.
Returns the current CPU state of the host with frequency.
Retrieve libvirt domain object for an instance.
Parameters: | instance – an nova.objects.Instance object |
---|
Attempt to lookup the libvirt domain objects corresponding to the Nova instance, based on its name. If not found it will raise an exception.InstanceNotFound exception. On other errors, it will raise an exception.NovaException exception.
Returns: | a libvirt.Domain object |
---|
Get hypervisor type.
Returns: | hypervisor type (ex. qemu) |
---|
Retrieve libvirt domain object for an instance.
Parameters: | instance – an nova.objects.Instance object |
---|---|
Returns: | a nova.virt.libvirt.Guest object |
Returns the hostname of the hypervisor.
Get the total memory size(MB) of physical computer.
Returns: | the total amount of memory(MB). |
---|
Get the used memory size(MB) of physical computer.
Returns: | the total usage of memory(MB). |
---|
Get the set of CPUs that are online on the host
Method is only used by NUMA code paths which check on libvirt version >= 1.0.4. getCPUMap() was introduced in libvirt 1.0.0.
Returns: | set of online CPUs, raises libvirtError on error |
---|
Get hypervisor version.
Returns: | hypervisor version (ex. 12003) |
---|
Returns whether kernel configuration CGROUP_SCHED is enabled
CONFIG_CGROUP_SCHED may be disabled in some kernel configs to improve scheduler latency.
Get a list of Guest objects for nova instances
Parameters: |
|
---|
See method “list_instance_domains” for more information.
Returns: | list of Guest objects |
---|
Get a list of libvirt.Domain objects for nova instances
Parameters: |
|
---|
Query libvirt to a get a list of all libvirt.Domain objects that correspond to nova instances. If the only_running parameter is true this list will only include active domains, otherwise inactive domains will be included too. If the only_guests parameter is true the list will have any “host” domain (aka Xen Domain-0) filtered out.
Returns: | list of libvirt.Domain objects |
---|
Lookup pci devices.
Returns: | a list of virNodeDevice instance |
---|
Defines a domain, but does not start it.
Parameters: | xml – XML domain definition of the guest. |
---|---|
Returns: | a virDomain instance |