The nova.virt.xenapi.client.objects
Module¶
-
class
Host
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
XenServer hosts.
-
class
Network
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Networks that VIFs are attached to.
-
class
PBD
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Physical block device.
-
class
PIF
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Physical Network Interface.
-
class
Pool
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Pool of hosts.
-
class
SR
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Storage Repository.
-
class
VBD
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Virtual block device.
-
plug
(vbd_ref, vm_ref)¶
-
unplug
(vbd_ref, vm_ref)¶
-
-
class
VDI
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Virtual disk image.
-
class
VLAN
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
VLAN.
-
class
VM
(session)¶ Bases:
nova.virt.xenapi.client.objects.XenAPISessionObject
Virtual Machine.
-
class
XenAPISessionObject
(session, name)¶ Bases:
object
Wrapper to make calling and mocking the session easier
The XenAPI protocol is an XML RPC API that is based around the XenAPI database, and operations you can do on each of the objects stored in the database, such as VM, SR, VDI, etc.
For more details see the XenAPI docs: http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/
Most, objects like VM, SR, VDI, etc, share a common set of methods: * vm_ref = session.VM.create(vm_rec) * vm_ref = session.VM.get_by_uuid(uuid) * session.VM.destroy(vm_ref) * vm_refs = session.VM.get_all()
Each object also has specific messages, or functions, such as: * session.VM.clean_reboot(vm_ref)
Each object has fields, like “VBDs” that can be fetched like this: * vbd_refs = session.VM.get_VBDs(vm_ref)
You can get all the fields by fetching the full record. However please note this is much more expensive than just fetching the field you require: * vm_rec = session.VM.get_record(vm_ref)
When searching for particular objects, you may be tempted to use get_all(), but this often leads to races as objects get deleted under your feet. It is preferable to use the undocumented: * vms = session.VM.get_all_records_where( ‘field “is_control_domain”=”true”’)