Previous topic

The nova.virt.xenapi_conn Module

Next topic

The nova.virt.xenapi.firewall Module

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.virt.xenapi.fake Module

A fake XenAPI SDK.

exception Failure(details)

Bases: exceptions.Exception

class SessionBase(uri)

Bases: object

Base class for Fake Sessions

PBD_create(_1, pbd_rec)
PBD_plug(_1, pbd_ref)
PBD_unplug(_1, pbd_ref)
PIF_get_all_records_where(_1, _2)
SR_forget(_1, sr_ref)
SR_introduce(_1, sr_uuid, label, desc, type, content_type, shared, sm_config)
SR_scan(_1, sr_ref)
VBD_plug(_1, ref)
VBD_unplug(_1, ref)
VDI_add_to_other_config(_1, vdi_ref, key, value)
VDI_clone(_1, vdi_to_clone_ref)
VDI_copy(_1, vdi_to_copy_ref, sr_ref)
VDI_get_virtual_size(*args)
VDI_remove_from_other_config(_1, vdi_ref, key)
VDI_resize(*args)
VDI_resize_online(*args)
VM_add_to_xenstore_data(_1, vm_ref, key, value)
VM_clean_reboot(*args)
VM_get_xenstore_data(_1, vm_ref)
VM_remove_from_xenstore_data(_1, vm_ref, key)
host_call_plugin(_1, _2, plugin, method, _5)
host_compute_free_memory(_1, ref)
network_get_all_records_where(_1, filter)
pool_eject(session, host_ref)
pool_get_default_SR(_1, pool_ref)
pool_join(session, hostname, username, password)
pool_set_name_label(session, pool_ref, name)
xenapi_request(methodname, params)
after_VBD_create(vbd_ref, vbd_rec)

Create read-only fields and backref from VM to VBD when VBD is created.

after_VM_create(vm_ref, vm_rec)

Create read-only fields in the VM record.

as_json(*args, **kwargs)

Helper function for simulating XenAPI plugin responses for those that are returning JSON. If this function is given plain arguments, then these are rendered as a JSON list. If it’s given keyword arguments then these are rendered as a JSON dict.

as_value(s)

Helper function for simulating XenAPI plugin responses. It escapes and wraps the given argument.

check_for_session_leaks()
create_host(name_label, hostname='fake_name', address='fake_addr')
create_local_pifs()

Adds a PIF for each to the local database with VLAN=-1. Do this one per host.

create_local_srs()

Create an SR that looks like the one created on the local disk by default by the XenServer installer. Do this one per host. Also, fake the installation of an ISO SR.

create_network(name_label, bridge)
create_pbd(config, host_ref, sr_ref, attached)
create_pool(name_label)
create_sr(**kwargs)
create_task(name_label)
create_vbd(vm_ref, vdi_ref)
create_vdi(name_label, read_only, sr_ref, sharable)
create_vm(name_label, status, is_a_template=False, is_control_domain=False, host_ref=None)
destroy_vbd(vbd_ref)
destroy_vdi(vdi_ref)
destroy_vm(vm_ref)
get_all(table)
get_all_records(table)
get_record(table, ref)
log_db_contents(msg=None)
reset()
reset_table(table)