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()
class XenAPIBasedAgent(session, virtapi, instance, vm_ref)

Bases: object

get_version()
inject_file(path, contents)
inject_files(injected_files)
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.

update_if_needed(version)
find_guest_agent(base_dir)

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

is_upgrade_required(current_version, available_version)
should_use_agent(instance)

Previous topic

The nova.virt.watchdog_actions Module

Next topic

The nova.virt.xenapi.client.objects Module

Project Source

This Page