The nova.virt.xenapi.agent Module

class SimpleDH

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.

compute_shared(other)
decrypt(text)
encrypt(text)
generate_private()
get_public()
static mod_exp(num, exp, mod)

Efficient implementation of (num ** exp) % mod.

class XenAPIBasedAgent(session, virtapi, instance, vm_ref)

Bases: object

agent_update(agent_build)

Update agent on the VM instance.

get_agent_version()

Get the version of the agent running on the VM instance.

inject_file(path, contents)
inject_ssh_key()
resetnetwork()
set_admin_password(new_pass)

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 a more advanced library (such as M2Crypto) for compatibility with the agent code.

find_guest_agent(base_dir)

tries to locate a guest agent at the path specificed by agent_rel_path

Previous topic

The nova.virt.vmwareapi.volumeops Module

Next topic

The nova.virt.xenapi.driver Module

This Page