-
Notifications
You must be signed in to change notification settings - Fork 250
docs(instance): add instance moving guide #5272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bene2k1
wants to merge
4
commits into
main
Choose a base branch
from
MTA-6280
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
pages/instances/reference-content/moving-instances-between-az-and-projects.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
title: Moving Scaleway Instances between Availability Zones and Projects | ||
description: Find out how to move Scaleway Instances between Availability Zones and Projects. | ||
dates: | ||
validation: 2025-07-15 | ||
categories: | ||
- compute | ||
tags: instance migration | ||
--- | ||
import Requirements from '@macros/iam/requirements.mdx' | ||
|
||
This guide explains how to move a Scaleway Instance (Virtual Machine) from one Availability Zone (AZ) to another or from one Project to another, regardless of whether the Instance uses Local Storage or Block Storage. | ||
You can perform these actions using the Scaleway console, CLI, or API. | ||
|
||
<Requirements /> | ||
- A Scaleway account logged into the [console](https://console.scaleway.com) | ||
- An [Instance](/instances/how-to/create-an-instance/) | ||
- The [Scaleway CLI](/docs/scaleway-cli/quickstart/) installed (for CLI-based instructions) | ||
- A valid [API key](/iam/how-to/create-api-keys/) with sufficient permissions (for API-based instructions) | ||
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
|
||
<Message type="important"> | ||
- Moving an Instance between AZs requires creating a snapshot of the Instance’s data and launching a new Instance in the target AZ, as direct migration of a running Instance is not supported. | ||
- Moving an Instance between Projects involves transferring ownership of the Instance or its snapshot. | ||
- Local Storage is tied to the Instance’s hypervisor and cannot be directly moved across AZs. Block Storage volumes can be detached and reattached within the same AZ but require additional steps for cross-AZ migration. | ||
- Ensure the target AZ supports the desired Instance type. Refer to the [Instances datasheet](/instances/reference-content/instances-datasheet/) for details. | ||
</Message> | ||
|
||
## Moving an Instance between Availability Zones | ||
|
||
### Creating a snapshot | ||
|
||
1. In the Scaleway console, navigate to **Compute > CPU Instances**, select your Instance, and go to the **Storage** tab to view attached volumes (Local or Block Storage). | ||
|
||
2. From the Instance’s **Storage** tab, click **+ Create snapshot**. A popup displays. | ||
- Select the volume to snapshot, choose a name, and select the snapshot type (LSSD for Local Storage, BSSD for Block Storage). | ||
- Click **Create snapshot**. | ||
- Repeat for all volumes attached to the Instance if you need a full backup. | ||
<Message type="note"> | ||
Snapshots can be created without stopping the Instance. However, for data consistency, pause heavy write operations if possible. | ||
</Message> | ||
|
||
### Exporting the snapshot to Object Storage | ||
|
||
Snapshots must be exported to a Scaleway Object Storage bucket in the same region as the source and destination AZs to move them across AZs. | ||
|
||
#### Exporting Local Storage snapshots via the console | ||
- Navigate to **Local Storage > Snapshots**, select the snapshot, and click **Actions > Copy to bucket**. | ||
- Enter a file name for the QCOW2 export (ensure it ends with `.qcow` or `.qcow2`) and select an Object Storage bucket in the same region. | ||
- Click **Copy snapshot to bucket**. Wait for the export to complete (status turns green). | ||
|
||
#### Exporting Block Storage snapshots via CLI | ||
- For recent snapshots, managed by the Block Storage API, use the following command to export the snapshot to an Object Storage bucket in the same AZ as the snapshot. | ||
```bash | ||
scw block snapshot export-to-object-storage zone=<zone-to-target> snapshot-id=<snapshot-id> bucket=<bucket-name> key=<qcow2-file-name>.qcow2 | ||
``` | ||
Replace `<snapshot-id>` with the snapshot ID, `<bucket-name>` with your Object Storage bucket name, and `<qcow2-file-name>` with the desired file name. | ||
bene2k1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
- For legacy Block Storage volumes or Local Storage volumes, managed by the Instances API, usee the following command: | ||
```bash | ||
scw instance snapshot export-to-object-storage zone=<zone-to-target> snapshot-id=<snapshot-id> bucket=<bucket-name> key=<qcow2-file-name>.qcow2 | ||
``` | ||
Replace `<snapshot-id>` with the snapshot ID, `<bucket-name>` with your Object Storage bucket name, and `<qcow2-file-name>` with the desired file name. | ||
bene2k1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
### Importing the Snapshot into the destination AZ | ||
|
||
Import your QCOW2 object as a Local Storage or Block Storage snapshot. You can then deploy an Instance from it. | ||
|
||
#### Importing snapshots via the console | ||
|
||
1. Navigate to **Object Storage** and select the Region you have exported your snaphot to. | ||
bene2k1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2. Click the name of the bucket containing your snapshot to display it's content. | ||
bene2k1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. Click <Icon name="more" /> next to the name of snapshot to view the object menu. | ||
bene2k1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
4. Click **Import as snapshot**. A pop-up displays. | ||
5. Enter a name for the snapshot or keep the suggested name, choose the destination AZ for the snapshot to be imported into and select the snapshot type. | ||
- Imported snapshots can be either Local Storage or Block Storage. | ||
6. Click **Import object as snapshot**. | ||
|
||
#### Importing snapshots via CLI | ||
|
||
Import snapshots via the CLI using the following command: | ||
|
||
```bash | ||
scw block snapshot import-from-object-storage name=<snapshot-name> bucket=<bucket-name> key=<qcow2-file-name>.qcow2 size=<size-in-GB> project-id=<project-id-to-target> zone=<zone-to-target> | ||
``` | ||
Replace `<snapshot-name>` with the name for the snapshot to import, `<bucket-name>` with your Object Storage bucket name, and `<qcow2-file-name>` with the desired file name. | ||
Replace `<size-in-GB>` with the desired size for the new snapshot, `<project-id>` with the Project ID to import the snapshot to (optional), `<zone-to-target>` with the AZ to import the snapshot into. | ||
|
||
### Creating a new Instance in the destination AZ | ||
|
||
#### Creating a new Instance via the console | ||
- Navigate to **Compute > CPU & GPU Instances** and click **+ Create Instance > Create CPU Instance**. | ||
- Select the destination AZ and desired Instance type. | ||
- At the **Choose an image** step, go to the **My snapshots** tab and select the imported snapshot. | ||
- Configure additional volumes, network settings, and flexible IPs as needed. To retain the original public IP, select it under **Select existing IPv4(s)**. | ||
- Click **Create Instance**. | ||
|
||
#### Creating a new Instance via CLI | ||
|
||
Run the following command to create a new Instance with a Block Storage root volume from an imported snapshot: | ||
|
||
```sh | ||
scw instance server create image=none root-volume=block:<snapshot-id> type=<commercial-type> zone=<zone-to-target> project-id=<project-to-target> | ||
``` | ||
|
||
Replace `<snapshot-id>` with the ID of the imported snapshot, `<commercial-type>` with the commercial type of the Instance to create, `<zone-to-target>` with the AZ to create the Instance in, and `<project-to-target>` with the ID of the project to target. | ||
|
||
## Considerations for storage types | ||
- **Local Storage (LSSD)**: | ||
- Snapshots are created and managed via the Instance API. | ||
- Local Storage is tied to the Instance’s hypervisor and cannot be detached independently. Use snapshots to move data to a new Instance. | ||
- **Block Storage (BSSD/SBS)**: | ||
- Block Storage volumes can be detached and reattached to another Instance in the same AZ without snapshotting, if moving within the same Project and AZ: | ||
```bash | ||
scw instance server detach-volume volume-id=<volume-id> zone=<zone-to-target> | ||
scw instance server attach-volume server-id=<server-id> volume-id=<volume-id> zone=<zone-to-target> | ||
``` | ||
- LSSD snapshots can only be restored to Local Storage volumes, and BSSD snapshots to Block Storage volumes. Ensure the correct snapshot type is selected during import. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.