Class: PBD

Last published : Oct 01, 2026
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: addtootherconfig

Overview:
Add the given keyvalue pair to the otherconfig field of the given PBD.
Signature:
void add_to_other_config (session ref session_ref, PBD ref self, string key, string value)
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)
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)
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: getall

Overview:
Return a list of all the PBDs known to the system.
Signature:
PBD ref set get_all (session ref session_ref)
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: getallrecords

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)
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: getbyuuid

Overview:
Get a reference to the PBD instance with the specified UUID.
Signature:
PBD ref get_by_uuid (session ref session_ref, string uuid)
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: getcurrentlyattached

Overview:
Get the currentlyattached field of the given PBD.
Signature:
bool get_currently_attached (session ref session_ref, PBD ref self)
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: getdeviceconfig

Overview:
Get the deviceconfig field of the given PBD.
Signature:
(string -> string) map get_device_config (session ref session_ref, PBD ref self)
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: gethost

Overview:
Get the host field of the given PBD.
Signature:
host ref get_host (session ref session_ref, PBD ref self)
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: getotherconfig

Overview:
Get the otherconfig field of the given PBD.
Signature:
(string -> string) map get_other_config (session ref session_ref, PBD ref self)
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: getrecord

Overview:
Get a record containing the current state of the given PBD.
Signature:
PBD record get_record (session ref session_ref, PBD ref self)
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: getSR

Overview:
Get the SR field of the given PBD.
Signature:
SR ref get_SR (session ref session_ref, PBD ref self)
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: getuuid

Overview:
Get the uuid field of the given PBD.
Signature:
string get_uuid (session ref session_ref, PBD ref self)
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)
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: removefromotherconfig

Overview:
Remove the given key and its corresponding value from the otherconfig 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)
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: setdeviceconfig

Overview:
Sets the PBD's deviceconfig field
Signature:
void set_device_config (session ref session_ref, PBD ref self, (string -> string) map value)
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: setotherconfig

Overview:
Set the otherconfig field of the given PBD.
Signature:
void set_other_config (session ref session_ref, PBD ref self, (string -> string) map value)
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)
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