Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 53 additions & 57 deletions pages/instances/api-cli/attaching-a-volume.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
meta:
title: Attaching a Block Storage volume via the Instance API
title: Attaching a Block Storage volume via the Block Storage API
description: This page explains how to attach a Block Storage volume using the Scaleway API.
content:
h1: Attaching a Block Storage volume via the Instance API
Expand All @@ -24,31 +24,37 @@ dates:

1. Query the current volumes of the Instance.
```
curl -q \
-H "X-Auth-Token: $SECRET_KEY" \
-H 'Content-Type: application/json' \
https://api.scaleway.com/instance/v1/zones/fr-par-1/servers/be3c50af-e8f3-4ff4-90fe-66972f06670d
curl -X GET \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/instance/v1/zones/{zone}/servers/{server_id}"
```

The output displays as follows:
```
{
"server": {
"allowed_actions": [
...
"volumes": {
"0": {
...
"id": "7fe25caf-0a68-46a7-aeb9-63a278d33e2b",
"volume_type": "l_ssd",
...
}
},
...
"server": {
"id": "de0f4d6a-3289-4716-97a8-d24b2a58dcd9",
"name": "scw-priceless-diffie",
"arch": "x86_64",
...
},
"volumes": {
"0": {
"boot": false,
"volume_type": "sbs_volume",
"id": "1469d160-bfb2-4fdd-bb5d-f8d7c1d0439d",
"zone": "pl-waw-2"
}
},
...
}
```

