The Xen domain management service is responsible for all domain management on an XCP host. The API allows clients to register VM configurations with the management service and issue VM lifecycle commands such as: start, shutdown, reboot, suspend, resume and migrate. A simple event interface allows interested clients to notice when significant events have happened, for example a VM reboot or a Virtual Block Device (VBD) unplug.
Debug context from the caller
Power state of the VM
Constructors:
Type | Description | |
Running
|
unit
|
VM is running (i.e. a memory exists and vCPUs are being scheduled |
Halted
|
unit
|
VM is not running (i.e. no memory is being consumed and no vCPUs are being scheduled) |
Suspended
|
unit
|
VM runtime state has been saved to disk and VM is not running (i.e. no memory is being consumed and no vCPUs are being scheduled) |
Paused
|
unit
|
VM is paused (i.e. memory is still being consumed but no vCPUs are being scheduled) |
A disk which should be added to a VM
Constructors:
Type | Description | |
Local
|
string
|
An already-configured block device in dmoain 0 (intended for testing) |
VDI
|
string
|
Identifies a VDI controlled by the Storage Manager (of the form SR/VDI) |
Query the properties of this service
Properties of this service
Members:
Type | Description | |
name
|
string
|
Human-readable name of this service |
vendor
|
string
|
Vendor of this service |
version
|
string
|
Version number of this service |
features
|
string list
|
A set of feature flags |
instance_id
|
string
|
A unique id for this instance, regenerated over service restart |
[query] returns the properties of this service
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
info
|
out |
info/Query
|
The properties of this service |
<method name="query"> <tp:docstring> [query] returns the properties of this service </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="(sssass)" name="info" direction="out"> <tp:docstring> The properties of this service </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Query_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.query ~dbg:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Query_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Query_skeleton(M) (* ... *) let query x = let open Query.Query in return (Result.Ok (Out.({ name = "string"; vendor = "string"; version = "string"; features = [ "string"; "string" ]; instance_id = "string" }))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Query.query({ dbg: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Query_myimplementation(Query_skeleton): # by default each method will return a Not_implemented error # ... def query(self, dbg): """Query the properties of this service""" result = {} result["info"] = { "name": "string", "vendor": "string", "version": "string", "features": [ "string", "string" ], "instance_id": "string" } return result # ...
Types used for configuring VM networking
A network to be attached to a VM
Constructors:
Type | Description | |
Local
|
string
|
name of an already-configured local switch |
Remote
|
string
|
name of a switch in another domain |
Types used to represent a VM configuration
Type of video hardware
Constructors:
Type | Description | |
Cirrus
|
unit
|
Cirrus Logic |
Standard_VGA
|
unit
|
Standard VGA |
Hardware options specific to HVM VMs
Members:
Type | Description | |
hap
|
bool
|
If true then Hardware Assisted Paging (HAP) will be enabled |
shadow_multiplier
|
float
|
Allow the amount of shadow memory to be increased beyond the default amount (1.0 means default) |
timeoffset
|
string
|
Offset between the host clock (in UTC) and guest time stored in the virtual BIOS |
video_mib
|
int64
|
Amount of video memory (in MiB) |
video
|
video_card
|
Type of video hardware |
acpi
|
bool
|
If true then ACPI will be enabled |
serial
|
string option
|
|
keymap
|
string option
|
|
vnc_ip
|
string option
|
Specify the IP on which the VNC framebuffer will listen (default 127.0.0.1) |
pci_emulations
|
string list
|
|
pci_passthrough
|
bool
|
If true then PCI passthrough is enabled |
boot_order
|
string
|
BIOS boot order ('cdn' = disk; cdrom; network) |
qemu_disk_cmdline
|
bool
|
If true then the qemu commandline will be used to configure disks, otherwise xenstore will be used |
qemu_stubdom
|
bool
|
If true then qemu will be run inside a stub domain |
PV VM boot options without a 'pygrub'-style bootloader
Members:
Type | Description | |
kernel
|
string
|
Path to the VM kernel image |
cmdline
|
string
|
Command-line options to pass to the VM kernel |
ramdisk
|
string option
|
Optional initial ramdisk to pass to the VM kernel |
PV VM boot options when using a 'pygrub'-style bootloader
Members:
Type | Description | |
bootloader
|
string
|
Name of the bootloader to use (e.g. 'pygrub') |
extra_args
|
string
|
Additional arguments to pass to the VM kernel in addition to those from the bootloader |
legacy_args
|
string
|
|
bootloader_args
|
string
|
Additional arguments to pass to the bootloader itself |
devices
|
disk list
|
Ordered list of disks to search for bootloader configuration |
Describes how to boot a particular PV VM
Constructors:
Type | Description | |
Direct
|
pv_direct_boot
|
Use the given kernel/cmdline/ramdisk |
Indirect
|
pv_indirect_boot
|
Determine the kernel/cmdline/ramdisk through a bootloader (e.g. 'pygrub') |
Hardware configuration for a particular PV VM
Members:
Type | Description | |
boot
|
pv_boot
|
Describe how to acquire a kernel/cmdline/initrd |
framebuffer
|
bool
|
If true then create a PV framebuffer |
vncterm
|
bool
|
If true then export the default serial console over VNC |
vncterm_ip
|
string option
|
Specify the IP address to bind the default VNC serial console to |
Describes how to boot a particular VM (HVM or PV)
Constructors:
Type | Description | |
HVM
|
hvm_info
|
Boot HVM |
PV
|
pv_info
|
Boot PV |
A unique VM id (or handle)
Describes an action to perform after a shutdown/reboot/crash
Constructors:
Type | Description | |
Coredump
|
unit
|
Perform a core dump |
Shutdown
|
unit
|
Shut down the VM and leave it Halted |
Start
|
unit
|
(Re)Start the VM and leave it Running |
xen credit1 scheduler weight and cap
Members:
Type | Description | |
weight
|
int64
|
|
cap
|
int64
|
vCPU configuration for the xen scheduler
Members:
Type | Description | |
priority
|
weight_and_cap option
|
Priority setting to be applied to all vCPUs |
affinity
|
int64 list list
|
For each vCPU, a set of pCPUs to pin it |
VM configuration
Members:
Type | Description | |
id
|
id
|
Unique ID for this VM |
name
|
string
|
Human-readable (non-unique) name for this VM |
ssidref
|
int64
|
|
xsdata
|
(string * string) list
|
Additional key/value pairs to write into xenstore on domain create |
platformdata
|
(string * string) list
|
Additional key/value pairs to write into the platform/ directory in xenstore on domain create |
bios_strings
|
(string * string) list
|
Key/value pairs representing the BIOS (e.g. vendor) information to be passed to the VM |
ty
|
builder_info
|
Describes how to boot this VM |
suppress_spurious_page_faults
|
bool
|
If true then enable the spurious page faults workaround |
machine_address_size
|
int64 option
|
|
memory_static_max
|
int64
|
Amount of physical RAM to expose to the VM during boot |
memory_dynamic_max
|
int64
|
Maximum amount of physical host RAM to allocate to the guest (via PoD and ballooning) |
memory_dynamic_min
|
int64
|
Minimum amount of physical host RAM to allocate to the guest (via PoD and ballooning) |
vcpu_max
|
int64
|
Number of virtual CPUs (vCPUs) to expose to the VM during boot |
vcpus
|
int64
|
Number of virtual CPUs (vCPUs) to tell the VM to actually use |
scheduler_params
|
scheduler_params
|
xen scheduler configuration |
on_crash
|
action list
|
actions to perform if this VM crashes |
on_shutdown
|
action list
|
actions to perform if this VM shuts down |
on_reboot
|
action list
|
actions to perform if this VM reboots |
transient
|
bool
|
If true this VM will be forgotten if it shuts down (not if it reboots) |
pci_msitranslate
|
bool
|
If true then enable MSI translation for passed-through PCI devices |
pci_power_mgmt
|
bool
|
If true then enable PCI power management for passed-through PCI devices |
Protocol to use for interacting with the VM console
Constructors:
Type | Description | |
Rfb
|
unit
|
Use the Remote FrameBuffer protocol i.e. VNC |
Vt100
|
unit
|
Treat the console as a VT100 terminal |
Console configuration
Members:
Type | Description | |
protocol
|
console_protocol
|
Protocol to use for interacting with the VM console |
port
|
int64
|
Port number on which the console server is listening |
Run-time state of the VM
Members:
Type | Description | |
power_state
|
power_state
|
Power state of the VM |
domids
|
int64 list
|
Domain ids in use by the VM |
consoles
|
console list
|
Consoles attached to the VM |
memory_target
|
int64
|
Balloon driver memory target |
vcpu_target
|
int64
|
Actual number of vCPUs in use |
shadow_multiplier_target
|
float
|
Effective shadow_multiplier in use |
rtc_timeoffset
|
string
|
Difference between the host clock (in UTC) and the VM's BIOS clock |
uncooperative_balloon_driver
|
bool
|
If true the balloon driver is not responding properly to commands |
guest_agent
|
(string * string) list
|
Key/value pairs reported by the guest agent via xenstore |
last_start_time
|
float
|
Time the VM last (Re)Started |
[add t] registers a new VM configuration [t] with the service.
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
t
|
in |
t/Vm
|
The VM configuration to register |
id
|
out |
id/Vm
|
A reference to the registered configuration |
<method name="add"> <tp:docstring> [add t] registers a new VM configuration [t] with the service. </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="(ssxa{ss}a{ss}a{ss}(i((bdsx(i())b(bs)(bs)(bs)asbsbb)((i((ss(bs))(ssssa(i(ss)))))bb(bs))))b(bx)xxxxx((b(xx))aax)a(i())a(i())a(i())bbb)" name="t" direction="in"> <tp:docstring> The VM configuration to register </tp:docstring> </arg> <arg type="s" name="id" direction="out"> <tp:docstring> A reference to the registered configuration </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.add ~dbg:"string" ~t:{ id = "string"; name = "string"; ssidref = 0L; xsdata = [ ("string", "string") ]; platformdata = [ ("string", "string") ]; bios_strings = [ ("string", "string") ]; ty = HVM { hap = true; shadow_multiplier = 1.1; timeoffset = "string"; video_mib = 0L; video = Cirrus (); acpi = true; serial = Some "string"; keymap = Some "string"; vnc_ip = Some "string"; pci_emulations = [ "string"; "string" ]; pci_passthrough = true; boot_order = "string"; qemu_disk_cmdline = true; qemu_stubdom = true }; suppress_spurious_page_faults = true; machine_address_size = Some 0L; memory_static_max = 0L; memory_dynamic_max = 0L; memory_dynamic_min = 0L; vcpu_max = 0L; vcpus = 0L; scheduler_params = { priority = Some { weight = 0L; cap = 0L }; affinity = [ [ 0L; 0L ]; [ 0L; 0L ] ] }; on_crash = [ Coredump (); Coredump () ]; on_shutdown = [ Coredump (); Coredump () ]; on_reboot = [ Coredump (); Coredump () ]; transient = true; pci_msitranslate = true; pci_power_mgmt = true };;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let add x = let open Vm.Add in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.add({ dbg: "string", t: { "id": "string", "name": "string", "ssidref": 0L, "xsdata": { "string": "string" }, "platformdata": { "string": "string" }, "bios_strings": { "string": "string" }, "ty": None, "suppress_spurious_page_faults": True, "machine_address_size": None, "memory_static_max": 0L, "memory_dynamic_max": 0L, "memory_dynamic_min": 0L, "vcpu_max": 0L, "vcpus": 0L, "scheduler_params": { "priority": None, "affinity": [ [ 0L, 0L ], [ 0L, 0L ] ] }, "on_crash": [ None, None ], "on_shutdown": [ None, None ], "on_reboot": [ None, None ], "transient": True, "pci_msitranslate": True, "pci_power_mgmt": True } }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def add(self, dbg, t): """Types used to represent a VM configuration""" result = {} result["id"] = "string" return result # ...
[remove id] unregisters a VM configuration [id].
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to unregister. |
<method name="remove"> <tp:docstring> [remove id] unregisters a VM configuration [id]. </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to unregister. </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.remove ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let remove x = let open Vm.Remove in return (Result.Ok ()) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.remove({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def remove(self, dbg, id): """Types used to represent a VM configuration""" result = {} return result # ...
[create id] creates the necessary domains to (re)start a given VM
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="create"> <tp:docstring> [create id] creates the necessary domains to (re)start a given VM </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.create ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let create x = let open Vm.Create in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.create({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def create(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[build id] runs the domain builder to (re)start a given VM
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="build"> <tp:docstring> [build id] runs the domain builder to (re)start a given VM </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.build ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let build x = let open Vm.Build in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.build({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def build(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[create_device_model id] instantiates the virtual hardware (device model) to (re)start a given VM
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
is_resuming
|
in |
bool
|
If true then the VM is being resumed and device model state should be reloaded |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="create_device_model"> <tp:docstring> [create_device_model id] instantiates the virtual hardware (device model) to (re)start a given VM </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="b" name="is_resuming" direction="in"> <tp:docstring> If true then the VM is being resumed and device model state should be reloaded </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.create_device_model ~dbg:"string" ~id:"string" ~is_resuming:true;;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let create_device_model x = let open Vm.Create_device_model in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.create_device_model({ dbg: "string", id: "string", is_resuming: True }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def create_device_model(self, dbg, id, is_resuming): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[destroy id] destroys all domains associated with a given VM
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="destroy"> <tp:docstring> [destroy id] destroys all domains associated with a given VM </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.destroy ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let destroy x = let open Vm.Destroy in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.destroy({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def destroy(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[pause id] deschedules all vCPUs of a VM, leaving it paused
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="pause"> <tp:docstring> [pause id] deschedules all vCPUs of a VM, leaving it paused </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.pause ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let pause x = let open Vm.Pause in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.pause({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def pause(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[unpause id] unpauses a VM, allowing all vCPUs to be scheduled
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="unpause"> <tp:docstring> [unpause id] unpauses a VM, allowing all vCPUs to be scheduled </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.unpause ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let unpause x = let open Vm.Unpause in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.unpause({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def unpause(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[set_vcpus id target] sets the total number of vCPUs which a VM should use to [target]
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
num_vpcus
|
in |
int64
|
The target number of vCPUs |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="set_vcpus"> <tp:docstring> [set_vcpus id target] sets the total number of vCPUs which a VM should use to [target] </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="x" name="num_vpcus" direction="in"> <tp:docstring> The target number of vCPUs </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.set_vcpus ~dbg:"string" ~id:"string" ~num_vpcus:0L;;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let set_vcpus x = let open Vm.Set_vcpus in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.set_vcpus({ dbg: "string", id: "string", num_vpcus: 0L }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def set_vcpus(self, dbg, id, num_vpcus): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[set_shadow_multiplier id] sets the total number of vCPUs which a VM should use to [target]
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
shadow_multiplier
|
in |
float
|
The target shadow_multiplier |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="set_shadow_multiplier"> <tp:docstring> [set_shadow_multiplier id] sets the total number of vCPUs which a VM should use to [target] </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="d" name="shadow_multiplier" direction="in"> <tp:docstring> The target shadow_multiplier </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.set_shadow_multiplier ~dbg:"string" ~id:"string" ~shadow_multiplier:1.1;;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let set_shadow_multiplier x = let open Vm.Set_shadow_multiplier in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.set_shadow_multiplier({ dbg: "string", id: "string", shadow_multiplier: 1.1 }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def set_shadow_multiplier(self, dbg, id, shadow_multiplier): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[stat id] returns the current VM configuration
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to query. |
state
|
out |
t/Vm
*
state/Vm
option
|
The current VM runtime state |
<method name="stat"> <tp:docstring> [stat id] returns the current VM configuration </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to query. </tp:docstring> </arg> <arg type="(b(ssxa{ss}a{ss}a{ss}(i((bdsx(i())b(bs)(bs)(bs)asbsbb)((i((ss(bs))(ssssa(i(ss)))))bb(bs))))b(bx)xxxxx((b(xx))aax)a(i())a(i())a(i())bbb)((i())axa((i())x)xxdsba{ss}d))" name="state" direction="out"> <tp:docstring> The current VM runtime state </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.stat ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let stat x = let open Vm.Stat in return (Result.Ok (Out.(Some ({ id = "string"; name = "string"; ssidref = 0L; xsdata = [ ("string", "string") ]; platformdata = [ ("string", "string") ]; bios_strings = [ ("string", "string") ]; ty = HVM { hap = true; shadow_multiplier = 1.1; timeoffset = "string"; video_mib = 0L; video = Cirrus (); acpi = true; serial = Some "string"; keymap = Some "string"; vnc_ip = Some "string"; pci_emulations = [ "string"; "string" ]; pci_passthrough = true; boot_order = "string"; qemu_disk_cmdline = true; qemu_stubdom = true }; suppress_spurious_page_faults = true; machine_address_size = Some 0L; memory_static_max = 0L; memory_dynamic_max = 0L; memory_dynamic_min = 0L; vcpu_max = 0L; vcpus = 0L; scheduler_params = { priority = Some { weight = 0L; cap = 0L }; affinity = [ [ 0L; 0L ]; [ 0L; 0L ] ] }; on_crash = [ Coredump (); Coredump () ]; on_shutdown = [ Coredump (); Coredump () ]; on_reboot = [ Coredump (); Coredump () ]; transient = true; pci_msitranslate = true; pci_power_mgmt = true }, { power_state = Running (); domids = [ 0L; 0L ]; consoles = [ { protocol = Rfb (); port = 0L }; { protocol = Rfb (); port = 0L } ]; memory_target = 0L; vcpu_target = 0L; shadow_multiplier_target = 1.1; rtc_timeoffset = "string"; uncooperative_balloon_driver = true; guest_agent = [ ("string", "string") ]; last_start_time = 1.1 })))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.stat({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def stat(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["state"] = None return result # ...
[list id] returns the list of all registered VM configurations
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
VMs
|
out |
t/Vm
*
state/Vm
list
|
All registered VM configurations |
<method name="list"> <tp:docstring> [list id] returns the list of all registered VM configurations </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="a(ssxa{ss}a{ss}a{ss}(i((bdsx(i())b(bs)(bs)(bs)asbsbb)((i((ss(bs))(ssssa(i(ss)))))bb(bs))))b(bx)xxxxx((b(xx))aax)a(i())a(i())a(i())bbb)((i())axa((i())x)xxdsba{ss}d)" name="VMs" direction="out"> <tp:docstring> All registered VM configurations </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.list ~dbg:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let list x = let open Vm.List in return (Result.Ok (Out.([ ({ id = "string"; name = "string"; ssidref = 0L; xsdata = [ ("string", "string") ]; platformdata = [ ("string", "string") ]; bios_strings = [ ("string", "string") ]; ty = HVM { hap = true; shadow_multiplier = 1.1; timeoffset = "string"; video_mib = 0L; video = Cirrus (); acpi = true; serial = Some "string"; keymap = Some "string"; vnc_ip = Some "string"; pci_emulations = [ "string"; "string" ]; pci_passthrough = true; boot_order = "string"; qemu_disk_cmdline = true; qemu_stubdom = true }; suppress_spurious_page_faults = true; machine_address_size = Some 0L; memory_static_max = 0L; memory_dynamic_max = 0L; memory_dynamic_min = 0L; vcpu_max = 0L; vcpus = 0L; scheduler_params = { priority = Some { weight = 0L; cap = 0L }; affinity = [ [ 0L; 0L ]; [ 0L; 0L ] ] }; on_crash = [ Coredump (); Coredump () ]; on_shutdown = [ Coredump (); Coredump () ]; on_reboot = [ Coredump (); Coredump () ]; transient = true; pci_msitranslate = true; pci_power_mgmt = true }, { power_state = Running (); domids = [ 0L; 0L ]; consoles = [ { protocol = Rfb (); port = 0L }; { protocol = Rfb (); port = 0L } ]; memory_target = 0L; vcpu_target = 0L; shadow_multiplier_target = 1.1; rtc_timeoffset = "string"; uncooperative_balloon_driver = true; guest_agent = [ ("string", "string") ]; last_start_time = 1.1 }); ({ id = "string"; name = "string"; ssidref = 0L; xsdata = [ ("string", "string") ]; platformdata = [ ("string", "string") ]; bios_strings = [ ("string", "string") ]; ty = HVM { hap = true; shadow_multiplier = 1.1; timeoffset = "string"; video_mib = 0L; video = Cirrus (); acpi = true; serial = Some "string"; keymap = Some "string"; vnc_ip = Some "string"; pci_emulations = [ "string"; "string" ]; pci_passthrough = true; boot_order = "string"; qemu_disk_cmdline = true; qemu_stubdom = true }; suppress_spurious_page_faults = true; machine_address_size = Some 0L; memory_static_max = 0L; memory_dynamic_max = 0L; memory_dynamic_min = 0L; vcpu_max = 0L; vcpus = 0L; scheduler_params = { priority = Some { weight = 0L; cap = 0L }; affinity = [ [ 0L; 0L ]; [ 0L; 0L ] ] }; on_crash = [ Coredump (); Coredump () ]; on_shutdown = [ Coredump (); Coredump () ]; on_reboot = [ Coredump (); Coredump () ]; transient = true; pci_msitranslate = true; pci_power_mgmt = true }, { power_state = Running (); domids = [ 0L; 0L ]; consoles = [ { protocol = Rfb (); port = 0L }; { protocol = Rfb (); port = 0L } ]; memory_target = 0L; vcpu_target = 0L; shadow_multiplier_target = 1.1; rtc_timeoffset = "string"; uncooperative_balloon_driver = true; guest_agent = [ ("string", "string") ]; last_start_time = 1.1 }) ]))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.list({ dbg: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def list(self, dbg): """Types used to represent a VM configuration""" result = {} result["VMs"] = [ [], [] ] return result # ...
[start id] powers-on a VM, leaving it Running
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="start"> <tp:docstring> [start id] powers-on a VM, leaving it Running </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.start ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let start x = let open Vm.Start in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.start({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def start(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[shutdown id] shuts down and powers-off a VM, leaving it Halted
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
clean_shutdown_timeout
|
in |
float
option
|
If a clean_shutdown_timeout is provided, signal and wait for the guest to shutdown before powering it off |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="shutdown"> <tp:docstring> [shutdown id] shuts down and powers-off a VM, leaving it Halted </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="(bd)" name="clean_shutdown_timeout" direction="in"> <tp:docstring> If a clean_shutdown_timeout is provided, signal and wait for the guest to shutdown before powering it off </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.shutdown ~dbg:"string" ~id:"string" ~clean_shutdown_timeout:Some 1.1;;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let shutdown x = let open Vm.Shutdown in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.shutdown({ dbg: "string", id: "string", clean_shutdown_timeout: None }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def shutdown(self, dbg, id, clean_shutdown_timeout): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[reboot id] reboots a VM, leaving it Running
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
clean_shutdown_timeout
|
in |
float
option
|
If a clean_shutdown_timeout is provided, signal and wait for the guest to shutdown before powering it off |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="reboot"> <tp:docstring> [reboot id] reboots a VM, leaving it Running </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="(bd)" name="clean_shutdown_timeout" direction="in"> <tp:docstring> If a clean_shutdown_timeout is provided, signal and wait for the guest to shutdown before powering it off </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.reboot ~dbg:"string" ~id:"string" ~clean_shutdown_timeout:Some 1.1;;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let reboot x = let open Vm.Reboot in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.reboot({ dbg: "string", id: "string", clean_shutdown_timeout: None }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def reboot(self, dbg, id, clean_shutdown_timeout): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[resume id disk] resumes a VM from the given [disk], leaving it Running
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
disk
|
in |
disk
|
The disk from which to load the running memory state |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="resume"> <tp:docstring> [resume id disk] resumes a VM from the given [disk], leaving it Running </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="(i(ss))" name="disk" direction="in"> <tp:docstring> The disk from which to load the running memory state </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.resume ~dbg:"string" ~id:"string" ~disk:Local "string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let resume x = let open Vm.Resume in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.resume({ dbg: "string", id: "string", disk: None }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def resume(self, dbg, id, disk): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[s3suspend id] triggers an S3 suspend
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="s3suspend"> <tp:docstring> [s3suspend id] triggers an S3 suspend </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.s3suspend ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let s3suspend x = let open Vm.S3suspend in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.s3suspend({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def s3suspend(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[s3resume id] triggers an S3 resume
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="s3resume"> <tp:docstring> [s3resume id] triggers an S3 resume </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.s3resume ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let s3resume x = let open Vm.S3resume in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.s3resume({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def s3resume(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[migrate id url] migrates a running VM image to a remote machine
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
url
|
in |
string
|
URL of remote xenops service to receive the running VM image |
task
|
out |
id/Task
|
A reference to an asynchronous task |
<method name="migrate"> <tp:docstring> [migrate id url] migrates a running VM image to a remote machine </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="url" direction="in"> <tp:docstring> URL of remote xenops service to receive the running VM image </tp:docstring> </arg> <arg type="s" name="task" direction="out"> <tp:docstring> A reference to an asynchronous task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.migrate ~dbg:"string" ~id:"string" ~url:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let migrate x = let open Vm.Migrate in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.migrate({ dbg: "string", id: "string", url: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def migrate(self, dbg, id, url): """Types used to represent a VM configuration""" result = {} result["task"] = "string" return result # ...
[export_metadata id] returns a whole VM configuration as a string
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Vm
|
The reference of the VM to act on. |
VM
|
out |
string
|
A whole VM configuration |
<method name="export_metadata"> <tp:docstring> [export_metadata id] returns a whole VM configuration as a string </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the VM to act on. </tp:docstring> </arg> <arg type="s" name="VM" direction="out"> <tp:docstring> A whole VM configuration </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.export_metadata ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let export_metadata x = let open Vm.Export_metadata in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.export_metadata({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def export_metadata(self, dbg, id): """Types used to represent a VM configuration""" result = {} result["VM"] = "string" return result # ...
[import_metadata config] takes a whole VM configuration and registers it (including all devices)
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
config
|
in |
string
|
The whole VM configuration to import. |
id
|
out |
id/Vm
|
A reference to the registered VM. |
<method name="import_metadata"> <tp:docstring> [import_metadata config] takes a whole VM configuration and registers it (including all devices) </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="config" direction="in"> <tp:docstring> The whole VM configuration to import. </tp:docstring> </arg> <arg type="s" name="id" direction="out"> <tp:docstring> A reference to the registered VM. </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Vm_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.import_metadata ~dbg:"string" ~config:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Vm_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Vm_skeleton(M) (* ... *) let import_metadata x = let open Vm.Import_metadata in return (Result.Ok (Out.("string"))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Vm.import_metadata({ dbg: "string", config: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Vm_myimplementation(Vm_skeleton): # by default each method will return a Not_implemented error # ... def import_metadata(self, dbg, config): """Types used to represent a VM configuration""" result = {} result["id"] = "string" return result # ...
PCI devices passed-through to the VM
A reference (or handle) to a PCI device
PCI device configuration
Members:
Type | Description | |
id
|
id
|
Reference to this PCI device configuration |
position
|
int64
|
Position on the VM's virtual PCI bus |
domain
|
int64
|
Physical PCI device domain |
bus
|
int64
|
Physical PCI device bus |
dev
|
int64
|
Physical PCI device dev |
fn
|
int64
|
Physical PCI device function |
msitranslate
|
bool option
|
Override the VM-wide MSI translation setting for this device |
power_mgmt
|
bool option
|
Override the VM-wide PCI power management setting for this device |
Run-time state of this PCI device
Members:
Type | Description | |
plugged
|
bool
|
If true this device is currently attached to the VM |
Virtual Block Device configuration
Indicates whether this block device will be exposed read/only or read/write
Constructors:
Type | Description | |
ReadOnly
|
unit
|
Expose as read/only |
ReadWrite
|
unit
|
Expose as read/write |
Indicates whether this block device will be exposed as a fixed disk or removable CDROM
Constructors:
Type | Description | |
CDROM
|
unit
|
Expose as a removable CDROM |
Disk
|
unit
|
Expose as a fixed disk |
A reference (or handle) to this VBD configuration
Disk QoS scheduling class
Constructors:
Type | Description | |
Highest
|
unit
|
|
High
|
unit
|
|
Normal
|
unit
|
|
Low
|
unit
|
|
Lowest
|
unit
|
|
Other
|
int64
|
Choice of Disk QoS scheduler
Constructors:
Type | Description | |
RealTime
|
qos_class
|
|
Idle
|
unit
|
|
BestEffort
|
qos_class
|
VBD QoS configuration
Constructors:
Type | Description | |
Ionice
|
qos_scheduler
|
VBD configuration
Members:
Type | Description | |
id
|
id
|
Unique ID for this VBD configuration |
position
|
int64 option
|
Position this disk should be exposed at on the VM's disk controller |
mode
|
mode
|
Read/write or Read/only |
backend
|
disk option
|
Actual disk contents (None means empty) |
ty
|
ty
|
Fixed disk or removable CDROM |
unpluggable
|
bool
|
If true then the device can be hot-unplugged from the VM |
extra_backend_keys
|
(string * string) list
|
Key/value pairs to be written to the disk backend in xenstore |
extra_private_keys
|
(string * string) list
|
Key/value pairs to be written to the per-disk private directory in xenstore |
qos
|
qos option
|
Optional QoS configuration |
Run-time state of the VBD
Members:
Type | Description | |
id
|
id
|
Unique ID for the corresponding VBD |
qos_target
|
qos option
|
Disk QoS parameters in effect (if any) |
media_present
|
bool
|
If true then media is present in this drive |
Virtual (Network) InterFace configuration
A reference (or handle) to identify this VIF configuration
QoS settings for this VIF
Members:
Type | Description | |
kbytes_per_sec
|
int64
|
kBytes/sec maximum rate to allow |
timeslice_us
|
int64
|
Interval in microseconds to impose the maximum rate |
a VIF configuration
Members:
Type | Description | |
id
|
id
|
A reference to uniquely identify this VIF configuration |
position
|
int64
|
Position this VIF will be exposed at on the VM's bus |
mac
|
string
|
MAC address |
carrier
|
bool
|
If true then signal that a carrier is present |
mtu
|
int64
|
Maximum Transfer Unit (MTU) |
rate
|
rate option
|
Optional QoS setting |
backend
|
t/Network
|
XXX |
other_config
|
(string * string) list
|
|
extra_private_keys
|
(string * string) list
|
Run-time state of this VIF
Members:
Type | Description | |
plugged
|
bool
|
If true then this VIF is currently attached to the VM |
kthread_pid
|
int64
|
|
media_present
|
bool
|
If true then media is present in this VIF |
Encapsulates a whole VM configuration (VM, VBDs, VIFs, PCIs)
A whole VM configuration (e.g. for export or import)
Members:
Type | Description | |
vm
|
t/Vm
|
|
vbds
|
t/Vbd list
|
|
vifs
|
t/Vif list
|
|
pcis
|
t/Pci list
|
|
domains
|
string option
|
Opaque data describing per-domain state |
Describes asynchronous tasks
A reference (or handle) to a specific task
The result of a task which has stopped executing
Constructors:
Type | Description | |
Pending
|
float
|
Task is still running and is the given fraction complete |
Completed
|
float
|
Task has completed successfully after the given number of seconds |
Failed
|
string
|
XXX Task has failed with the given error |
An asynchronous task
Members:
Type | Description | |
id
|
id
|
A reference (or handle) to a specific task |
result
|
result
|
Current progress or result |
subtasks
|
(string * string) list
|
Diagnostic information about 'subtasks' |
[stat task] returns the current state of [task].
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Task
|
The reference of the task to query |
t
|
out |
t/Task
|
The current state of the task |
<method name="stat"> <tp:docstring> [stat task] returns the current state of [task]. </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the task to query </tp:docstring> </arg> <arg type="(s(i(dds))a{ss})" name="t" direction="out"> <tp:docstring> The current state of the task </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Task_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.stat ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Task_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Task_skeleton(M) (* ... *) let stat x = let open Task.Stat in return (Result.Ok (Out.({ id = "string"; result = Pending 1.1; subtasks = [ ("string", "string") ] }))) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Task.stat({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Task_myimplementation(Task_skeleton): # by default each method will return a Not_implemented error # ... def stat(self, dbg, id): """Describes asynchronous tasks""" result = {} result["t"] = { "id": "string", "result": None, "subtasks": { "string": "string" } } return result # ...
[cancel task] requests that [task] be immediately cancelled.
Direction | Type | Description | |
dbg
|
in |
debug_info
|
Debug context from the caller |
id
|
in |
id/Task
|
The reference of the task to cancel |
<method name="cancel"> <tp:docstring> [cancel task] requests that [task] be immediately cancelled. </tp:docstring> <arg type="s" name="dbg" direction="in"> <tp:docstring> Debug context from the caller </tp:docstring> </arg> <arg type="s" name="id" direction="in"> <tp:docstring> The reference of the task to cancel </tp:docstring> </arg> </method>
(* these directives only needed in a toplevel: *) #require "xcp-api-client";; #require "lwt";; #require "lwt.syntax";; #require "rpc.unix";; open Xcp open Domains open Types module Client = Task_client(struct include Lwt let rpc call = return (Rpc_client.do_rpc ~content_type:`XML ~path:"/" ~host:"127.0.0.1" ~port:80 call) (* TODO: Rpc_client needs to support Lwt *) end) let result = Client.cancel ~dbg:"string" ~id:"string";;
(* this line only needed in a toplevel: *) #require "xcp-api-client";; open Xcp open Domains open Types module Task_myimplementation = functor(M: M) -> struct (* by default every operation will return a 'not implemented' exception *) include Task_skeleton(M) (* ... *) let cancel x = let open Task.Cancel in return (Result.Ok ()) (* ... *) end
import xmlrpclib import xcp from storage import * if __name__ == "__main__": c = xcp.connect() results = c.Task.cancel({ dbg: "string", id: "string" }) print (repr(results))
import xmlrpclib import xcp from storage import * class Task_myimplementation(Task_skeleton): # by default each method will return a Not_implemented error # ... def cancel(self, dbg, id): """Describes asynchronous tasks""" result = {} return result # ...
Dynamically-typed values
A reference (or handle) to a specific object
Constructors:
Type | Description | |
Vm
|
id/Vm
|
A VM reference |
Vbd
|
id/Vbd
|
A VBD reference |
Vif
|
id/Vif
|
A VIF reference |
Pci
|
id/Pci
|
A PCI reference |
Task
|
id/Task
|
A Task reference |
Barrier
|
int64
|
A barrier inserted into an event stream |
A dynamically-typed event
Constructors:
Type | Description | |
Vm_t
|
id/Vm * t/Vm * state/Vm option
|
|
Vbd_t
|
id/Vbd * t/Vbd * state/Vbd option
|
|
Vif_t
|
id/Vif * t/Vif * state/Vif option
|
|
Pci_t
|
id/Pci * t/Pci * state/Pci option
|
|
Task_t
|
id/Task * t/Task option
|
Parameter Types | Description | |
Internal_error
|
string
|
An unexpected internal error occurred. The exception parameter will contain further information. |
Already_exists
|
unit
|
An object could not be created because one already exists with the same primary key. |
Does_not_exist
|
string * string
|
An object of type {1} and reference {2} does not exist |
Unimplemented
|
unit
|
The called function has not been implemented yet. |
Domain_not_built
|
unit
|
This operation cannot be performed on a domain which has not been built by the domain builder |
Maximum_vcpus
|
int64
|
The maximum number of vCPUs is {1} |
Bad_power_state
|
power_state * power_state
|
The operation cannot be performed while the VM is in the {1} power_state; it should be {2} instead |
Failed_to_achnowledge_shutdown_request
|
unit
|
The VM failed to acknowledge a request to shut itself down. Perhaps it does not have the VM tools installed? |
Failed_to_shutdown
|
unit
|
The VM failed to shutdown |
Device_is_connected
|
unit
|
The device is still connected to a VM |
Device_not_connected
|
unit
|
The device is not connected to a VM |
Device_detach_rejected
|
unit
|
The VM rejected a request to hot-unplug the device |
Media_not_ejectable
|
unit
|
The device contains media which is not ejectable. |
Media_present
|
unit
|
The device already contains media. |
Media_not_present
|
unit
|
THe device does not contain media. |
No_bootable_device
|
unit
|
The VM cannot be started because no device is bootable. |
Bootloader_error
|
string * string list
|
The VM bootloader returned an error. |
Ballooning_error
|
string * string
|
The ballooning service returned an error. |
No_ballooning_service
|
unit
|
Memory could not be allocated because no ballooning service is running. |
Not_supported
|
unit
|
The operation is not supported on this (kind of) VM. |
IO_error
|
unit
|
A disk I/O error occurred. |
VDI_not_found
|
unit
|
The storage service could not find a VDI |
Caller_must_pass_file_descriptor
|
unit
|
This operation requires the caller to pass a file descriptor but none was sent. |
Failed_to_contact_remote_service
|
string
|
The remote service ({1}) could not be contacted. Perhaps it is not running? |
Hook_failed
|
string * string * string * string
|
The hook script failed with the given error |
Not_enough_memory
|
int64
|
The host does not have enough memory free to complete this operation |