Volumes and block storage REST API

Use this REST API to manage storage volumes and block storage.

The following methods are available and you must be assigned the Workload resources administration role with permission to Manage workload resources (Full permission).
Important: These APIs are intended for use in the development of software components or script packages that use block storage or shared block storage.

Method: GET - List volume groups

Table 1. List volume groups
Resource Response
/resources/volumeGroups JSON array of volume groups, returning the following attributes.
cloudId
Integer cloud group identifier.
vdc
Cloud group UUID.
description
Volume group description.
name
Volume group name.
cloudname
Cloud group name.
uuid
Volume group UUID.
Query Parameters
cloudname
String value to filter by cloud name.

Multisystem Environment Parameters

Add the following query parameters to list storage from a peer location.
location
String value to filter by system location. location can also contain values domain and subdomain instead of the system location name.

Example Response

[
   {
      "cloudId": 3, 
      "vdc": "1baa9888-34a8-436e-907c-dda10e00fdb6",
      "description": "",
      "name": " NewGroup",
      "cloudname": "Public-31T-A",
      "uuid": "4b40dd97-745d-4ec6-bc89-717cfa3a4a8f"
   }
]

Method: GET - List block or block shared storage

Table 2. List block or block shared storage
Resource Response
/resources/sharedDisks JSON array of block or block shared storage that returns the following attributes.
name
Disk name as specified while creating a block storage.
runtimeid
UUID of storage.
lunIds
An array of LUNID of the storage if attached to a virtual machine(s); otherwise, null.
filesystem
File system provided during attachment of a storage to a virtual machine; otherwise, null.
cloudId
Integer cloud group identifier of the storage.
cloudname
Cloud group name of the storage.
volumeGroups
UUID of the volume group to which the storage belongs.
storageType
Type of block storage, either block or block_shared.
Query Parameters
type
Filter by type of block storage. Valid values are block or block_shared.
inuse
Filter by used or unused storage. If true, return storage used by virtual machines. If false, otherwise.
runtimeid
Filter by storage UUID.
aux
Include storage that are replicated. If true, include replicated storage. If false, otherwise.

Multisystem Environment Parameters

Add the following query parameters to list storage from a peer location.
location
String value to filter by system location. location can also contain values domain and subdomain instead of the system location name.
envProfile
Integer value to filter by system locations associated with the cloud groups in an environment profile. If you use both location and envProfile, only envProfile would be used.

Example Response

[
   {
      "name": " NewDisk ",
      "runtimeid":"1a3dec40-c523-4b6d-a2dc-f1647dab481e",
      "lunIds":[
      {  
      "ld": 116,
      "displayname":"GPFSServer-Main.11403112773557",
      "lunId":"1:0,60050768028503D8A000000000000431"
      }
      ] 
      "filesystem": null,
      "cloudId": 3,
      "cloudname": "Public-31T-A",
      "volumeGroups": "",
      "storageType": "block"
   }
]

Method: GET - List block or block shared storage in a format consumed by the IWD drop down or multi-select box

Table 3. List block or block shared storage in a format consumed by the IWD drop down or multi-select box
Resource Response
/resources/sharedDisks?uiformat=true JSON object that contains an array of block storage. This call returns the following attributes.
items
An array of storage that contains the name, runtimeId (UUID), lunId, filesystem, cloud group integer identifier, and cloud group name.
label
The attribute that needs to be displayed in the drop down or multi-select box.
identifer
The unique identifier associated with the displayed value in the drop down or multi-select box.
Query Parameters
type
Filter by type of block storage. Valid values are block or block_shared.
inuse
Filter by used or unused storage. If true, return storage used by virtual machines. If false, otherwise.
aux
Include storage that are replicated. If true, include replicated storage.

Multisystem Environment Parameters

Add the following query parameters to list storage from a peer location.
location
String value to filter by system location. location can also contain values domain and subdomain instead of the system location name.
envProfile
Integer value to filter by system locations associated with the cloud groups in an environment profile. If you use both location and envProfile, only location would be used.

Example Response

