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.
Efficient implementation of (num ** exp) % mod
Bases: object
Management class for VM-related tasks
Destroy VM instance.
This is the method exposed by xenapi_conn.destroy(). The rest of the destroy_* methods are internal.
Return bandwidth usage info for each interface on each running VM
Return snapshot of console.
Return data about VM diagnostics.
Return data about VM instance.
Return connection info for a vnc console.
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.
Inject the hostname of the instance into the xenstore.
Generate the network info and make calls to place it into the xenstore and the xenstore param list. vm_ref can be passed in because it will sometimes be different than what VMHelper.lookup(session, instance.name) will find (ex: rescue)
List VM instances.
List VM instances, returning InstanceInfo objects.
Copies a VHD from one host machine to another, possibly resizing filesystem before hand.
Parameters: |
|
---|
Pause VM instance.
Set up VIF networking on the host.
Look for expirable rebooting instances.
Look for expirable rescued instances.
Power off the specified instance.
Power on the specified instance.
Reboot VM instance.
recreates security group rules for every instance
recreates security group rules for every instance
Rescue the specified instance.
Calls resetnetwork method in agent.
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:
Suspend the specified instance.
Removes filters for each VIF of the specified instance.
Unpause VM instance.
Unrescue the specified instance.
Compare two version strings (eg 0.0.1.10 > 0.0.1.9)
Factory to create a decorator that records instance progress as a series of discrete steps.
Each time the decorator is invoked we bump the total-step-count, so after:
@step
def step1():
...
@step
def step2():
...
we have a total-step-count of 2.
Each time the step-function (not the step-decorator!) is invoked, we bump the current-step-count by 1, so after:
step1()
the current-step-count would be 1 giving a progress of 1 / 2 * 100 or 50%.