VolumesResource


Create a volume in a generic iscsi pool


Import an existing volume into a Generic iSCSI pool.
Instead of providing a link to the Tier where the volume will be created, the direct link to the iSCSI Storage pool must be provided.

POST https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes

Roles : [ROLE_VDC_MANAGE_STORAGE]

Content-Type : iscsivolume Accept : iscsivolume

Error Codes

  • DEVICE-0 - The requested device does not exist
  • SP-13 - Missing storage pool link
  • SP-14 - Access to this tier is restricted for your enterprise
  • SP-3 - The requested storage pool does not exist
  • VOL-43 - The pool must be iSCSI when creating generic iSCSI volumes
  • VOL-44 - There is already a volume with that internal name
  • VOL-45 - The internal name of the volume is required
  • VOL-9 - The connection field of the volume is required

Example

Create a volume in a virtual datacenter


Create a volume in a virtual datacenter.
The tier must be specified as a link in the request body.

POST https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes

Roles : [ROLE_VDC_MANAGE_STORAGE]

Content-Type : volume Accept : volume

Error Codes

  • GEN-24 - The requested disk controller is not supported by the hypervisor plugin
  • TIER-0 - The requested storage tier does not exist
  • TIER-2 - Missing link to storage tier
  • TIER-3 - Missing storage tier parameter
  • TIER-9 - The virtual datacenter link of the storage tier does not match the virtual datacenter supplied
  • VDC-0 - The requested virtual datacenter does not exist
  • VOL-0 - Could not create the volume in the selected tier
  • VOL-1 - There are not enough resources in the selected tier to create the volume
  • VOL-2 - The name of the volume is required

Example

List volumes in a virtual datacenter


Retrieve the volumes in a virtual datacenter

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VAPP_CREATE_STATEFUL]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String id How to order the search. Available values are: \{NAME, VIRTUALDATACENTER, VIRTUALAPPLIANCE, VIRUTALMACHINE, TIER, TOTALSIZE, USEDSIZE, AVAILABLESIZE\}
has String If present filter to apply in the search.
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
available Boolean false If true, only return available volumes, not attached to any virtual machine
persistent Boolean true If false, do not return volumes used in persistent virtual machine templates

Accept : volumes

Error Codes

  • VDC-0 - The requested virtual datacenter does not exist

Example

List volumes including virtual machine in a virtual datacenter


Retrieve volumes in a virtual datacenter, including the representation of the virtual machine, virtual appliance and virtual datacenter, if the volume is attached to a virtual machine

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VAPP_CREATE_STATEFUL]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String id How to order the search. Available values are: \{NAME, VIRTUALDATACENTER, VIRTUALAPPLIANCE, VIRUTALMACHINE, TIER, TOTALSIZE, USEDSIZE, AVAILABLESIZE\}
has String How to filter the search. It can be filtered by: Volume name, Virtual Datacenter name, Virtual Appliance name, Virtual Machine name, Tier name, Total size
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
persistent Boolean true If false, do not return volumes used in persistent virtual machine templates

Example

List persistent volume candidates in a virtual datacenter


Get volumes of the given virtual datacenter that can be used to hold a persistent template.
This method will be called when generating a persistent template that will reside on a GENERIC volume.Since cannot create volumes in the target device, a volume must be selected to be used as the volume in a persistent virtual machine template.

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/action/statefulcandidates

Roles : [ROLE_VAPP_CREATE_STATEFUL]

Accept : volumes

Error Codes

  • VDC-0 - The requested virtual datacenter does not exist

Example

Delete a volume from a virtual datacenter


Remove a volume from a virtual datacenter

DELETE https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_STORAGE, ROLE_VDC_MANAGE_STORAGE, ROLE_VAPP_CREATE_STATEFUL]

Example

Get a volume in a virtual datacenter


Retrieve a volume with links to associated resources

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_VAPP_CREATE_STATEFUL]

Accept : volume

Error Codes

  • VOL-3 - The volume does not exist

Example

Get a volume including virtual machine in a virtual datacenter


Retrieve a volume in a virtual datacenter, including the representation of the virtual machine, virtual appliance and virtual datacenter, if the volume is attached to a virtual machine

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_VAPP_CREATE_STATEFUL]

Example

Update a volume in a virtual datacenter


Update a volume.
When changing the size, you can only increase the size of a volume, not decrease it.

PUT https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_STORAGE, ROLE_VDC_MANAGE_STORAGE]

Content-Type : volume Accept : acceptedrequest

Error Codes

  • CONSTR-LENGTH - The property 'elementName' length must be between 1 and 255.
  • GEN-24 - The requested disk controller is not supported by the hypervisor plugin
  • SCALING-GROUP-16 - The scaling group must be in maintenance mode in order to apply the requested operation
  • VM-120 - The virtual machine is protected and cannot be used
  • VOL-1 - There are not enough resources in the selected tier to create the volume
  • VOL-10 - The size of the volume cannot be reduced
  • VOL-14 - The volume cannot be edited because it is being used in a virtual machine
  • VOL-46 - The volume cannot be resized or removed from the virtual machine if it has snapshots

Example

List initiator mappings of a volume in a virtual datacenter


Retrieve initiator mappings of a volume

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}/action/initiatormappings

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_PHYS_DC_RETRIEVE_DETAILS]

Example

Get an initiator mapping of a volume in a virtual datacenter


Retrieve an initiator mapping of a volume

GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}/action/initiatormappings/{mapping}

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_PHYS_DC_RETRIEVE_DETAILS]

Accept : initiatormapping

Example

Move a volume to another virtual datacenter


Move a volume from one virtualdatacenter to another.
Requires that both virtualdatacenters belong to the same datacenter.

POST https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}/action/move

Roles : [ROLE_VDC_MANAGE_STORAGE]

Content-Type : links Accept : moved

Error Codes

  • VDC-0 - The requested virtual datacenter does not exist
  • VOL-14 - The volume cannot be edited because it is being used in a virtual machine
  • VOL-39 - The volume can only be moved to another virtual datacenter in the same datacenter
  • VOL-41 - The volume can only be moved to another virtual datacenter in the same enterprise
  • VOL-47 - Cannot move a persistent volume, you should try to move the template