Develop for XenServer

Class: PBD

The physical block devices through which hosts access SRs

Fields for class: PBD

Field Type Qualifier Description
currently_attached bool RO/runtime is the SR currently attached on this host?
device_config (string -> string) map RO/constructor a config string to string map that is provided to the host’s SR-backend-driver
host host ref RO/constructor physical machine on which the pbd is available
other_config (string -> string) map RW additional configuration
SR SR ref RO/constructor the storage repository that the pbd realises
uuid string RO/runtime Unique identifier/object reference

RPCs associated with class: PBD

RPC name: add_to_other_config

Overview:

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

Signature:

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

Arguments:

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

Minimum Role: pool-operator

Return Type: void

RPC name: create

Overview:

Create a new PBD instance, and return its handle.

Signature:

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

Arguments:

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

Minimum Role: pool-operator

Return Type: PBD ref

reference to the newly created object

RPC name: destroy

Overview:

Destroy the specified PBD instance.

Signature:

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

Arguments:

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

Minimum Role: pool-operator

Return Type: void

RPC name: get_all

Overview:

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

Signature:

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

references to all objects

RPC name: get_all_records

Overview:

Return a map of PBD references to PBD records for all PBDs known to the system.

Signature:

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

records of all objects

RPC name: get_by_uuid

Overview:

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

Signature:

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

reference to the object

RPC name: get_currently_attached

Overview:

Get the currently_attached field of the given PBD.

Signature:

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

Arguments:

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

Minimum Role: read-only

Return Type: bool

value of the field

RPC name: get_device_config

Overview:

Get the device_config field of the given PBD.

Signature:

(string -> string) map get_device_config (session ref session_ref, PBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_host

Overview:

Get the host field of the given PBD.

Signature:

host ref get_host (session ref session_ref, PBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: host ref

value of the field

RPC name: get_other_config

Overview:

Get the other_config field of the given PBD.

Signature:

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

Arguments:

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

Minimum Role: read-only

Return Type: (string -> string) map

value of the field

RPC name: get_record

Overview:

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

Signature:

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

Arguments:

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

Minimum Role: read-only

Return Type: PBD record

all fields from the object

RPC name: get_SR

Overview:

Get the SR field of the given PBD.

Signature:

SR ref get_SR (session ref session_ref, PBD ref self)
<!--NeedCopy-->

Arguments:

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

Minimum Role: read-only

Return Type: SR ref

value of the field

RPC name: get_uuid

Overview:

Get the uuid field of the given PBD.

Signature:

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

Arguments:

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

Minimum Role: read-only

Return Type: string

value of the field

RPC name: plug

Overview:

Activate the specified PBD, causing the referenced SR to be attached and scanned

Signature:

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

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
PBD ref self The PBD to activate

Minimum Role: pool-operator

Return Type: void

Possible Error Codes: SR_UNKNOWN_DRIVER

RPC name: remove_from_other_config

Overview:

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

Signature:

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

Arguments:

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

Minimum Role: pool-operator

Return Type: void

RPC name: set_device_config

Overview:

Sets the PBD’s device_config field

Signature:

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

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
PBD ref self The PBD to modify
(string -> string) map value The new value of the PBD’s device_config

Minimum Role: pool-operator

Return Type: void

RPC name: set_other_config

Overview:

Set the other_config field of the given PBD.

Signature:

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

Arguments:

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

Minimum Role: pool-operator

Return Type: void

RPC name: unplug

Overview:

Deactivate the specified PBD, causing the referenced SR to be detached and nolonger scanned

Signature:

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

Arguments:

Type Name Description
session ref session_ref Reference to a valid session
PBD ref self The PBD to deactivate

Minimum Role: pool-operator

Return Type: void