Develop for XenServer

Class: VBD

A virtual block device

Fields for class: VBD

Field Type Qualifier Description
allowed_operations vbd_operations 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.
bootable bool RW true if this VBD is bootable
current_operations (string -> vbd_operations) 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.
currently_attached bool RO/constructor is the device currently attached (erased on reboot)
device string RO/constructor device seen by the guest e.g. hda1
empty bool RO/constructor if true this represents an empty drive
metrics VBD_metrics ref RO/runtime Removed. metrics associated with this VBD
mode vbd_mode RO/constructor the mode the VBD should be mounted with
other_config (string -> string) map RW additional configuration
qos_algorithm_params (string -> string) map RW parameters for chosen QoS algorithm
qos_algorithm_type string RW QoS algorithm to use
qos_supported_algorithms string set RO/runtime supported QoS algorithms for this VBD
runtime_properties (string -> string) map RO/runtime Device runtime properties
status_code int RO/runtime error/success code associated with last attach-operation (erased on reboot)
status_detail string RO/runtime error/success information associated with last attach-operation status (erased on reboot)
storage_lock bool RO/runtime true if a storage level lock was acquired
type vbd_type RW how the VBD will appear to the guest (e.g. disk or CD)
unpluggable bool RW true if this VBD will support hot-unplug
userdevice string RW user-friendly device name e.g. 0,1,2,etc.
uuid string RO/runtime Unique identifier/object reference
VDI VDI ref RO/constructor the virtual disk
VM VM ref RO/constructor the virtual machine

RPCs associated with class: VBD

RPC name: add_to_other_config

Overview:

Add the given key-value pair to the other_config field of the given VBD.

Signature:

