Increasing Block Storage volumes via the Instance API
The Instances API allows you to interact with Block Storage volumes programmatically through API calls. To increase the size of a volume using the Block Storage API, refer to the dedicated documentation.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A valid API key
- A Block Storage volume attached to an Instance
-
Inspect the volume and verify its name, size, and if the type is
b_ssd
by running the following request.curl -q -H "X-Auth-Token: $SCW_SECRET_KEY" -X GET https://api.scaleway.com/instance/v1/zones/<REGION>/volumes/<VOLUME_ID>
The following response should appear as an output:
{"volume": {"creation_date": "2020-06-02T08:04:50.094118+00:00", "server": null, "id": "<VOLUME_ID>", "size": 25000000000, "name": "myAwesomeVolume", "zone": "<REGION>", "export_uri": null, "volume_type": "b_ssd", "modification_date": "2020-06-02T08:04:50.094118+00:00", "state": "available", "organization": "<ORGANIZATION_ID>"}}
-
To modify the volume size, run the request below:
curl https://api.scaleway.com/instance/v1/zones/REGION/volumes/VOLUME_ID -H "X-Auth-Token: $SCW_SECRET_KEY" -X PATCH -H 'Content-Type: application/json;charset=utf-8' --data '{ "name":"new_name", "size":26000000000 }'
Replace REGION
and VOLUME_ID
following the guidelines mentioned previously and replace the existing size value with the new one.
A response appears confirming the changes:
{"volume": {"creation_date": "2020-06-02T08:04:50.094118+00:00", "server": null, "id": "VOLUME_ID", "size": 26000000000, "name": "new_name", "zone": "REGION", "export_uri": null, "volume_type": "b_ssd", "modification_date": "2020-06-02T08:08:27.385208+00:00", "state": "resizing", "organization": "ORGANIZATION_ID"}}
Still need help?Create a support ticket