Class: SR

Last published : Oct 01, 2026
A storage repository

Fields for class: SR

Field Type Qualifier Description
allowed_operations storage_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.
blobs (string -> blob ref) map RO/runtime Binary blobs associated with this SR
clustered bool RO/runtime True if the SR is using aggregated local storage
content_type string RO/constructor the type of the SR's content, if required (for example, ISOs)
current_operations (string -> storage_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.
introduced_by DR_task ref RO/runtime The disaster recovery task which introduced this SR
is_tools_sr bool RO/runtime True if this is the SR that contains the Tools ISO VDIs
local_cache_enabled bool RO/runtime True if this SR is assigned to be the local cache for its host
name_description string RO/constructor a notes field containing human-readable description
name_label string RO/constructor a human-readable name
other_config (string -> string) map RW additional configuration
PBDs PBD ref set RO/runtime describes how particular hosts can see this storage repository
physical_size int RO/constructor total physical size of the repository (in bytes)
physical_utilisation int RO/runtime physical space currently utilised on this storage repository (in bytes). Note that for sparse disk formats, physical_utilisation may be less than virtual_allocation
shared bool RO/runtime true if this SR is (capable of being) shared between multiple hosts
sm_config (string -> string) map RW SM dependent data
tags string set RW user-specified tags for categorization purposes
type string RO/constructor type of the storage repository
uuid string RO/runtime Unique identifier/object reference
VDIs VDI ref set RO/runtime all virtual disks known to this storage repository
virtual_allocation int RO/runtime sum of virtual_sizes of all VDIs in this storage repository (in bytes)

RPCs associated with class: SR

RPC name: addtags

Overview:
Add the given value to the tags field of the given SR. If the value is already in that Set, then do nothing.
Signature:
void add_tags (session ref session_ref, SR ref self, string value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
string value New value to add
Minimum Role: vm-operator
Return Type: void

RPC name: addtootherconfig

Overview:
Add the given keyvalue pair to the otherconfig field of the given SR.
Signature:
void add_to_other_config (session ref session_ref, SR ref self, string key, string value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR 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: addtosmconfig

Overview:
Add the given keyvalue pair to the smconfig field of the given SR.
Signature:
void add_to_sm_config (session ref session_ref, SR ref self, string key, string value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR 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: assertcanhosthastatefile

Overview:
Returns successfully if the given SR can host an HA statefile. Otherwise returns an error to explain why not
Signature:
void assert_can_host_ha_statefile (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to query
Minimum Role: pool-operator
Return Type: void

RPC name: assertsupportsdatabasereplication

Overview:
Returns successfully if the given SR supports database replication. Otherwise returns an error to explain why not.
Signature:
void assert_supports_database_replication (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to query
Minimum Role: pool-operator
Return Type: void

RPC name: create

Overview:
Create a new Storage Repository and introduce it into the managed system, creating both SR record and PBD record to attach it to current host with specified deviceconfig parameters
Signature:
SR ref create (session ref session_ref, host ref host, (string -> string) map device_config, int physical_size, string name_label, string name_description, string type, string content_type, bool shared, (string -> string) map sm_config)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
host ref host The host to create/make the SR on
(string -> string) map device_config The device config string that will be passed to backend SR driver
int physical_size The physical size of the new storage repository
string name_label The name of the new storage repository
string name_description The description of the new storage repository
string type The type of the SR; used to specify the SR backend driver to use
string content_type The type of the new SRs content, if required (for example, ISOs)
bool shared True if the SR (is capable of) being shared by multiple hosts
(string -> string) map sm_config Storage backend specific configuration options
Minimum Role: pool-operator
Return Type: SR ref
The reference of the newly created Storage Repository.
Possible Error Codes: SR_UNKNOWN_DRIVER

RPC name: createnewblob

Overview:
Create a placeholder for a named binary blob of data that is associated with this SR
Signature:
blob ref create_new_blob (session ref session_ref, SR ref sr, string name, string mime_type, bool public)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
string name The name associated with the blob
string mime_type The mime type for the data. Empty string translates to application/octet-stream
bool public True if the blob should be publicly available
Minimum Role: pool-operator
Return Type: blob ref
The reference of the blob, needed for populating its data

RPC name: destroy

Overview:
Destroy specified SR, removing SRrecord from database and remove SR from disk. In order to affect this operation the appropriate deviceconfig is read from the specified SR's PBD on current host
Signature:
void destroy (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to destroy
Minimum Role: pool-operator
Return Type: void
Possible Error Codes: SR_HAS_PBD

RPC name: disabledatabasereplication

Overview:
Signature:
void disable_database_replication (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to which metadata should be no longer replicated
Minimum Role: pool-operator
Return Type: void

RPC name: enabledatabasereplication

Overview:
Signature:
void enable_database_replication (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to which metadata should be replicated
Minimum Role: pool-operator
Return Type: void

RPC name: forget

Overview:
Removing specified SRrecord from database, without attempting to remove SR from disk
Signature:
void forget (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to destroy
Minimum Role: pool-operator
Return Type: void
Possible Error Codes: SR_HAS_PBD

RPC name: forgetdatasourcearchives

Overview:
Forget the recorded statistics related to the specified data source
Signature:
void forget_data_source_archives (session ref session_ref, SR ref sr, string data_source)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
string data_source The data source whose archives are to be forgotten
Minimum Role: pool-operator
Return Type: void

RPC name: getall

Overview:
Return a list of all the SRs known to the system.
Signature:
SR 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: SR ref set
references to all objects

RPC name: getallrecords

Overview:
Return a map of SR references to SR records for all SRs known to the system.
Signature:
(SR ref -> SR 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: (SR ref -> SR record) map
records of all objects

RPC name: getallowedoperations

Overview:
Get the allowedoperations field of the given SR.
Signature:
storage_operations set get_allowed_operations (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: storage_operations set
value of the field

RPC name: getblobs

Overview:
Get the blobs field of the given SR.
Signature:
(string -> blob ref) map get_blobs (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: (string -> blob ref) map
value of the field

RPC name: getbynamelabel

Overview:
Get all the SR instances with the given label.
Signature:
SR ref set get_by_name_label (session ref session_ref, string label)
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: SR ref set
references to objects with matching names

RPC name: getbyuuid

Overview:
Get a reference to the SR instance with the specified UUID.
Signature:
SR 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: SR ref
reference to the object

RPC name: getclustered

Overview:
Get the clustered field of the given SR.
Signature:
bool get_clustered (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: bool
value of the field

RPC name: getcontenttype

Overview:
Get the contenttype field of the given SR.
Signature:
string get_content_type (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: getcurrentoperations

Overview:
Get the currentoperations field of the given SR.
Signature:
(string -> storage_operations) map get_current_operations (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: (string -> storage_operations) map
value of the field

RPC name: getdatasources

Overview:
Signature:
data_source record set get_data_sources (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to interrogate
Minimum Role: read-only
Return Type: data_source record set
A set of data sources

RPC name: getintroducedby

Overview:
Get the introducedby field of the given SR.
Signature:
DR_task ref get_introduced_by (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: DR_task ref
value of the field

RPC name: getistoolssr

Overview:
Get the istoolssr field of the given SR.
Signature:
bool get_is_tools_sr (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: bool
value of the field

RPC name: getlocalcacheenabled

Overview:
Get the localcacheenabled field of the given SR.
Signature:
bool get_local_cache_enabled (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: bool
value of the field

RPC name: getnamedescription

Overview:
Get the name/description field of the given SR.
Signature:
string get_name_description (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: getnamelabel

Overview:
Get the name/label field of the given SR.
Signature:
string get_name_label (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: getotherconfig

Overview:
Get the otherconfig field of the given SR.
Signature:
(string -> string) map get_other_config (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: (string -> string) map
value of the field

RPC name: getPBDs

Overview:
Get the PBDs field of the given SR.
Signature:
PBD ref set get_PBDs (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: PBD ref set
value of the field

RPC name: getphysicalsize

Overview:
Get the physicalsize field of the given SR.
Signature:
int get_physical_size (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: int
value of the field

RPC name: getphysicalutilisation

Overview:
Get the physicalutilisation field of the given SR.
Signature:
int get_physical_utilisation (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: int
value of the field

RPC name: getrecord

Overview:
Get a record containing the current state of the given SR.
Signature:
SR record get_record (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: SR record
all fields from the object

RPC name: getshared

Overview:
Get the shared field of the given SR.
Signature:
bool get_shared (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: bool
value of the field

RPC name: getsmconfig

Overview:
Get the smconfig field of the given SR.
Signature:
(string -> string) map get_sm_config (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: (string -> string) map
value of the field

RPC name: getsupportedtypes

Overview:
Return a set of all the SR types supported by the system
Signature:
string set get_supported_types (session ref session_ref)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
Minimum Role: read-only
Return Type: string set
the supported SR types

RPC name: gettags

Overview:
Get the tags field of the given SR.
Signature:
string set get_tags (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: string set
value of the field

RPC name: gettype

Overview:
Get the type field of the given SR.
Signature:
string get_type (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: getuuid

Overview:
Get the uuid field of the given SR.
Signature:
string get_uuid (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: string
value of the field

RPC name: getVDIs

Overview:
Get the VDIs field of the given SR.
Signature:
VDI ref set get_VDIs (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: VDI ref set
value of the field

RPC name: getvirtualallocation

Overview:
Get the virtualallocation field of the given SR.
Signature:
int get_virtual_allocation (session ref session_ref, SR ref self)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
Minimum Role: read-only
Return Type: int
value of the field

RPC name: introduce

Overview:
Introduce a new Storage Repository into the managed system
Signature:
SR ref introduce (session ref session_ref, string uuid, string name_label, string name_description, string type, string content_type, bool shared, (string -> string) map sm_config)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
string uuid The uuid assigned to the introduced SR
string name_label The name of the new storage repository
string name_description The description of the new storage repository
string type The type of the SR; used to specify the SR backend driver to use
string content_type The type of the new SRs content, if required (for example, ISOs)
bool shared True if the SR (is capable of) being shared by multiple hosts
(string -> string) map sm_config Storage backend specific configuration options
Minimum Role: pool-operator
Return Type: SR ref
The reference of the newly introduced Storage Repository.

RPC name: make

This message is deprecated.
Overview:
Create a new Storage Repository on disk. This call is deprecated: use SR.create instead.
Signature:
string make (session ref session_ref, host ref host, (string -> string) map device_config, int physical_size, string name_label, string name_description, string type, string content_type, (string -> string) map sm_config)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
host ref host The host to create/make the SR on
(string -> string) map device_config The device config string that will be passed to backend SR driver
int physical_size The physical size of the new storage repository
string name_label The name of the new storage repository
string name_description The description of the new storage repository
string type The type of the SR; used to specify the SR backend driver to use
string content_type The type of the new SRs content, if required (for example, ISOs)
(string -> string) map sm_config Storage backend specific configuration options
Minimum Role: pool-operator
Return Type: string
The uuid of the newly created Storage Repository.

RPC name: probe

Overview:
Perform a backendspecific scan, using the given deviceconfig. If the deviceconfig is complete, then this will return a list of the SRs present of this type on the device, if any. If the deviceconfig is partial, then a backendspecific scan will be performed, returning results that will guide the user in improving the deviceconfig.
Signature:
string probe (session ref session_ref, host ref host, (string -> string) map device_config, string type, (string -> string) map sm_config)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
host ref host The host to create/make the SR on
(string -> string) map device_config The device config string that will be passed to backend SR driver
string type The type of the SR; used to specify the SR backend driver to use
(string -> string) map sm_config Storage backend specific configuration options
Minimum Role: pool-operator
Return Type: string
An XML fragment containing the scan results. These are specific to the scan being performed, and the backend.

RPC name: probeext

Overview:
Perform a backendspecific scan, using the given deviceconfig. If the deviceconfig is complete, then this will return a list of the SRs present of this type on the device, if any. If the deviceconfig is partial, then a backendspecific scan will be performed, returning results that will guide the user in improving the deviceconfig.
Signature:
probe_result record set probe_ext (session ref session_ref, host ref host, (string -> string) map device_config, string type, (string -> string) map sm_config)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
host ref host The host to create/make the SR on
(string -> string) map device_config The device config string that will be passed to backend SR driver
string type The type of the SR; used to specify the SR backend driver to use
(string -> string) map sm_config Storage backend specific configuration options
Minimum Role: pool-operator
Return Type: probe_result record set
A set of records containing the scan results.

RPC name: querydatasource

Overview:
Query the latest value of the specified data source
Signature:
float query_data_source (session ref session_ref, SR ref sr, string data_source)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
string data_source The data source to query
Minimum Role: read-only
Return Type: float
The latest value, averaged over the last 5 seconds

RPC name: recorddatasource

Overview:
Start recording the specified data source
Signature:
void record_data_source (session ref session_ref, SR ref sr, string data_source)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
string data_source The data source to record
Minimum Role: pool-operator
Return Type: void

RPC name: removefromotherconfig

Overview:
Remove the given key and its corresponding value from the otherconfig field of the given SR. If the key is not in that Map, then do nothing.
Signature:
void remove_from_other_config (session ref session_ref, SR ref self, string key)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
string key Key to remove
Minimum Role: pool-operator
Return Type: void

RPC name: removefromsmconfig

Overview:
Remove the given key and its corresponding value from the smconfig field of the given SR. If the key is not in that Map, then do nothing.
Signature:
void remove_from_sm_config (session ref session_ref, SR ref self, string key)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
string key Key to remove
Minimum Role: pool-operator
Return Type: void

RPC name: removetags

Overview:
Remove the given value from the tags field of the given SR. If the value is not in that Set, then do nothing.
Signature:
void remove_tags (session ref session_ref, SR ref self, string value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
string value Value to remove
Minimum Role: vm-operator
Return Type: void

RPC name: scan

Overview:
Refreshes the list of VDIs associated with an SR
Signature:
void scan (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR to scan
Minimum Role: vm-power-admin
Return Type: void

RPC name: setnamedescription

Overview:
Set the name description of the SR
Signature:
void set_name_description (session ref session_ref, SR ref sr, string value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
string value The name description for the SR
Minimum Role: pool-operator
Return Type: void

RPC name: setnamelabel

Overview:
Set the name label of the SR
Signature:
void set_name_label (session ref session_ref, SR ref sr, string value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
string value The name label for the SR
Minimum Role: pool-operator
Return Type: void

RPC name: setotherconfig

Overview:
Set the otherconfig field of the given SR.
Signature:
void set_other_config (session ref session_ref, SR ref self, (string -> string) map value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
(string -> string) map value New value to set
Minimum Role: pool-operator
Return Type: void

RPC name: setphysicalsize

Overview:
Sets the SR's physicalsize field
Signature:
void set_physical_size (session ref session_ref, SR ref self, int value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self The SR to modify
int value The new value of the SR's physical_size
Minimum Role: pool-operator
Return Type: void

RPC name: setshared

Overview:
Sets the shared flag on the SR
Signature:
void set_shared (session ref session_ref, SR ref sr, bool value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR
bool value True if the SR is shared
Minimum Role: pool-operator
Return Type: void

RPC name: setsmconfig

Overview:
Set the smconfig field of the given SR.
Signature:
void set_sm_config (session ref session_ref, SR ref self, (string -> string) map value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
(string -> string) map value New value to set
Minimum Role: pool-operator
Return Type: void

RPC name: settags

Overview:
Set the tags field of the given SR.
Signature:
void set_tags (session ref session_ref, SR ref self, string set value)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref self reference to the object
string set value New value to set
Minimum Role: vm-operator
Return Type: void

RPC name: update

Overview:
Refresh the fields on the SR object
Signature:
void update (session ref session_ref, SR ref sr)
Arguments:
Type Name Description
session ref session_ref Reference to a valid session
SR ref sr The SR whose fields should be refreshed
Minimum Role: pool-operator
Return Type: void