Develop for XenServer

Class: VM_appliance

VM appliance

Fields for class: VM_appliance

Field Type Qualifier Description
allowed_operations vm_appliance_operation set RO/runtime list of the operations allowed in this state. This list is advisory only and the server state may have changed by the time this field is read by a client.
current_operations (string -> vm_appliance_operation) map RO/runtime links each of the running tasks using this object (by reference) to a current_operation enum which describes the nature of the task.
name_description string RW a notes field containing human-readable description
name_label string RW a human-readable name
uuid string RO/runtime Unique identifier/object reference
VMs VM ref set RO/runtime all VMs in this appliance

RPCs associated with class: VM_appliance

RPC name: assert_can_be_recovered

Overview:

Assert whether all SRs required to recover this VM appliance are available.

Signature:

void assert_can_be_recovered (session ref session_ref, VM_appliance ref self, session ref session_to)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance to recover
session ref session_to The session to which the VM appliance is to be recovered.

Minimum Role: read-only

Return Type: void

Possible Error Codes: VM_REQUIRES_SR

RPC name: clean_shutdown

Overview:

Perform a clean shutdown of all the VMs in the appliance

Signature:

void clean_shutdown (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance

Minimum Role: pool-operator

Return Type: void

Possible Error Codes: OPERATION_PARTIALLY_FAILED

RPC name: create

Overview:

Create a new VM_appliance instance, and return its handle.

Signature:

VM_appliance ref create (session ref session_ref, VM_appliance record args)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance record args All constructor arguments

Minimum Role: pool-operator

Return Type: VM_appliance ref

reference to the newly created object

RPC name: destroy

Overview:

Destroy the specified VM_appliance instance.

Signature:

void destroy (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: pool-operator

Return Type: void

RPC name: get_all

Overview:

Return a list of all the VM_appliances known to the system.

Signature:

VM_appliance ref set get_all (session ref session_ref)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session

Minimum Role: read-only

Return Type: VM_appliance ref set

references to all objects

RPC name: get_all_records

Overview:

Return a map of VM_appliance references to VM_appliance records for all VM_appliances known to the system.

Signature:

(VM_appliance ref -> VM_appliance record) map get_all_records (session ref session_ref)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session

Minimum Role: read-only

Return Type: (VM_appliance ref -> VM_appliance record) map

records of all objects

RPC name: get_allowed_operations

Overview:

Get the allowed_operations field of the given VM_appliance.

Signature:

vm_appliance_operation set get_allowed_operations (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: vm_appliance_operation set

value of the field

RPC name: get_by_name_label

Overview:

Get all the VM_appliance instances with the given label.

Signature:

VM_appliance ref set get_by_name_label (session ref session_ref, string label)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
string label label of object to return

Minimum Role: read-only

Return Type: VM_appliance ref set

references to objects with matching names

RPC name: get_by_uuid

Overview:

Get a reference to the VM_appliance instance with the specified UUID.

Signature:

VM_appliance ref get_by_uuid (session ref session_ref, string uuid)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
string uuid UUID of object to return

Minimum Role: read-only

Return Type: VM_appliance ref

reference to the object

RPC name: get_current_operations

Overview:

Get the current_operations field of the given VM_appliance.

Signature:

(string -> vm_appliance_operation) map get_current_operations (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: (string -> vm_appliance_operation) map

value of the field

RPC name: get_name_description

Overview:

Get the name/description field of the given VM_appliance.

Signature:

string get_name_description (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_name_label

Overview:

Get the name/label field of the given VM_appliance.

Signature:

string get_name_label (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_record

Overview:

Get a record containing the current state of the given VM_appliance.

Signature:

VM_appliance record get_record (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: VM_appliance record

all fields from the object

RPC name: get_SRs_required_for_recovery

Overview:

Get the list of SRs required by the VM appliance to recover.

Signature:

SR ref set get_SRs_required_for_recovery (session ref session_ref, VM_appliance ref self, session ref session_to)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance for which the required list of SRs has to be recovered.
session ref session_to The session to which the list of SRs have to be recovered .

Minimum Role: read-only

Return Type: SR ref set

refs for SRs required to recover the VM

RPC name: get_uuid

Overview:

Get the uuid field of the given VM_appliance.

Signature:

string get_uuid (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_VMs

Overview:

Get the VMs field of the given VM_appliance.

Signature:

VM ref set get_VMs (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object

Minimum Role: read-only

Return Type: VM ref set

value of the field

RPC name: hard_shutdown

Overview:

Perform a hard shutdown of all the VMs in the appliance

Signature:

void hard_shutdown (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance

Minimum Role: pool-operator

Return Type: void

Possible Error Codes: OPERATION_PARTIALLY_FAILED

RPC name: recover

Overview:

Recover the VM appliance

Signature:

void recover (session ref session_ref, VM_appliance ref self, session ref session_to, bool force)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance to recover
session ref session_to The session to which the VM appliance is to be recovered.
bool force Whether the VMs should replace newer versions of themselves.

Minimum Role: read-only

Return Type: void

Possible Error Codes: VM_REQUIRES_SR

RPC name: set_name_description

Overview:

Set the name/description field of the given VM_appliance.

Signature:

void set_name_description (session ref session_ref, VM_appliance ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object
string value New value to set

Minimum Role: pool-operator

Return Type: void

RPC name: set_name_label

Overview:

Set the name/label field of the given VM_appliance.

Signature:

void set_name_label (session ref session_ref, VM_appliance ref self, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self reference to the object
string value New value to set

Minimum Role: pool-operator

Return Type: void

RPC name: shutdown

Overview:

For each VM in the appliance, try to shut it down cleanly. If this fails, perform a hard shutdown of the VM.

Signature:

void shutdown (session ref session_ref, VM_appliance ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance

Minimum Role: pool-operator

Return Type: void

Possible Error Codes: OPERATION_PARTIALLY_FAILED

RPC name: start

Overview:

Start all VMs in the appliance

Signature:

void start (session ref session_ref, VM_appliance ref self, bool paused)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VM_appliance ref self The VM appliance
bool paused Instantiate all VMs belonging to this appliance in paused state if set to true.

Minimum Role: pool-operator

Return Type: void

Possible Error Codes: OPERATION_PARTIALLY_FAILED