As displayed, our current volumes are only constituted of the root volume.
2. Hot-plug the volume created earlier:
```bash
curl -q \
-H "X-Auth-Token: $SECRET_KEY" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H 'Content-Type: application/json' \
-X PATCH \
-d '{
Expand All @@ -63,44 +69,34 @@ dates:
}
}
}' \
https://api.scaleway.com/instance/v1/zones/fr-par-1/servers/be3c50af-e8f3-4ff4-90fe-66972f06670d
{
"server": {
...
"id": "be3c50af-e8f3-4ff4-90fe-66972f06670d",
...
"name": "scw-blissful-engelbart",
"protected": false,
"volumes": {
"0": {
"size": 20000000000,
"state": "available",
...
"id": "7fe25caf-0a68-46a7-aeb9-63a278d33e2b",
"volume_type": "l_ssd",
"server": {
"id": "be3c50af-e8f3-4ff4-90fe-66972f06670d",
"name": "scw-blissful-engelbart"
}
},
"1": {
"size": 10000000000,
"state": "available",
"name": "block-volume101",
"modification_date": "2019-09-03T10:17:40.800839+00:00",
...
"id": "b3a42fb1-e85c-46e9-b0a6-9adb62278295",
"volume_type": "sbs_volume",
"server": {
"id": "be3c50af-e8f3-4ff4-90fe-66972f06670d",
"name": "scw-blissful-engelbart"
}
}
},
...
}
}
https://api.scaleway.com/instance/v1/zones/{zone}/servers/{server_id}
```
The output looks like the following example:
```
{
"server": {
"id": "1de0f4d6a-3289-4716-97a8-d24b2a58dcd9",
"name": "scw-priceless-diffie",
"arch": "x86_64",
...
},
"volumes": {
"0": {
"boot": false,
"volume_type": "sbs_volume",
"id": "7fe25caf-0a68-46a7-aeb9-63a278d33e2b",
"zone": "pl-waw-2"
},
"1": {
"boot": false,
"volume_type": "sbs_volume",
"id": "b3a42fb1-e85c-46e9-b0a6-9adb62278295",
"zone": "pl-waw-2"
}
},
...
}
```
3. Use [SSH](/instances/how-to/connect-to-instance/) to log into your server and verify that the new disk exists:
```bash
lsblk
Expand All @@ -125,7 +121,7 @@ dates:

```
curl -q \
-H "X-Auth-Token: $SECRET_KEY" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H 'Content-Type: application/json' \
https://api.scaleway.com/instance/v1/zones/fr-par-1/volumes/b3a42fb1-e85c-46e9-b0a6-9adb62278295
{
Expand All @@ -135,7 +131,7 @@ dates:
"name": "block-volume101",
...
"id": "b3a42fb1-e85c-46e9-b0a6-9adb62278295",
"volume_type": "b_ssd",
"volume_type": "sbs_volume",
"server": {
"id": "be3c50af-e8f3-4ff4-90fe-66972f06670d",
"name": "scw-blissful-engelbart"
Expand Down
10 changes: 7 additions & 3 deletions pages/instances/api-cli/creating-a-volume.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ content:
paragraph: This page explains how to create a Block Storage volume using the Scaleway API.
tags: block-storage block volume create storage
dates:
validation: 2025-01-02
validation: 2025-06-02
posted: 2020-01-10
categories:
- block-storage
- storage
---

<Message type="important">
Creating Block Storage volumes via the Instances API is deprected and the information below is proposed for informative purposes only. [Learn how to create a volume using the Block Storage API.](https://www.scaleway.com/en/developers/api/block/#path-volume-create-a-volume)
</Message>

<Macro id="requirements" />

- A Scaleway account logged into the [console](https://console.scaleway.com)
Expand All @@ -24,7 +28,7 @@ categories:
1. Create a block volume from the API by launching the following command:
```
curl -q \
-H "X-Auth-Token: $SECRET_KEY" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{"name": "block-volume-101", "organization": "'$SCW_ORGANIZATION'", "size": 10000000000, "volume_type": "b_ssd"}' \
Expand All @@ -33,7 +37,7 @@ categories:
2. To retrieve the current status of the block volume, query the volume endpoint.
```
curl -q \
-H "X-Auth-Token: $SECRET_KEY" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H 'Content-Type: application/json' \
https://api.scaleway.com/instance/v1/zones/fr-par-1/volumes/b3a42fb1-e85c-46e9-b0a6-9adb62278295
{
Expand Down
18 changes: 11 additions & 7 deletions pages/instances/api-cli/creating-backups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ content:
paragraph: This page explains how to create backups of your Instaces using the Scaleway API
tags: instance create backup scaleway-api
dates:
validation: 2025-01-02
validation: 2025-05-28
posted: 2021-05-26
categories:
- compute
Expand Down Expand Up @@ -38,12 +38,12 @@ The Backup feature is used to back up your Instance data. It creates an image of
<Message type="tip">
By default, the name of the image is built according to the name of the server and the date. You can specify a name for the image in the request:
```sh
scw instance server backp server-id zone=fr-par-1 name=myimagename
scw instance server backup <server-id> zone=fr-par-1 name=<my-image-name>
```
</Message>
A backup request will create an image object. You can view it using:
```sh
scw instance image get image-uid zone=fr-par-1
scw instance image get <image-uid> zone=fr-par-1
```
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.
</TabsTab>
Expand Down Expand Up @@ -78,22 +78,26 @@ The Backup feature is used to back up your Instance data. It creates an image of
<TabsTab label="CLI">
To delete a backup, run the following command:
```sh
scw instance image delete image-uid zone=fr-par1
scw instance image delete <image-uid> zone=fr-par1
```
It is also recommended to remove every snapshot related to the image by running the following command for each snapshot that is no longer needed:
```sh
scw instance snapshot delete snapshot-uid zone=fr-par-1
scw block snapshot delete <snapshot-uid> zone=fr-par-1
```
</TabsTab>

<TabsTab label="API">
Run the following call to delete the image that contains a backup:
```
DELETE https://api.scaleway.com/instance/v1/zones/<region>/images/<image_uid>
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/instance/v1/zones/{zone}/images/{image_id}"
```
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>
curl -X DELETE \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
"https://api.scaleway.com/block/v1/zones/{zone}/snapshots/{snapshot_id}"
```
</TabsTab>
</Tabs>
Expand Down
6 changes: 3 additions & 3 deletions pages/instances/api-cli/detaching-a-volume.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ content:
paragraph: This page explains how to detach a Block Storage volume from an Instance using the Scaleway API.
tags: detach volume block storage unlink unplug api
dates:
validation: 2025-01-02
validation: 2025-06-02
posted: 2020-01-10
categories:
- block-storage
Expand All @@ -23,15 +23,15 @@ To detach a block volume from a running Instance, relaunch the API call and omit

```
curl -q \
-H "X-Auth-Token: $SECRET_KEY" \
-H "X-Auth-Token: $SCW_SECRET_KEY" \
-H 'Content-Type: application/json' \
-X PATCH \
-d '{
"volumes": {
"0": "7fe25caf-0a68-46a7-aeb9-63a278d33e2b",
}
}' \
https://api.scaleway.com/instance/v1/zones/fr-par-1/servers/be3c50af-e8f3-4ff4-90fe-66972f06670d
https://api.scaleway.com/instance/v1/zones/{zone}/servers/{server_id}
```


6 changes: 3 additions & 3 deletions pages/instances/api-cli/increasing-volume-size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ content:
paragraph: This page explains how to increase a Block Storage volume
tags: increase expand increment raise storage volume block
dates:
validation: 2025-03-11
validation: 2025-06-02
posted: 2020-01-10
categories:
- block-storage
Expand All @@ -30,7 +30,7 @@ The Instances API allows you to interact with Block Storage volumes programmatic

1. Inspect the volume and verify its name, size, and if the type is `b_ssd` by running the following request.
```
curl -q -H "X-Auth-Token: $SECRET_KEY" -X GET https://api.scaleway.com/instance/v1/zones/<REGION>/volumes/<VOLUME_ID>
curl -q -H "X-Auth-Token: $SCW_SECRET_KEY" -X GET https://api.scaleway.com/instance/v1/zones/<REGION>/volumes/<VOLUME_ID>
```

<Message type="note">
Expand All @@ -44,7 +44,7 @@ The Instances API allows you to interact with Block Storage volumes programmatic
```
2. To modify the volume size, run the request below:
```
curl https://api.scaleway.com/instance/v1/zones/REGION/volumes/VOLUME_ID -H "X-Auth-Token: $SECRET_KEY" -X PATCH -H 'Content-Type: application/json;charset=utf-8' --data '{ "name":"new_name", "size":26000000000 }'
curl https://api.scaleway.com/instance/v1/zones/REGION/volumes/VOLUME_ID -H "X-Auth-Token: $SCW_SECRET_KEY" -X PATCH -H 'Content-Type: application/json;charset=utf-8' --data '{ "name":"new_name", "size":26000000000 }'
```
Replace `REGION` and `VOLUME_ID` following the guidelines mentioned previously and replace the existing size value with the new one.

Expand Down
26 changes: 16 additions & 10 deletions pages/instances/api-cli/managing-instance-snapshot-via-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ content:
paragraph: This page explains how to manage Scaleway Instance snapshots with the CLI (v2)
tags: manage instance snapshot cli cli-v2
dates:
validation: 2025-04-22
validation: 2025-05-28
posted: 2022-09-24
categories:
- compute
Expand Down Expand Up @@ -38,15 +38,11 @@ The following arguments and flags are available to customize your command:

```sh
ARGS:
[volume-id] UUID of the volume to snapshot
[name=<generated>] Name of the snapshot
[volume-id] UUID of the volume
[tags.{index}] The tags of the snapshot
[project-id] Project ID to use. If none is passed the default project ID will be used
[bucket] Bucket name for snapshot imports
[key] Object key for snapshot imports
[size] Imported snapshot size, must be a multiple of 512
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[zone=fr-par-1] Zone to target. If none is passed will use the default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1)
[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
Expand Down Expand Up @@ -82,11 +78,21 @@ Run the following command to create a named snapshot from the given volume ID. R
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 snapshot

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 snapshot

Run the following command to import a QCOW file as an Instance snapshot. Replace the bucket name `my-bucket` with the name of your Object Storage bucket and the file name `qcow2-file-name.qcow2` with the name of your QCOW file.
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 create zone=fr-par-1 name=my-imported-snapshot volume-type=b_ssd bucket=my-bucket key=my-qcow2-file-name.qcow
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
```

<Message type="important">
Expand Down
Loading