Management class for VM-related functions (spawn, reboot, etc).
Bases: object
This class wraps all the functionality needed to implement basic Diffie-Hellman-Merkle key exchange in Python. It features intelligent defaults for the prime and base numbers needed for the calculation, while allowing you to supply your own. It requires that the openssl binary be installed on the system on which this is run, as it uses that to handle the encryption and decryption. If openssl is not available, a RuntimeError will be raised.
Bases: object
Management class for VM-related tasks
Takes a key/value pair and adds it to the xenstore parameter record for the given vm instance. If the key exists in xenstore, it is overwritten
Adds the passed key/value pair to the xenstore record for the given VM at the specified location. A XenAPIPlugin.PluginError will be raised if any error is encountered in the write process.
Removes all data from the xenstore parameter record for this VM.
Deletes the VM’s xenstore record for the specified path. If there is no such record, the request is ignored.
Creates vifs for an instance.
Destroy VM instance.
This is the method exposed by xenapi_conn.destroy(). The rest of the destroy_* methods are internal.
Return link to instance’s ajax console.
Return snapshot of console.
Return data about VM diagnostics.
Return data about VM instance.
Write a file to the VM instance.
The path to which it is to be written and the contents of the file need to be supplied; both will be base64-encoded to prevent errors with non-ASCII characters being transmitted. If the agent does not support file injection, or the user has disabled it, a NotImplementedError will be raised.
shim in place which makes inject_network_info work without being passed network_info. shim goes away after nova-multi-nic
Links the base copy VHD to the COW via the XAPI plugin.
Runs the xenstore-ls command to get a listing of all records from ‘path’ downward. Returns a dict with the sub-paths as keys, and the value stored in those paths as values. If nothing is found at that path, returns None.
List VM instances.
List VM instances, returning InstanceInfo objects.
Copies a VHD from one host machine to another.
Parameters: |
|
---|
Pause VM instance.
Look for expirable rescued instances.
Returns the xenstore parameter record data for the specified VM instance as a dict. Accepts an optional key or list of keys; if a value for ‘keys’ is passed, the returned dict is filtered to only return the values for those keys.
Returns the value stored in the xenstore record for the given VM at the specified location. A XenAPIPlugin.PluginError will be raised if any error is encountered in the read process.
Returns a dict of all the keys in the xenstore parameter record for the given instance that begin with the key_prefix.
Reboot VM instance.
Takes either a single key or a list of keys and removes them from the xenstore parameter record data for the given VM. If the key doesn’t exist, the request is ignored.
Takes either a single key or a list of keys and removes them from the xenstoreirecord data for the given VM. If the key doesn’t exist, the request is ignored.
Rescue the specified instance.
Creates uuid arg to pass to make_agent_call and calls it.
Resize a running instance by changing it’s RAM and disk size.
Resume the specified instance.
Set the root/admin password on the VM instance.
This is done via an agent running on the VM. Communication between nova and the agent is done via writing xenstore records. Since communication is done over the XenAPI RPC calls, we need to encrypt the password. We’re using a simple Diffie-Hellman class instead of the more advanced one in M2Crypto for compatibility with the agent code.
Create snapshot from a running VM instance.
Parameters: |
|
---|
Steps involved in a XenServer snapshot:
creates: Snapshot (Template) VM, Snapshot VBD, Snapshot VDI, Snapshot VHD
a ‘base-copy’ VDI. The base_copy is immutable and may be chained with other base_copies. If chained, the base_copies coalesce together, so, we must wait for this coalescing to occur to get a stable representation of the data on disk.
that will bundle the VHDs together and then push the bundle into Glance.
Spawn a rescue instance.
Suspend the specified instance.
Unpause VM instance.
Unrescue the specified instance.
Takes a dict and writes each key/value pair to the xenstore parameter record for the given vm instance. Any existing data for those keys is overwritten.
Writes the passed value to the xenstore record for the given VM at the specified location. A XenAPIPlugin.PluginError will be raised if any error is encountered in the write process.