Options:
- user: (optional) username for authentication
- password: (optional) password for authentication
- readonly: (optional) whether the connection is read-only
If options is a boolean it is used as the readonly parameter
Computes the most feature-rich CPU which is compatible with all given host CPUs.
Array of XML descriptions of host CPUs.
An XML description of the computed CPU or null plus an exception with an Error instance.
Compares the given CPU description with the host CPU
An xml string with the cpu description
One of the following constants: libvirt.VIR_CPU_COMPARE_INCOMPATIBLE, libvirt.VIR_CPU_COMPARE_IDENTICAL, libvirt.VIR_CPU_COMPARE_SUPERSET. Or null plus an exception with an Error instance if occurred an error.
Provides a xml with capabilities of the hypervisor.
None.
An xml describing capabilities of the current hypervisor.
This returns the system hostname on which the hypervisor is running (the result of the gethostname system call). If we are connected to a remote system, then this returns the hostname of the remote system.
None.
The system hostname or null plus an exception with an Error instance
Provides the libvirt version used by the daemon running on the hypervisor host.
None.
An libvirt version string with format: major.minor.release. i.e. 1.8.2. If there is an error, it returns null plus an exception with an Error instance.
Provides the maximum number of virtual CPUs supported for a guest VM of a
specific type. The type
parameter here corresponds to the type
attribute
in the <domain>
element of the XML. The type
values are driver specific,
but include "xen", "kvm", "qemu", "lxc" and "kqemu".
A string specifying the driver type
A number which represents the maximum number of virtual CPUs supported or null plus an exception with an Error instance.
Provides the name of the Hypervisor software used.
None.
A string which represents the Hypervisor software used or null plus an exception with an Error instance.
Provides the URI (name) of the hypervisor connection. Normally this is the same
as or similar to the string passed to the new Hypervisor()
, but the driver
may make the URI canonical.
None.
An hypervisor URI string or null plus an exception with an Error instance.
Get the version level of the Hypervisor running. This may work only with hypervisor call, i.e. with privileged access to the hypervisor, not with a read-only connection.
None.
An hypervisor version string with format: major.minor.release. i.e. 0.12.3 If there is an error, it returns null plus an exception with an Error instance.
Determine if the connection to the hypervisor is encrypted
None.
true or false plus an exception with an Error instance if an error occurred.
Determine if the connection to the hypervisor is secure. The connection will be classed as secure if it is either encrypted, or running over a channel which is not exposed to eavesdropping (eg a UNIX domain socket, or pipe).
None.
true or false plus an exception with an Error instance if an error occurred.
Close the hypervisor connection. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.
None.
true or false plus an exception with an Error instance if an error occurred.
These four functions return the names of all the defined: Domains, Interfaces, Networks and StoragePools respectively.
None.
An array of strings which are the names of Domains, Interfaces, Networks or StoragePools currently defined but not active on the hypervisor. It also return null plus an exception if some error occurred.
These four functions return the number of all currently defined but not active: Domains, Interfaces, Networks and StoragePools respectively.
None.
A number which represents the total of currently defined: Domains, Interfaces, Networks and StoragePools respectively. It also return null plus an exception if some error occurred.
These four functions return the names of all currently active: Domains, Interfaces, Networks or StoragePools respectively.
None.
An array of strings which are the names of the Domains, Interfaces, Networks, or StoragePools currently active on the hypervisor. It also return null plus an exception if some error occurred.
These four functions return the number of all currently active: Domains, Interfaces, Networks and StoragePools respectively.
None.
A number which represents the total of currently active: Domains, Interfaces, Networks and StoragePools respectively. It also return null plus an exception if some error occurred.
Provides the names of all the network filters.
None.
An array of strings with the names of the network filters or null plus an exception if some error occurred.
Provides the number of network filters.
None.
A number which represents the number of network filters or null plus an exception if some error occurred.
List UUIDs of defined secrets
None.
An array of strings with the UUIDs of the secrets or null plus an exception if some error occurred
Fetch number of currently defined secrets.
None.
A number which represents the total of currently defined secrets or null plus an exception if some error occurred
Launch a new guest domain, based on an XML description. This function may requires privileged access to the hypervisor. The domain is not persistent, so its definition will disappear when it is stopped, or if the host is restarted.
A string representing the Xml domain description
An instance of Domain or null if some error occurred during the creation.
Define a domain, but does not start it. This definition is persistent, until
explicitly undefined with domain.undefine()
. A previous definition for this
domain would be overriden if it already exists.
A string representing the Xml domain description.
An instance of Domain or null if some error occurred during the creation.
Restore a domain saved to disk by save()
from the path
specified.
The path where the domain was saved.
true or false plus an exception with an Error instance.
Try to find a domain based on the hypervisor ID number. Note that this won't work for inactive domains which have an ID of -1, in that case a lookup based on the Name or UUId need to be done instead.
A id number
A Domain instance or null plus an exception if some error occurred.
Try to lookup a domain based on its name.
A string with the domain name to lookup.
A Domain instance or null plus an exception if some error occurred.
Try to lookup a domain based on its UUID.
A string with the domain uuid to lookup.
A Domain instance or null plus an exception if some error occurred.
This function returns the amount of free memory in one or more NUMA cells.
- startCell: Index of first cell.
- maxCell: Maximum number of cells.
An array of cells with its amount of free memory or null plus an exception if some error occurred.
Provides the free memory available on the Node. Most libvirt APIs provide memory sizes in kilobytes, but in this function the returned value is in bytes. Divide by 1024 as necessary.
None.
A number represeting free memory in bytes or null plus an exception if some error occurred.
Extract hardware information about the node.
None.
An object with the following structure: { 'model': 'myCpuModel', //string indicating the CPU model 'memory': 1024, //memory size in kilobytes 'cpus': 4, //the number of active CPUs 'mhz': 2000, //expected CPU frecuency 'nodes': 2, //the number of NUMA cell, 1 for uniform mem access 'sockets': 4, //number of CPU socket per node 'cores': 4, //number of core per socket 'threads': 16 //number of threads per core } It also returns null plus an exception if some error occurred.
Provides the names of node devices. If the optional capXml
argument is specified,
then it will return devices with the specified capability.
An optional string with the xml describing device capabilites. It works like a device filter.
An array of strings with the devices names.
Extract the security model of a hypervisor.
None.
An object with the following structure: { 'model': 'selinux', 'doi': 0 }
Lookup a node device by its name.
A string with the name to lookup
An instance of NodeDevice or null plus an exception if some error occurred.
Create a new device on the VM host machine, for example, virtual HBAs created using vport_create.
A string with the device xml description.
An instance of NodeDevice or null plus an exception if some error occurred.
Create and start a new virtual network.
A string with the network xml description.
An instance of Network or null plus an exception if some error occurred.
Try to lookup a network based on its name.
A string with the network name to lookup.
An instance of Network or null plus an exception if some error occurred.
Try to lookup a network based on its UUID.
A string with the network uuid to lookup.
An instance of Network or null plus an exception if some error occurred.
Define a network, but it does not start it.
A string with the network xml description.
An instance of Network or null plus an exception if some error occurred.
Define a new network filter, based on an XML description.
A xml with the filter xml description.
An insntace of NetworkFilter or null plus an exception if some error occurred.
Try to lookup a network filter based on its name.
A string with the filter name to lookup
An instance of NetworkFilter or null plus an exception if some error occurred.
Try to lookup a network filter based on its UUID.
An string with the filter uuid to lookup
An instance of NetworkFilter or null plus an exception if some error occurred.
Try to lookup an interface based on its name.
A string with the interface name to look for the interface.
An instance of Interface or null plus an exception if some error occurred.
Try to lookup an interface on the given hypervisor based on its MAC Address.
A string with the interface mac address to look for the interface
An instance of Interface or null plus an exception if some error occurred.
Define an interface (or modify existing interface configuration).
A string with the interface xml description.
An instance of Interface or null plus an exception if some error occurred.
If XML specifies a UUID, locates the specified secret and replaces all attributes of the secret specified by UUID by attributes specified in xml (any attributes not specified in xml are discarded). Otherwise, creates a new secret with an automatically chosen UUID, and initializes its attributes from xml.
An string with the secret xml description.
An instance of Secret or null plus an exception if some error occurred.
Try to lookup a secret based on its usage. The usageId is unique within the set of secrets sharing the same usageType value.
- usageType: String with the type of secret usage.
- usageId: Number with the identifier of the object using the secret.
An instance of Secret or null plus an exception if some error occurred.
Try to lookup a secret based on its UUID.
An string with the secret uuid.
An instance of Secret or null plus an exception if some error occurred.
Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is stopped, or if the host is restarted.
A string with the pool xml description.
An instance of StoragePool or null plus an exception if some error occurred.
Define a new inactive storage pool based on its XML description. The pool is persistent, until explicitly undefined.
A string with the pool xml description.
An instance of StoragePool or null plus an exception if some error occurred.
Fetch a storage pool based on its unique name.
A string with the pool name.
An instance of StoragePool or null plus an exception if some error occurred.
Fetch a storage pool based on its globally unique id
A string with the pool uuid.
An instance of StoragePool or null plus an exception if some error occurred.
Fetch a storage pool which contains a particular volume
An instance of StorageVolume
An instance of StoragePool or null plus an exception if some error occurred.
Fetch a pointer to a storage volume based on its globally unique key.
A string with the volume key.
An instance of StorageVolume or null plus an exception if some error occurred.
Fetch a pointer to a storage volume based on its locally (host) unique path.
A string with the volume path.
An instance of StorageVolume or null plus an exception if some error occurred.
Adds a callback to receive notifications of arbitrary domain events occurring
on a domain. If property domain
is not present, then events will be monitored
for any domain. If property domain
is present, then only the specific
domain will be monitored Most types of event have a callback providing a
custom set of parameters for the event.
An object with the following structure: { 'evtype': hypervisor.VIR_DOMAIN_EVENT_ID_LIFECYCLE, 'domain': mydomain, 'callback': function(hyp, dom, data) {
}
}
evtype is an OR'ed set of the following constants: hypervisor.VIR_DOMAIN_EVENT_ID_LIFECYCLE hypervisor.VIR_DOMAIN_EVENT_ID_REBOOT hypervisor.VIR_DOMAIN_EVENT_ID_RTC_CHANGE hypervisor.VIR_DOMAIN_EVENT_ID_WATCHDOG hypervisor.VIR_DOMAIN_EVENT_ID_IO_ERROR hypervisor.VIR_DOMAIN_EVENT_ID_GRAPHICS hypervisor.VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON hypervisor.VIR_DOMAIN_EVENT_ID_LAST
Removes an event callback. The callbackID parameter should be the vaule obtained
from a previous registerDomainEvent(event)
function.