Snapshots have been migrated to the Block Storage API. The previous command scw instance snapshot create
is now deprecated and no longer functions.
Managing Instance snapshots with the CLI (v2)
You can use the Scaleway CLI to create, export, and import snapshots of your Instances. A snapshot is a QCOW2 image of your Instance’s volumes, stored in a Scaleway Object Storage bucket. It can be imported into any Availability Zone, as long as it is in the same region as the bucket in which it is hosted.
Before you startLink to this anchor
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
- An SSH key
- A valid API key
- Downloaded and installed the Scaleway CLI v2
Creating a snapshot using the CLILink to this anchor
To create a snapshot from a volume using the CLI, run the following command:
scw block snapshot create [arg=value ...]
The following arguments and flags are available to customize your command:
ARGS:[volume-id] UUID of the volume to snapshot[name=<generated>] 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[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (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)FLAGS:-h, --help help for create-w, --wait wait until the snapshot is readyGLOBAL FLAGS:-c, --config string The path to the config file-D, --debug Enable debug mode-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")-p, --profile string The config profile to use
Creating a snapshot in the default zone from the given volume IDLink to this anchor
To create a snapshot in the default zone from the given volume ID, run the following command. Remember to replace 11111111-1111-1111-1111-111111111111
with the actual ID of your volume.
scw block snapshot create volume-id=11111111-1111-1111-1111-111111111111
Creating a snapshot in a specific zone from the given volume IDLink to this anchor
To create a snapshot in a specific zone (e.g. fr-par-1
) from the given volume ID, run the following command. Remember to replace 11111111-1111-1111-1111-111111111111
with the actual ID of your volume.
scw block snapshot create zone=fr-par-1 volume-id=11111111-1111-1111-1111-111111111111
Creating a named snapshot in the default zone from a given volume IDLink to this anchor
Run the following command to create a named snapshot from the given volume ID. Remember to replace 11111111-1111-1111-1111-111111111111
with the actual ID of your volume.
scw block snapshot create name=foobar volume-id=11111111-1111-1111-1111-111111111111
Exporting a QCOW file to an Object Storage bucket from an Instance snapshotLink to this anchor
Run the following command to export an Instance snapshot as a QCOW2 file to an existing Object Storage bucket in the same geographical region as the snapshot.
scw block snapshot export-to-object-storage zone=fr-par-1 snapshot-id=11111111-1111-1111-1111-111111111111 bucket=<my-bucket> key=<my-qcow2-file-name.qcow2>
Importing a QCOW file from an Object Storage bucket as Instance snapshotLink to this anchor
Run the following command to import a QCOW file as an Instance snapshot. Replace the snapshot name my-imported-snapshot
with the name of the snapshot to create, the bucket name my-bucket
with the name of your Object Storage bucket and the file name my-qcow2-file-name.qcow2
with the name of your QCOW file.
Specify the size of the imoported snapshot with the size=10GB
flag.
scw block snapshot import-from-object-storage zone=fr-par-1 name=<my-imported-snapshot> bucket=<my-bucket> key=<my-qcow2-file-name.qcow2> size=10GB
When importing existing QCOW / QCOW2 files from Object Storage as Instance snapshots, make sure that the file has the suffix .qcow
or .qcow2
.