Skip to content

Commit 35f1e1e

Browse files
authored
feat(ins): add sbs migration with cli (#3819)
* feat(ins): add sbs migration with cli * Update migrate-volumes-snapshots-to-sbs.mdx * Apply suggestions from code review * feat(ins): add note
1 parent 88eea1a commit 35f1e1e

File tree

1 file changed

+149
-52
lines changed

1 file changed

+149
-52
lines changed

compute/instances/how-to/migrate-volumes-snapshots-to-sbs.mdx

Lines changed: 149 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ content:
77
paragraph: This guide provides step-by-step instructions to help you migrate your existing Block Storage volumes and snapshots to Scaleway's new Block Storage management system.
88
tags: instance snapshot volume b_ssd sbs
99
dates:
10-
validation: 2024-08-07
10+
validation: 2024-10-10
1111
posted: 2024-08-07
1212
categories:
1313
- compute
1414
---
1515

1616
Scaleway is transitioning the management of Block Storage volumes and snapshots from compute teams to storage teams to enhance performance and reliability.
17-
While the characteristics of your migrated volumes and snapshots will remain unchanged, they will now be managed by Scaleway's new storage management system.
18-
This guide provides the steps needed to migrate your volumes and snapshots smoothly.
17+
While the characteristics of your migrated volumes and snapshots will remain unchanged, Scaleway's new storage management system will now manage them.
18+
This guide provides the steps needed to migrate your volumes and snapshots using either the [Scaleway Command Line Interface (CLI)](/developer-tools/scaleway-cli/quickstart/) tool (recommended) or via the [Instances API](https://www.scaleway.com/en/developers/api/instance/#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage).
19+
20+
<Message type="tip">
21+
The easiest way to migrate your Block Storage volumes and snapshots is by using the [Scaleway Command Line Interface (CLI)](/developer-tools/scaleway-cli/quickstart/) tool.
22+
</Message>
1923

2024
<Macro id="requirements" />
2125

@@ -28,62 +32,155 @@ This guide provides the steps needed to migrate your volumes and snapshots smoot
2832
This process applies only to Block SSD (`b_ssd`) volumes.
2933
</Message>
3034

31-
1. Plan the migration by using the following `curl` command:
32-
33-
```bash
34-
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/plan" \
35-
--header "Content-Type: application/json" \
36-
--header "X-Auth-Token: $SCW_SECRET_KEY" \
37-
--data "{
38-
\"volume_id\": \"$SCW_VOLUME_ID\"
39-
}"
40-
```
41-
42-
The response includes the volume and any snapshots created from the volume that will be migrated. It also returns a `validation_key`.
43-
44-
2. Confirm the migration by using the following `curl` command:
45-
46-
```bash
47-
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/apply" \
48-
--header "Content-Type: application/json" \
49-
--header "X-Auth-Token: $SCW_SECRET_KEY" \
50-
--data "{
51-
\"volume_id\": \"$SCW_VOLUME_ID\",
52-
\"validation_key\": \"$SCW_VALIDATION_KEY\"
53-
}"
54-
```
35+
<Tabs>
36+
<TabsTab label="CLI">
37+
<Message type="note">
38+
When you migrate a volume, the volume and any snapshots created from the volume will be migrated.
39+
</Message>
40+
1. Retrieve the ID of your Block Storage volume using the `scw instance volume list` command. This command returns a list of your volumes, as shown below:
41+
```
42+
$ scw instance volume list
43+
ID STATE SERVER ID SERVER NAME
44+
369feb53-165f-437d-875e-188725df462b available
45+
```
46+
2. Plan the volume migration with the `scw instance volume plan-migration <VOLUME_ID>` command. This command provides the state of the volume and a unique `ValidationKey`, which is needed to start the migration.
47+
```
48+
$ scw instance volume plan-migration 369feb53-165f-437d-875e-188725df462b
49+
Volume.ID 369feb53-165f-437d-875e-188725df462b
50+
Volume.Name vol-peaceful-davinci
51+
Volume.Size 25 GB
52+
Volume.VolumeType b_ssd
53+
Volume.CreationDate 3 minutes ago
54+
Volume.ModificationDate 3 minutes ago
55+
Volume.Organization 27e53d15-cc73-440e-956c-40560076e3d7
56+
Volume.Project 27e53d15-cc73-440e-956c-40560076e3d7
57+
Volume.Server.ID 177c6ed5-e999-4cc7-b152-8ce56217579c
58+
Volume.Server.Name scw-naughty-robinson
59+
Volume.State available
60+
Volume.Zone fr-par-1
61+
ValidationKey 30d129ca895c4cd59f4c429e12dab300
62+
```
63+
3. Execute the migration using the `scw instance volume apply-migration <VOLUME_ID> validation-key=<VALIDATION_KEY> zone=<VOLUME_ZONE>` command.
64+
```
65+
$ scw instance volume apply-migration 369feb53-165f-437d-875e-188725df462b validation-key=30d129ca895c4cd59f4c429e12dab300 zone=fr-par-1
66+
✅ Success
67+
```
68+
The volume migration is complete. You can now manage the migrated volume from the [Block Storage Volumes section](https://console.scaleway.com/block-storage/volumes) in the Scaleway console.
69+
70+
</TabsTab>
71+
<TabsTab label="API">
72+
<Message type="note">
73+
When you migrate a volume using the API, the volume and any snapshots created from the volume will be migrated.
74+
</Message>
75+
76+
1. Plan the migration by using the following `curl` command:
77+
78+
```bash
79+
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/plan" \
80+
--header "Content-Type: application/json" \
81+
--header "X-Auth-Token: $SCW_SECRET_KEY" \
82+
--data "{
83+
\"volume_id\": \"$SCW_VOLUME_ID\"
84+
}"
85+
```
86+
87+
The response includes the volume and any snapshots created from the volume that will be migrated. It also returns a `validation_key`.
88+
89+
2. Confirm the migration by using the following `curl` command:
90+
91+
```bash
92+
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/apply" \
93+
--header "Content-Type: application/json" \
94+
--header "X-Auth-Token: $SCW_SECRET_KEY" \
95+
--data "{
96+
\"volume_id\": \"$SCW_VOLUME_ID\",
97+
\"validation_key\": \"$SCW_VALIDATION_KEY\"
98+
}"
99+
```
100+
</TabsTab>
101+
</Tabs>
55102

56103
## Migrating an existing Block Storage snapshot to Scaleway Block Storage management
57104

58105
<Message type="important">
59106
This process applies to Block SSD (`b_ssd`) or Unified (`unified`) snapshots.
60107
</Message>
61108

62-
1. Plan the migration by using the following `curl` command:
63-
64-
```bash
65-
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/plan" \
66-
--header "Content-Type: application/json" \
67-
--header "X-Auth-Token: $SCW_SECRET_KEY" \
68-
--data "{
69-
\"snapshot_id\": \"$SCW_SNAPSHOT_ID\"
70-
}"
71-
```
72-
73-
The response includes the source volume of the snapshot and any snapshots created from this volume, including the `snapshot_id` provided by the user. It also returns a `validation_key`.
74-
75-
2. Confirm the migration using the following `curl` command:
76-
77-
```bash
78-
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/apply" \
79-
--header "Content-Type: application/json" \
80-
--header "X-Auth-Token: $SCW_SECRET_KEY" \
81-
--data "{
82-
\"snapshot_id\": \"$SCW_SNAPSHOT_ID\",
83-
\"validation_key\": \"$SCW_VALIDATION_KEY\"
84-
}"
85-
```
109+
<Tabs>
110+
<TabsTab label="CLI">
111+
<Message type="note">
112+
When you migrate a snapshot, the source volume of the snapshot and any snapshots created from this volume will also be migrated.
113+
</Message>
114+
1. Retrieve the ID of your snapshot using the `scw instance snapshot list` command. This command provides an output similar to the following:
115+
```
116+
$ scw instance snapshot list
117+
ID NAME
118+
a377afe5-a9a3-4706-b8c2-8d1c247a620f snap-eloquent-edison
119+
```
120+
2. Plan the migration with the `scw instance snapshot plan-migration <SNAPSHOT_ID>` command. This command returns the state of the snapshot and a unique `ValidationKey`, which is necessary to start the migration.
121+
```
122+
$ scw instance snapshot plan-migration a377afe5-a9a3-4706-b8c2-8d1c247a620f
123+
Snapshots.0.ID a377afe5-a9a3-4706-b8c2-8d1c247a620f
124+
Snapshots.0.Name image-scw-quirky-torvalds_snap_0
125+
Snapshots.0.Organization 4a2e00bf-5126-43ce-9b09-be943c619139
126+
Snapshots.0.Project 4a2e00bf-5126-43ce-9b09-be943c619139
127+
Snapshots.0.VolumeType b_ssd
128+
Snapshots.0.Size 10 GB
129+
Snapshots.0.State available
130+
Snapshots.0.CreationDate 2 weeks ago
131+
Snapshots.0.ModificationDate 5 days ago
132+
Snapshots.0.Zone fr-par-1
133+
Snapshots.1.ID 384799c2-c4dd-40ab-bd65-ed95cd7b4d5c
134+
Snapshots.1.Name snap-eloquent-edison
135+
Snapshots.1.Organization 4a2e00bf-5126-43ce-9b09-be943c619139
136+
Snapshots.1.Project 4a2e00bf-5126-43ce-9b09-be943c619139
137+
Snapshots.1.VolumeType b_ssd
138+
Snapshots.1.Size 10 GB
139+
Snapshots.1.State available
140+
Snapshots.1.CreationDate 2 weeks ago
141+
Snapshots.1.ModificationDate 5 days ago
142+
Snapshots.1.Zone fr-par-1
143+
ValidationKey b36f7bcc21d344d783d4cbb27536bfad
144+
```
145+
3. Execute the migration using the `scw instance snapshot apply-migration <SNAPSHOT_ID> validation-key=<VALIDATION_KEY> zone=<SNAPSHOT_ZONE>` command.
146+
```
147+
$ scw instance snapshot apply-migration a377afe5-a9a3-4706-b8c2-8d1c247a620f validation-key=b36f7bcc21d344d783d4cbb27536bfad zone=fr-par-1
148+
✅ Success.
149+
```
150+
The snapshot migration is complete. You can now manage the migrated snapshot from the [Block Storage Snapshot section](https://console.scaleway.com/block-storage/volumes) in the Scaleway console.
151+
</TabsTab>
152+
<TabsTab label="API">
153+
<Message type="note">
154+
When you migrate a snapshot using the API, the source volume of the snapshot and any snapshots created from this volume will also be migrated.
155+
</Message>
156+
157+
1. Plan the migration by using the following `curl` command:
158+
159+
```bash
160+
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/plan" \
161+
--header "Content-Type: application/json" \
162+
--header "X-Auth-Token: $SCW_SECRET_KEY" \
163+
--data "{
164+
\"snapshot_id\": \"$SCW_SNAPSHOT_ID\"
165+
}"
166+
```
167+
168+
The response includes the source volume of the snapshot and any snapshots created from this volume, including the `snapshot_id` provided by the user. It also returns a `validation_key`.
169+
170+
2. Confirm the migration using the following `curl` command:
171+
172+
```bash
173+
curl --location "https://api.scaleway.com/instance/v1/zones/$SCW_AVAILABILITY_ZONE/block-migration/apply" \
174+
--header "Content-Type: application/json" \
175+
--header "X-Auth-Token: $SCW_SECRET_KEY" \
176+
--data "{
177+
\"snapshot_id\": \"$SCW_SNAPSHOT_ID\",
178+
\"validation_key\": \"$SCW_VALIDATION_KEY\"
179+
}"
180+
```
181+
</TabsTab>
182+
</Tabs>
86183

87184
## Going further
88185

89-
To learn more about managing your migrated Block Storage volumes from the Scaleway console, refer to the [Block Storage - Console documentation](/storage/block/quickstart/). Additionally, you can manage your Block Storage volumes using the [Scaleway Block Storage API](https://www.scaleway.com/en/developers/api/block/).
186+
To learn more about managing your migrated Block Storage volumes from the Scaleway console, refer to the [Block Storage - Console documentation](/storage/block/quickstart/). Additionally, you can manage your Block Storage volumes using the [Scaleway Block Storage API](https://www.scaleway.com/en/developers/api/block/).

0 commit comments

Comments
 (0)