Update content

Creating backups of Instances via the Scaleway API

Reviewed on 16 June 2023 • Published on 26 May 2021

The Backup feature is used to back up your Instance data. It creates an image of a snapshot that contains all your volumes.

Security & Identity (IAM):

You may need certain IAM permissions to carry out some actions described on this page. This means:

  • you are the Owner of the Scaleway Organization in which the actions will be carried out, or
  • you are an IAM user of the Organization, with a policy granting you the necessary permission sets
Requirements:

A backup is created using the command:

POST https://api.scaleway.com/instance/v1/zones/<region>/servers/<uid>/action
{"action":"backup"}

Replace <region> with the geographical region of the Instance. This value can be fr-par-1 for Instances located in Paris, for example. Replace <uid> with the unique identifier of the Instance.

By default, the name of the image is built according to the name of the server and the date:

image_<servername>_YYYY-MM-DD_hh-mm.

Alternatively you can specify a name for the image in the request:

POST https://api.scaleway.com/instance/v1/zones/<region>/servers/<id>/action
{ "action":"backup", "name":"myimagename" }

A backup request will create an Image object (Visible in the href_result: /images/<image_uuid>)

GET https://api.scaleway.com/instance/v1/zones/<region>/images/<image_uid>

An Image contains one snapshot for each volume of the instance. These snapshots are visible within the Image response, as root_volume and extra_volumes fields

Deleting a backup

Run the following call to delete the image that contains a backup:

DELETE https://api.scaleway.com/instance/v1/zones/<region>/images/<image_uid>

It is also recommended to remove every snapshot related to the image by running the following API call for each snapshot that is no longer needed:

DELETE https://api.scaleway.com/instance/v1/zones/<region>/snapshots/<snapshot_uid>