void add_to_other_config (session ref session_ref, VBD ref self, string key, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self reference to the object
string key Key to add
string value Value to add

Minimum Role: vm-admin

Return Type: void

RPC name: add_to_qos_algorithm_params

Overview:

Add the given key-value pair to the qos/algorithm_params field of the given VBD.

Signature:

void add_to_qos_algorithm_params (session ref session_ref, VBD ref self, string key, string value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self reference to the object
string key Key to add
string value Value to add

Minimum Role: vm-admin

Return Type: void

RPC name: assert_attachable

Overview:

Throws an error if this VBD could not be attached to this VM if the VM were running. Intended for debugging.

Signature:

void assert_attachable (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self The VBD to query

Minimum Role: vm-admin

Return Type: void

RPC name: create

Overview:

Create a new VBD instance, and return its handle.

Signature:

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

Arguments:

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

Minimum Role: vm-admin

Return Type: VBD ref

reference to the newly created object

RPC name: destroy

Overview:

Destroy the specified VBD instance.

Signature:

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

Arguments:

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

Minimum Role: vm-admin

Return Type: void

RPC name: eject

Overview:

Remove the media from the device and leave it empty

Signature:

void eject (session ref session_ref, VBD ref vbd)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref vbd The vbd representing the CDROM-like device

Minimum Role: vm-operator

Return Type: void

Possible Error Codes: VBD_NOT_REMOVABLE_MEDIA, VBD_IS_EMPTY

RPC name: get_all

Overview:

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

Signature:

VBD 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: VBD ref set

references to all objects

RPC name: get_all_records

Overview:

Return a map of VBD references to VBD records for all VBDs known to the system.

Signature:

(VBD ref -> VBD 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: (VBD ref -> VBD record) map

records of all objects

RPC name: get_allowed_operations

Overview:

Get the allowed_operations field of the given VBD.

Signature:

vbd_operations set get_allowed_operations (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: vbd_operations set

value of the field

RPC name: get_bootable

Overview:

Get the bootable field of the given VBD.

Signature:

bool get_bootable (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_by_uuid

Overview:

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

Signature:

VBD 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: VBD ref

reference to the object

RPC name: get_current_operations

Overview:

Get the current_operations field of the given VBD.

Signature:

(string -> vbd_operations) map get_current_operations (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: (string -> vbd_operations) map

value of the field

RPC name: get_currently_attached

Overview:

Get the currently_attached field of the given VBD.

Signature:

bool get_currently_attached (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_device

Overview:

Get the device field of the given VBD.

Signature:

string get_device (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_empty

Overview:

Get the empty field of the given VBD.

Signature:

bool get_empty (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_metrics

This message is removed.

Overview:

Get the metrics field of the given VBD.

Signature:

VBD_metrics ref get_metrics (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: VBD_metrics ref

value of the field

RPC name: get_mode

Overview:

Get the mode field of the given VBD.

Signature:

vbd_mode get_mode (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: vbd_mode

value of the field

RPC name: get_other_config

Overview:

Get the other_config field of the given VBD.

Signature:

(string -> string) map get_other_config (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_qos_algorithm_params

Overview:

Get the qos/algorithm_params field of the given VBD.

Signature:

(string -> string) map get_qos_algorithm_params (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_qos_algorithm_type

Overview:

Get the qos/algorithm_type field of the given VBD.

Signature:

string get_qos_algorithm_type (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_qos_supported_algorithms

Overview:

Get the qos/supported_algorithms field of the given VBD.

Signature:

string set get_qos_supported_algorithms (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: string set

value of the field

RPC name: get_record

Overview:

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

Signature:

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

Arguments:

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

Minimum Role: read-only

Return Type: VBD record

all fields from the object

RPC name: get_runtime_properties

Overview:

Get the runtime_properties field of the given VBD.

Signature:

(string -> string) map get_runtime_properties (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_status_code

Overview:

Get the status_code field of the given VBD.

Signature:

int get_status_code (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: int

value of the field

RPC name: get_status_detail

Overview:

Get the status_detail field of the given VBD.

Signature:

string get_status_detail (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_storage_lock

Overview:

Get the storage_lock field of the given VBD.

Signature:

bool get_storage_lock (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_type

Overview:

Get the type field of the given VBD.

Signature:

vbd_type get_type (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: vbd_type

value of the field

RPC name: get_unpluggable

Overview:

Get the unpluggable field of the given VBD.

Signature:

bool get_unpluggable (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_userdevice

Overview:

Get the userdevice field of the given VBD.

Signature:

string get_userdevice (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_uuid

Overview:

Get the uuid field of the given VBD.

Signature:

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

Arguments:

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

Minimum Role: read-only

Return Type: string

value of the field

RPC name: get_VDI

Overview:

Get the VDI field of the given VBD.

Signature:

VDI ref get_VDI (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: VDI ref

value of the field

RPC name: get_VM

Overview:

Get the VM field of the given VBD.

Signature:

VM ref get_VM (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: VM ref

value of the field

RPC name: insert

Overview:

Insert new media into the device

Signature:

void insert (session ref session_ref, VBD ref vbd, VDI ref vdi)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref vbd The vbd representing the CDROM-like device
VDI ref vdi The new VDI to ‘insert’

Minimum Role: vm-operator

Return Type: void

Possible Error Codes: VBD_NOT_REMOVABLE_MEDIA, VBD_NOT_EMPTY

RPC name: plug

Overview:

Hotplug the specified VBD, dynamically attaching it to the running VM

Signature:

void plug (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self The VBD to hotplug

Minimum Role: vm-admin

Return Type: void

RPC name: remove_from_other_config

Overview:

Remove the given key and its corresponding value from the other_config field of the given VBD. If the key is not in that Map, then do nothing.

Signature:

void remove_from_other_config (session ref session_ref, VBD ref self, string key)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self reference to the object
string key Key to remove

Minimum Role: vm-admin

Return Type: void

RPC name: remove_from_qos_algorithm_params

Overview:

Remove the given key and its corresponding value from the qos/algorithm_params field of the given VBD. If the key is not in that Map, then do nothing.

Signature:

void remove_from_qos_algorithm_params (session ref session_ref, VBD ref self, string key)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self reference to the object
string key Key to remove

Minimum Role: vm-admin

Return Type: void

RPC name: set_bootable

Overview:

Set the bootable field of the given VBD.

Signature:

void set_bootable (session ref session_ref, VBD ref self, bool value)
<!--NeedCopy-->

Arguments:

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

Minimum Role: vm-admin

Return Type: void

RPC name: set_mode

Overview:

Sets the mode of the VBD. The power_state of the VM must be halted.

Signature:

void set_mode (session ref session_ref, VBD ref self, vbd_mode value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self Reference to the object
vbd_mode value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: set_other_config

Overview:

Set the other_config field of the given VBD.

Signature:

void set_other_config (session ref session_ref, VBD ref self, (string -> string) map value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self reference to the object
(string -> string) map value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: set_qos_algorithm_params

Overview:

Set the qos/algorithm_params field of the given VBD.

Signature:

void set_qos_algorithm_params (session ref session_ref, VBD ref self, (string -> string) map value)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self reference to the object
(string -> string) map value New value to set

Minimum Role: vm-admin

Return Type: void

RPC name: set_qos_algorithm_type

Overview:

Set the qos/algorithm_type field of the given VBD.

Signature:

void set_qos_algorithm_type (session ref session_ref, VBD ref self, string value)
<!--NeedCopy-->

Arguments:

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

Minimum Role: vm-admin

Return Type: void

RPC name: set_type

Overview:

Set the type field of the given VBD.

Signature:

void set_type (session ref session_ref, VBD ref self, vbd_type value)
<!--NeedCopy-->

Arguments:

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

Minimum Role: vm-admin

Return Type: void

RPC name: set_unpluggable

Overview:

Set the unpluggable field of the given VBD.

Signature:

void set_unpluggable (session ref session_ref, VBD ref self, bool value)
<!--NeedCopy-->

Arguments:

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

Minimum Role: vm-admin

Return Type: void

RPC name: set_userdevice

Overview:

Set the userdevice field of the given VBD.

Signature:

void set_userdevice (session ref session_ref, VBD ref self, string value)
<!--NeedCopy-->

Arguments:

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

Minimum Role: vm-admin

Return Type: void

RPC name: unplug

Overview:

Hot-unplug the specified VBD, dynamically unattaching it from the running VM

Signature:

void unplug (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self The VBD to hot-unplug

Minimum Role: vm-admin

Return Type: void

Possible Error Codes: DEVICE_DETACH_REJECTED, DEVICE_ALREADY_DETACHED

RPC name: unplug_force

Overview:

Forcibly unplug the specified VBD

Signature:

void unplug_force (session ref session_ref, VBD ref self)
<!--NeedCopy-->

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
VBD ref self The VBD to forcibly unplug

Minimum Role: vm-admin

Return Type: void

Class: VBD