Migrating a Compute instance and its Block Storage volume from a Local Zone to a 1-AZ or 3-AZ region
Find out how to migrate a Public Cloud instance and its attached Block Storage volume from a Local Zone to a 1-AZ or 3-AZ region, using the OpenStack CLI
Objective
A Local Zone and a 1-AZ or 3-AZ region are two distinct OpenStack regions. An instance or a volume cannot be moved directly between them: export both as images, then re-import and re-create them in the target region.
This guide explains how to migrate a Compute instance and its attached Block Storage volume from a Local Zone to a 1-AZ or 3-AZ region, using the OpenStack CLI.
It is illustrated with the following example:
- A
b3-16instance running in the Milan Local Zone (EU-SOUTH-LZ-MIL-A), with an attached Block Storage volume. - Both are migrated to the Milan 3-AZ region (
EU-SOUTH-MIL).
The same steps apply to any other Local Zone and its parent 1-AZ or 3-AZ region.
Before migrating, it's worth understanding the differences between the deployment modes offered by OVHcloud Public Cloud. Each mode (1-AZ, 3-AZ or Local Zones) has a direct impact on the resilience, availability and design of your infrastructure.
To find out more, consult "Comparison and resilience of Deployment Modes - Understanding 3-AZ / 1-AZ / Local Zones".
Requirements
- An instance and a Block Storage volume running in a Local Zone, in the same Public Cloud project as the target 1-AZ or 3-AZ region.
- The OpenStack CLI, installed and ready to use. Follow our guide "Preparing an environment for using the OpenStack API" if this is not already the case.
- Enough local disk space to temporarily hold the exported image and the volume backup (at least the size of the instance's system disk plus the size of the volume).
OVHcloud Control Panel Access
- Direct link:
- Navigation path:
Public Cloud> Select your project
Instructions
Retrieve OpenStack credentials for both regions
You need OpenStack credentials (an OpenRC file) for both the source Local Zone and the target 1-AZ or 3-AZ region: they are two regions of the same OpenStack project.
To download an OpenRC file:
- Under Settings, open
Users & Roles. - Next to the relevant user, click the
...button, then selectDownload OpenStack's RC file. - In the dialog box, first select your Local Zone (e.g.
Milan (EU-SOUTH-LZ-MIL-A)), then clickDownload. - Repeat the operation, this time selecting the corresponding 1-AZ or 3-AZ region (e.g.
EU-SOUTH-MIL).
An OpenRC file pins a single user and a single region, through the OS_REGION_NAME variable it exports. Both regions belong to the same OpenStack project, so the same credentials apply to each: to switch region, either source the other file, or override that variable in the current shell (export OS_REGION_NAME=EU-SOUTH-MIL).
See our guide "Setting OpenStack environment variables" for details on sourcing an OpenRC file.
Overview of the migration
For the Compute instance:
- Create an image from the Local Zone instance (this does not include its attached volumes).
- Export and download that image.
- Upload the image to the 1-AZ or 3-AZ region.
- Create a new instance from this image.
For the Block Storage volume:
- Detach the volume from the instance.
- Create a backup of the Local Zone volume.
- Export and download that backup as an image.
- Upload the image to the 1-AZ or 3-AZ region.
- Create a new volume from this image, and attach it to the migrated instance.
To keep the data consistent, it is recommended to power off the source instance before starting the migration.
Prepare the source instance and volume
Source the OpenRC file for the source Local Zone, then identify the instance and the volume to migrate:
A volume can only be backed up once it is detached (status available). Detach it from the instance — the first argument is the server, the second the volume, and here both are named test-LZ-MIL:
Part 1 — Migrate the Compute instance
Step 1: Create an image of the instance
The --wait flag makes the command return only once the image is active. You can also check its status separately:
This image only captures the instance's system disk — attached Block Storage volumes are not included and must be migrated separately (see Part 2).
Step 2: Export and download the image
Images stored in a Local Zone cannot be downloaded directly with openstack image save. Contact our support and ask them to export the image — you will receive a pre-signed S31 URL to download it.
Once downloaded, uncompress the file if necessary.
If you have already created the volume backup as well (see Part 2, Step 6), you can ask support to export both the instance image and the volume backup in the same request, to avoid a second round trip.
Step 3: Upload the image to the target region
Source the OpenRC file for the target 1-AZ or 3-AZ region (or switch by setting OS_REGION_NAME to it, here EU-SOUTH-MIL), then upload the image:
The disk format must be raw, not qcow2. Depending on the image size, the upload can take a while — let it complete.
Step 4: Create the instance in the target region
Create the new instance from the uploaded image:
- Choose a flavor whose system disk is at least as large as the source instance's. In this example,
b3-16has a 100Â GB system disk and is available with identical specifications in both the Local Zone and the 3-AZ region. - Specify the availability zone where the instance should be created. A 1-AZ region has a single availability zone, so
--availability-zoneis optional there; a 3-AZ region has three, so choose the one you want explicitly. - The
defaultsecurity group already exists in every project and is enough to get started; customise it later by following "Creating and configuring a security group in Horizon". - If you don't have an SSH key pair yet (
my_keyin the example below), create one following the Creating key pairs for OpenSSH connections section of "How to create and use authentication keys for SSH connections to Public Cloud instances". - The instance needs an existing network (
test-3AZ-MILin the example below). To create one with a Gateway via the OpenStack CLI, follow the Create a private network with a Gateway section of "Creating a private network with Gateway". - To reach the instance from the Internet, attach a Floating IP following the Via the OpenStack API section (under "Attaching a Floating IP to an instance") of "Attaching a Floating IP to a Public Cloud instance".
Wait until the instance reaches the ACTIVE status:
Step 5: About the first boot
The volume has not been migrated yet, so the boot process will not complete: the console log will show the system waiting for the missing disk and eventually dropping into emergency mode. This is expected — it confirms the image itself is correct.
Continue with the volume migration below, then attach the volume and restart the instance — the boot will then complete normally.
If your fstab mounts the volume by device name (e.g. /dev/vdb) rather than by LABEL or UUID, the device name may differ once the volume is re-attached, and the boot could fail again — in this example the volume moves from /dev/sdb on the Local Zone to /dev/vdb in the 3-AZ region. Using LABEL= in fstab avoids this. If the instance is already unreachable, boot it in rescue mode to fix fstab.
Part 2 — Migrate the Block Storage volume
The volume must still be detached (status available), as set up in Prepare the source instance and volume.
Part 1 ended on the target region, so switch back to the source Local Zone: the command below and Step 6 run against it, and Step 8 switches to the target region again.
Note the source volume's storage class — you will reuse it for the new volume in Step 9:
Step 6: Back up the volume
Check that the backup is available:
Step 7: Export and download the backup
As with the instance image, contact our support and ask them to export the volume backup as an image. You will receive a pre-signed S3 URL to download it, and can uncompress the file if necessary.
Step 8: Upload the backup image to the target region
Once you have switched back to the target 1-AZ or 3-AZ region:
The disk format must be raw, not qcow2. Depending on the image size, the upload can take a while — let it complete.
Step 9: Create the volume from the image
Create the volume with the storage class noted at the start of Part 2 (classic in this example), unless you deliberately want a different one — the storage class affects both performance and billing:
--sizemust be at least the size of the original volume.--availability-zonemust match the instance's availability zone if you are using thehigh-speedorhigh-speed-gen2storage class. In a 1-AZ region there is only one possible value; in a 3-AZ region, match the zone chosen for the instance in Step 4.
Wait until the volume is available:
Step 10: Attach the volume and restart the instance
Stop the instance, attach the volume, then start it again:
Wait until the instance reaches the SHUTOFF status. As in the source region, the first argument of server add volume is the server and the second the volume — here both are named test-3AZ-MIL:
Because fstab references the volume by LABEL, the system discovers and mounts it automatically, and the boot completes:
The instance and its Block Storage volume are migrated to the target region.
Go further
Comparison and resilience of Deployment Modes - Understanding 3-AZ / 1-AZ / Local Zones
Migration of instances between different regions
Downloading and transferring an instance backup from one OpenStack region to another
Local Zone Compute - Features, Capabilities and Limitations
Join our community of users.
1: S3 is a trademark of Amazon Technologies, Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies, Inc.