This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
• Actuation APIs– VM lifecycle, product configuration etc.
• More categories to follow….
04/13/23 16
• Object Model Basics
04/13/23 17
Facilities Provided
• Installation
• VM lifecycle
• Network interfaces management
• Storage management
• Statistics
04/13/23 18
Object Model
• Persisted in a database
• Captures interrelationships• e.g. VM <-> Block Device (VBD) <-> disk Image
<VDI>
• Key Objects– Host, VM, VBD, VIF etc.…
• Can represent host clustering
04/13/23 19
04/13/23 20
Important Base Objects
• User – principal executing APIs
• Session – An authenticated API session
• Task – A long running async operation
• Host – A physical Host Machine
• VM – A Virtual machine
04/13/23 21
Networking Objects Usage Examples
• Add/delete a Virtual NIC to/from a VM
• Configure a virtual NIC• e.g. Change MAC/IP address
• Connect a VM NIC to a physical NIC
04/13/23 22
Storage Objects
• Unify various storage capabilities• Logical Volumes, CDs, files
• Provide a single model for all types
• VM sees them as a Virtual Block Device
• Easy to manage
04/13/23 23
• SDK for building applications
04/13/23 24
SDK Contents
• XenSource Virtual Appliance– Emulation Server (automatically started)– Language Bindings– Build Environment with c samples– Samples with each language
• C language samples for Linux• C# samples for Windows• Bash scripts that issue CLI commands• Python
• XML-RPC API reference
04/13/23 25
C Language Binding Walkthrough
• Per-object type – Sources /SDK/client-examples/c/libxen
• Correlates with API object reference
• Example:– xen_vm.h– xen_vm.c– Corresponds to VM object type in the API reference
04/13/23 26
C Language Binding Walkthrough-contd.
• xen_<object>_record• Defines the object and all it’s fields• e.g. xen_host_record, xen_vm_record
• xen_<object>– Opaque reference in session context– Returned via xen_get_by_uuid and xen_get_by_name
• xen_get_xxx and xen_set_xxx• get and set a field
• xen_get_<object>_record• Get the entire record from opaque reference