Documentation for `scw block`
The CLI documentation pages are currently under construction
The content is up to date. We're making improvements to the site over the next few weeks for a better experience.
This API allows you to manage your Block Storage volumes.
A Block Storage snapshot is a read-only picture of a Block volume, taken at a specific time
You can then revert your data to the previous snapshot. You can also create a new read/write Block volume from a previous snapshot.
Create a snapshot of a volume
To create a snapshot, the volume must be in the in_use or the available status.
If your volume is in a transient state, you need to wait until the end of the current operation.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| volume-id | UUID of the volume to snapshot | Required |
| name | Name of the snapshot | Default: <generated> |
| project-id | Project ID to use. If none is passed the default project ID will be used | |
| tags.{index} | List of tags assigned to the snapshot | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Delete a snapshot
You must specify the snapshot_id of the snapshot you want to delete. The snapshot must not be in use.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Export a snapshot to a Scaleway Object Storage bucket
The snapshot is exported in QCOW2 format. The snapshot must not be in transient state.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| bucket | Scaleway Object Storage bucket where the object is stored | |
| key | The object key inside the given bucket | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Get a snapshot
Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Import a snapshot from a Scaleway Object Storage bucket
The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| bucket | Scaleway Object Storage bucket where the object is stored | |
| key | The object key inside the given bucket | |
| name | Name of the snapshot | |
| project-id | Project ID to use. If none is passed the default project ID will be used | |
| tags.{index} | List of tags assigned to the snapshot | |
| size | Size of the snapshot | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
List all snapshots
List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the order_by field.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | Criteria to use when ordering the list | One of: created_at_asc, created_at_desc, name_asc, name_desc |
| project-id | Filter by Project ID | |
| volume-id | Filter snapshots by the ID of the original volume | |
| name | Filter snapshots by their names | |
| tags.{index} | Filter by tags. Only snapshots with one or more matching tags will be returned | |
| organization-id | Filter by Organization ID | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all |
Update a snapshot
Update the name or tags of the snapshot.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| snapshot-id | UUID of the snapshot | Required |
| name | When defined, is the name of the snapshot | |
| tags.{index} | List of tags assigned to the snapshot | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Wait for snapshot to reach a stable state
Wait for snapshot to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the snapshot.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| timeout | Timeout of the wait | Default: 5m0s |
| snapshot-id | ID of the snapshot affected by the action. | Required |
| terminal-status | Expected terminal status, will wait until this status is reached. | One of: unknown_status, creating, available, error, deleting, deleted, in_use, locked, exporting |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1 |
Examples:
Wait for a snapshot to be available
Code
A Block Storage volume is a logical storage drive on a network-connected storage system. It is exposed to Instances as if it were a physical disk, and can be attached and detached like a hard drive. Several Block volumes can be attached to one Instance at a time
Block volumes can be snapshotted, mounted or unmounted.
Create a volume
To create a new volume from scratch, you must specify from_empty and the size.
To create a volume from an existing snapshot, specify from_snapshot and the snapshot_id in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| name | Name of the volume | Required Default: <generated> |
| perf-iops | The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`) |
| project-id | Project ID to use. If none is passed the default project ID will be used | |
| from-empty.size | Volume size in bytes, with a granularity of 1 GB (10^9 bytes) | |
| from-snapshot.size | Volume size in bytes, with a granularity of 1 GB (10^9 bytes) | |
| from-snapshot.snapshot-id | Source snapshot from which volume will be created | |
| tags.{index} | List of tags assigned to the volume | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Delete a detached volume
You must specify the volume_id of the volume you want to delete. The volume must not be in the in_use status.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| volume-id | UUID of the volume | Required |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Get a volume
Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| volume-id | UUID of the volume | Required |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
List volumes
List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the order_by field.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| order-by | Criteria to use when ordering the list | One of: created_at_asc, created_at_desc, name_asc, name_desc |
| project-id | Filter by Project ID | |
| name | Filter the return volumes by their names | |
| product-resource-id | Filter by a product resource ID linked to this volume (such as an Instance ID) | |
| tags.{index} | Filter by tags. Only volumes with one or more matching tags will be returned | |
| organization-id | Filter by Organization ID | |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all |
Update a volume
Update the technical details of a volume, such as its name, tags, or its new size and volume_type (within the same Block Storage class).
You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| volume-id | UUID of the volume | Required |
| name | When defined, is the new name of the volume | |
| size | Optional field for increasing the size of a volume (size must be equal or larger than the current one) | |
| tags.{index} | List of tags assigned to the volume | |
| perf-iops | The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`) |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3 |
Wait for volume to reach a stable state
Wait for volume to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the volume.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| timeout | Timeout of the wait | Default: 5m0s |
| volume-id | ID of the volume affected by the action. | Required |
| terminal-status | Expected terminal status, will wait until this status is reached. | One of: unknown_status, creating, available, in_use, deleting, deleted, resizing, error, snapshotting, locked, updating |
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1 |
Examples:
Wait for a volume to be available
Code
Block Storage volume types are determined by their storage class and their IOPS. There are two storage classes available: bssd and sbs. The IOPS can be chosen for volumes of the sbs storage class
Block Storage volume types are determined by their storage class and their IOPS. There are two storage classes available: bssd and sbs. The IOPS can be chosen for volumes of the sbs storage class.
List volume types
List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order.
Usage:
Code
Arguments:
| Name | Description | Argument Specifications |
|---|---|---|
| zone | Zone to target. If none is passed will use default zone from the config | Default: fr-par-1One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, all |