Extend volume size

Overview

Extends the size of a volume to a requested size, in gibibytes (GiB). Specify the os-extend action in the request body.

Classification

  • Extend

API Operation Object

  • action

Synchronous / Asynchronous

  • asynchronous

Request

HTTP Request Method

  • POST

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/volumes/{volume_id}/action

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress(optional)
Accept: application/json
X-Auth-Token: <token_id>
Content-Type: application/json

HTTP Request Body

Format

{
    "os-extend": {
        "new_size": <new_size>
    }
}

Request Parameter

Request Parameters

name

style

format

description

required/optional

tenant_id

URI

UUID

The UUID of the tenant in a multi-tenancy cloud.

required

volume_id

URI

UUID

The unique identifier of an existing volume.

required

os-extend

plain

dict

The os-extend action.

required

new_size

plain

int

The new size of the volume, in gibibytes (GiB).

required

Response

HTTP Response Header

Format

HTTP/1.1 <response code> <message>       (ex. 202 Accepted)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "X-Openstack-Request-Id", "Content-Length", "Date"

Response Code

Response Codes

response code

condition

202

normal end

400

badRequest

403

forbidden

413

overLimit

HTTP Response Body

Format

  • none

Response Parameter

Response Parameters

item

format

description

none

-

-

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{tenant_id}/volumes/{volume_id}/action

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02
Content-Type: application/json

Request Body

{
    "os-extend": {
        "new_size": 40
    }
}

Sample API Response

Response Header

HTTP/1.1 202 Accepted
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "X-Openstack-Request-Id", "Content-Length", "Date"

Response Body

  • none

Execution Example

HTTP Request

POST /v2/448de3c2cc6c4450a238e7ea989c6a68/volumes/8e59d1db-29ee-4898-88ad-5bd6686cdcda/action HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8776
X-Auth-Token: 517486dbd39a44088fdc5b3dfcfdb831
Content-type: application/json
Accept: application/json

{"os-extend": {"new_size": 40}}

HTTP Response

HTTP/1.1 202 Accepted
Date: Mon, 23 May 2016 04:58:51 GMT
X-Openstack-Request-Id: req-8cb3d7bc-813e-4487-b37f-0e996f22b35d
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8

Error Execution Example

HTTP Request

POST /v2/448de3c2cc6c4450a238e7ea989c6a68/volumes/ca64c2b7-d4a1-4b94-a5b4-2acbc9948102/action HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8776
X-Auth-Token: 517486dbd39a44088fdc5b3dfcfdb831
Content-type: application/json
Accept: application/json

{"os-extend": {"new_size": 40}}

HTTP Response

HTTP/1.1 400 Bad Request
Date: Mon, 23 May 2016 05:00:06 GMT
X-Compute-Request-Id: req-22c8a5e7-41ec-439b-b115-227b59974781
X-Openstack-Request-Id: req-22c8a5e7-41ec-439b-b115-227b59974781
Content-Length: 102
Connection: close
Content-Type: application/json; charset=UTF-8

{"badRequest": {"message": "Invalid volume: Volume status must be available to extend.", "code": 400}}