{
   "items": [
      {
         "name": " NewDisk ",
         "runtimeid": "1a3dec40-c523-4b6d-a2dc-f1647dab481e",
         "lunIds": [
         {
         "ld": 116,
         "displayname":"GPFSServer-Main.11403112773557",
         "lunId":"1:0,60050768028503D8A000000000000431"
         }
         ] 
         "filesystem": null,
         "cloudId": 3,
         "cloudname": "Public-31T-A"
      }
   ],
   "label": "name",
   "identifier": "runtimeid"
}

Method: GET - List block or block shared storage attached to a virtual machine

Table 4. List block or block shared storage attached to a virtual machine
Resource Response
/resources/virtualMachines/{vmId}/sharedDisks JSON array that contains an array of block storage used by a virtual machine. This call returns the following attributes.
virtualmachineid
Integer ID of a virtual machine.
lunId
LUNID of the attached storage.
runtimeid
UUID of the attached storage.
type
File system type of the attached storage.
currentstatus
Status of the attachment.
size
Disk size in MB.
mount
Disk mount point in the virtual machine.
name
Storage name.
Query Parameters
runtimeid
Filter by storage UUID.
vmunattached
If true, then return all the mount points that are not attached to a storage.

Multisystem Environment Parameters

Add the following query parameters to list storage for a virtual machine from a peer location.
location
String value to filter by system location. Must contain a specific system location.

Example Response

[
   {
      "shared": "T",
      "virtualmachineid": 488,
      "lunId": "60050768028503D30800000000000124",
      "runtimeid": "e60a2db9-f5ae-4b86-b0bc-9351d3272562",
      "type": "ext4",
      "currentstatus": "ATTACHED",
      "size": "1024",
      "id": 110,
      "mount": "/test",
      "updated": 1402080762629,
      "created": 1402080728268,
      "name": " NewDisk ",
      "diskid": "30"
   }
]

Method: GET - List block or block shared storage attached to a pattern deployment

Table 5. List block or block shared storage attached to a pattern deployment
Resource Response
/resources/sharedDisks?deploymentId=uuid JSON array that contains an array of block storage used by a pattern deployment or if uiformat query parameters are used. Returns JSON object containing an array of block storage. This call returns the following attributes.
virtualmachineid
Integer ID of a virtual machine.
lunId
LUNID of the attached storage.
runtimeid
UUID of the attached storage.
type
File system type of the attached storage.
currentstatus
Status of the attachment.
size
Disk size in MB.
mount
Disk mount point in the virtual machine.
name
Storage name.
Query Parameters
uiformat
If true, the response is formatted for display in IWD drop down and multi-select widgets.
vmunattached
If true, then include all the mount points that are not attached to a storage.

Multisystem Environment Parameters

Add the following query parameters to list storage for a virtual machine from a peer location.
location
String value to filter by system location. Must contain a specific system location.

Example Response for /resources/sharedDisks?deploymentId=<deployment_uuid>

[
   {
      "shared": "T",
      "virtualmachineid": 488,
      "lunId": "60050768028503D30800000000000124",
      "runtimeid": "e60a2db9-f5ae-4b86-b0bc-9351d3272562",
      "type": "ext4",
      "currentstatus": "ATTACHED",
      "size": "1024",
      "id": 110,
      "mount": "/test",
      "updated": 1402080762629,
      "created": 1402080728268,
      "name": "NewDisk",
      "diskid": "30"
   }
]

Example Response for /resources/sharedDisks?deploymentId=<deployment_uuid>&uiformat=true

{
   "items": [
      {
         "name": " NewDisk ",
         "runtimeid": "e60a2db9-f5ae-4b86-b0bc-9351d3272562"
      }
   ],
   "label": "name",
   "identifier": "runtimeid"
}

Method: POST - Create a block or block shared storage

Table 6. Create a block or block shared storage
Resource Request body
/resources/sharedDisks A JSON object that contains the following attributes.
name
Name of the block storage.
disksize
Block storage size in GB.
storageType
Type of block storage. Valid values are block or block_shared.
cloudgroup
UUID of the cloud group to which the storage needs to be associated with.

