|
| 1 | +--- |
| 2 | +meta: |
| 3 | + title: &title Increasing the size of Block Storage volumes via the Scaleway API |
| 4 | + description: &desc This page explains how to increase the size of a Block Storage volume using the Scaleway API. |
| 5 | +content: |
| 6 | + h1: *title |
| 7 | + paragraph: *desc |
| 8 | +tags: increase expand increment raise storage volume block |
| 9 | +dates: |
| 10 | + validation: 2025-03-04 |
| 11 | + posted: 2025-03-04 |
| 12 | +categories: |
| 13 | + - block-storage |
| 14 | + - storage |
| 15 | +--- |
| 16 | + |
| 17 | +The Block storage API allows you to interact with Block Storage volumes programmatically through API calls. Refer to the [Developers reference website](https://www.scaleway.com/en/developers/api/block/) for more information on how to use the Block Storage API. |
| 18 | + |
| 19 | +<Macro id="requirements" /> |
| 20 | + |
| 21 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 22 | +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 23 | +- A valid [API key](/iam/how-to/create-api-keys/) |
| 24 | +- A [Block Storage volume](/instances/api-cli/creating-a-volume/) |
| 25 | + |
| 26 | +1. Run the command below to list your Block Storage volumes. Do not forget to replace the `{zone}` placeholder with the desired Availability Zone (`fr-par-1`, `nl-ams-2`, etc.): |
| 27 | + ``` |
| 28 | + curl -X GET \ |
| 29 | + -H "X-Auth-Token: $SCW_SECRET_KEY" \ |
| 30 | + "https://api.scaleway.com/block/v1alpha1/zones/{zone}/volumes" |
| 31 | + ``` |
| 32 | + |
| 33 | + An output similar to the following displays: |
| 34 | + |
| 35 | + ``` |
| 36 | + {"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>"}} |
| 37 | + ``` |
| 38 | + |
| 39 | +2. To modify the volume size, run the request below. Do not forget to replace the placeholders with the appropriate value: |
| 40 | + ``` |
| 41 | + curl -X PATCH \ |
| 42 | + -H "X-Auth-Token: $SCW_SECRET_KEY" \ |
| 43 | + -H "Content-Type: application/json" \ |
| 44 | + -d '{"size" : "{size_in_bytes}"}' \ |
| 45 | + "https://api.scaleway.com/block/v1alpha1/zones/{zone}/volumes/{volume_id}" |
| 46 | + ``` |
| 47 | + <Message type="note"> |
| 48 | + You can only increase the size of a Block Storage volume. Reducing its size is not permitted due to technical constraints. |
| 49 | + </Message> |
| 50 | + An output similar to the following displays: |
| 51 | + ``` |
| 52 | + {"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"}} |
| 53 | + ``` |
| 54 | + |
| 55 | +The size of your volume has been updated. |
0 commit comments