Scaleway logo
Commands

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:

TerminalCode
scw block snapshot create <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volume to snapshotRequired
nameName of the snapshotDefault: <generated>
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}List of tags assigned to the snapshot
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot delete <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot export-to-object-storage [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
bucketScaleway Object Storage bucket where the object is stored
keyThe object key inside the given bucket
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot get <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot import-from-object-storage [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
bucketScaleway Object Storage bucket where the object is stored
keyThe object key inside the given bucket
nameName of the snapshot
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}List of tags assigned to the snapshot
sizeSize of the snapshot
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byCriteria to use when ordering the listOne of: created_at_asc, created_at_desc, name_asc, name_desc
project-idFilter by Project ID
volume-idFilter snapshots by the ID of the original volume
nameFilter snapshots by their names
tags.{index}Filter by tags. Only snapshots with one or more matching tags will be returned
organization-idFilter by Organization ID
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot update <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
nameWhen defined, is the name of the snapshot
tags.{index}List of tags assigned to the snapshot
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block snapshot wait <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
timeoutTimeout of the waitDefault: 5m0s
snapshot-idID of the snapshot affected by the action.Required
terminal-statusExpected terminal status, will wait until this status is reached.One of: unknown_status, creating, available, error, deleting, deleted, in_use, locked, exporting
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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

TerminalCode
scw block snapshot wait 11111111-1111-1111-1111-111111111111 terminal-status=available

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:

TerminalCode
scw block volume create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameName of the volumeRequired
Default: <generated>
perf-iopsThe maximum IO/s expected, according to the different options available in stock (`500015000`)
project-idProject ID to use. If none is passed the default project ID will be used
from-empty.sizeVolume size in bytes, with a granularity of 1 GB (10^9 bytes)
from-snapshot.sizeVolume size in bytes, with a granularity of 1 GB (10^9 bytes)
from-snapshot.snapshot-idSource snapshot from which volume will be created
tags.{index}List of tags assigned to the volume
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block volume delete <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volumeRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block volume get <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volumeRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block volume list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
order-byCriteria to use when ordering the listOne of: created_at_asc, created_at_desc, name_asc, name_desc
project-idFilter by Project ID
nameFilter the return volumes by their names
product-resource-idFilter 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-idFilter by Organization ID
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block volume update <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volumeRequired
nameWhen defined, is the new name of the volume
sizeOptional 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-iopsThe maximum IO/s expected, according to the different options available in stock (`500015000`)
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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:

TerminalCode
scw block volume wait <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
timeoutTimeout of the waitDefault: 5m0s
volume-idID of the volume affected by the action.Required
terminal-statusExpected terminal status, will wait until this status is reached.One of: unknown_status, creating, available, in_use, deleting, deleted, resizing, error, snapshotting, locked, updating
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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

TerminalCode
scw block volume wait 11111111-1111-1111-1111-111111111111 terminal-status=available

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:

TerminalCode
scw block volume-type list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One 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