Multisystem Environment Parameters

Add the following query parameter to POST storage to a peer location.
location
String value to filter by system location. Must contain a specific system location.

Example Request

{
"name":"NewDisk",
"disksize":1,
"storageType":"block "
"cloudgroup":" e60a2db9-f5ae-4b86-b0bc-9351d3272562"
}
Response
JSON object that contains the create task identifier and storage identifier to monitor the create task.
taskId
Unique identifier for the create block storage task.
sharedDiskId
Unique identifier for the block storage
Example Response
{
   "taskId": 4618,
   "taskCountry": "US",
   "taskLang": "en",
   "sharedDiskId": 55,
   "storageType": "block",
   "name": "NewDisk",
   "owner": 64,
   "disksize": 1024,
   "serverName": "iwdinternal",
   "cloudgroup": "1baa9888-34a8-436e-907c-dda10e00fdb6",
   "volumeType": "block"
}

Method: GET - List block or block shared storage creation status

Table 7. List block or block shared storage creation status
Resource Response body
/resources/tasks/{taskId}/sharedDisks/{sharedDiskId}
You can get the values for the path parameters tasks and sharedDisks from the response of the POST call presented in Table 6. Use the values taskId for tasks and sharedDiskId for sharedDisks.
A JSON object that contains the block storage creation status. This call returns the following attributes.
currentstatus
Values can be ALLOCATING, ALLOCATE_FAILED, or ALLOCATED.
runtimeid
UUID of the block storage if the storage was created successfully.

Multisystem Environment Parameters

Add the following query parameter to GET task status from a peer location.
location
String value to filter by system location. Must contain a specific system location.
Example Response
{
   "currentstatus": "ALLOCATED",
   "runtimeid": "3497bf9f-3c57-444a-96e0-52f3db422aeb"
}

Method: PUT - Attach or detach a block or block shared storage to virtual machines

Table 8. Attach or detach a block or block shared storage to virtual machines
Resource Response body
/resources/sharedDisks A JSON object that contains the following attributes.
opType
Specify attach to attach storage to virtual machines or detach to detach storage from virtual machines.
mount
Optional. The intended mount point. Can be NONE if not known.
filesystem
Optional. The intended file system. Can be NONE if not known.
runtimid
UUID of the block or block shared storage.
vmIds
An array of integer IDs of virtual machines to attach the storage to. Use more than one ID only in the case of block shared storage; otherwise, the call will return a failure. If there is more than one virtual machine, they must be the same instance.

Multisystem Environment Parameters

Add the following query parameter to attach storage in a peer location with the virtual machine in a peer location. You can attach storage to a virtual machine in the same system.
location
String value to filter by system location. Must contain a specific system location.
Example Request
{
"opType": "attach", 
"mount": "NONE", 
"vmIds": [1], 
"filesystem": "NONE", 
"runtimeid": "ecc1415e-b1c2-48bb-b0e9-f1fb18abd860"
}
Response
JSON object that contains the storage attach task identifer and storage identifier to monitor the attach task.
taskId
Unique identifier for the create block storage task.
sharedDiskId
Unique identifier for the block storage
Example Response
Sample response:
{
   "taskId": 4650,
   "sharedDiskId": 49,
   "diskId": 141
}

Method: GET- List block or block shared storage attachment status

Table 9. List block or block shared storage attachment status
Resource Response body
/resources/virtualMachines/{vmId}/tasks/{taskId}sharedDisks/{sharedDiskId}
You can get the values for the path parameters tasks and sharedDisks from the response of the POST call presented in Table 8. Use the values taskId for tasks and sharedDiskId for sharedDisks.
A JSON object that contains the block storage attach status. This call returns the following attributes.
currentstatus
Values can be ATTACHING, ATTACH_FAILED, or ATTACHED.
LUNID
LUNID of the block storage if the storage was created successfully.

Multisystem Environment Parameters

Add the following query parameter to GET task status from a peer location.
location
String value to filter by system location. Must contain a specific system location.
Example Response
{
   "currentstatus": "ATTACHED",
   "lunId": "60050768028503D3080000000000018B"
}