A connection to XenServer or Xen Cloud Platform.
The concurrency model for this class is as follows:
All XenAPI calls are on a green thread (using eventlet’s “tpool” thread pool). They are remote calls, and so may hang for the usual reasons.
All long-running XenAPI calls (VM.start, VM.reboot, etc) are called async (using XenAPI.VM.async_start etc). These return a task, which can then be polled for completion.
This combination of techniques means that we don’t block the main thread at all, and at the same time we don’t hold lots of threads waiting for long-running operations.
FIXME: get_info currently doesn’t conform to these rules, and will block the reactor thread if the VM.get_by_name_label or VM.get_record calls block.
Related Flags
xenapi_connection_url: | |
---|---|
URL for connection to XenServer/Xen Cloud Platform. | |
xenapi_connection_username: | |
Username for connection to XenServer/Xen Cloud Platform (default: root). | |
xenapi_connection_password: | |
Password for connection to XenServer/Xen Cloud Platform. | |
xenapi_task_poll_interval: | |
The interval (seconds) used for polling of remote tasks (Async.VM.start, etc) (default: 0.5). | |
target_host: | the iSCSI Target Host IP address, i.e. the IP address for the nova-volume host |
target_port: | iSCSI Target Port, 3260 Default |
iqn_prefix: | IQN Prefix, e.g. ‘iqn.2010-10.org.openstack’ |
Variable Naming Scheme
Bases: object
Manages information about the XenServer host this compute node is running on.
Return the current state of the host. If ‘refresh’ is True, run the update first.
Since under Xenserver, a compute node runs on a given host, we can get host status information using xenapi.
Bases: nova.virt.driver.ComputeDriver
A connection to XenServer or Xen Cloud Platform
Attach volume storage to VM instance
This method is supported only by libvirt.
Destroy VM instance
Detach volume storage to VM instance
This method is supported only libvirt.
Completes a resize, turning on the migrated instance
Return link to instance’s ajax console
Return snapshot of console
Return data about VM diagnostics
Return the current state of the host. If ‘refresh’ is True, run the update first.
Return data about VM instance
The only valid values for ‘action’ on XenServer are ‘reboot’ or ‘shutdown’, even though the API also accepts ‘startup’. As this is not technically possible on XenServer, since the host is the same physical machine as the hypervisor, if this is requested, we need to raise an exception.
Create a file on the VM instance. The file path and contents should be base64-encoded.
inject network info for specified instance
List VM instances
This method is supported only by libvirt.
Transfers the VHD of a running instance to another host, then shuts off the instance copies over the COW disk
Pause VM instance
Poll for rescued instances
Reboot VM instance
Rescue the specified instance
reset networking for specified instance
resume the specified instance
Reverts a resize, powering back on the instance
Set the root/admin password on the VM instance
Sets the specified host’s ability to accept new instances.
Create snapshot from a running VM instance
Create VM instance
suspend the specified instance
This method is supported only by libvirt.
Unpause paused VM instance
Unrescue the specified instance
This method is supported only by libvirt.
Update the status info of the host, and return those values to the calling program.
Bases: object
The session to invoke XenAPI SDK calls
Call Async.host.call_plugin on a background thread.
Call the specified XenAPI method on a background thread.
Some interactions with dom0, such as interacting with xenstore’s param record, require using the xenapi_request method of the session object. This wraps that call on a background thread.
Stubout point. This can be replaced with a mock xenapi module.
Return the xenapi object
Return the xenapi host
Return the result of the given task. The task is polled until it completes.
Note that XenAPI doesn’t have a read-only connection mode, so the read_only parameter is ignored.