Downloading and transferring an instance backup from one OpenStack region to another

View as Markdown

Find out how to download and transfer an instance backup from one OpenStack region to another while preserving the configuration and state of the instance

Objective

A situation may arise where you need to move your Public Cloud instance from one OpenStack region to another, either because you would prefer to move to a newly available OpenStack region or because you want to migrate from OVHcloud Labs to Public Cloud.

This guide explains how to transfer an instance backup from one OpenStack region to another while preserving the configuration and state of the instance.

Requirements

This environment will be used as a "jump host" to transfer the backup from one region to another. It can be an instance hosted on OVHcloud or your local machine.

You will also need a Public Cloud instance in your OVHcloud account.

Instructions

Info

If you need to create a backup with OpenStack, refer to our guide "Backing up an instance".

Step 1 - Download the backup

List your private images to identify the backup you want to transfer:

openstack image list --private

Download the backup to your local storage:

openstack image save --file backup.qcow2 <image-id>

Step 2 - Switch to the target region

If you are transferring the backup to another region within the same project, update OS_REGION_NAME:

export OS_REGION_NAME=<target-region>

If you are transferring to a different project or account, source the corresponding RC file:

source openrc.sh

Step 3 - Import the backup into the target region

The import command differs depending on whether the target is a standard region or a Local Zone.

Standard region

openstack image create \
  --disk-format qcow2 \
  --container-format bare \
  --file backup.qcow2 \
  <image-name>

Local Zone

Local Zone region names contain -lz- (e.g. eu-central-lz-prg-a). They require --disk-format raw. The filename extension of the backup file does not affect the import — --disk-format is what tells OpenStack how to interpret the file.

openstack image create \
  --disk-format raw \
  --container-format bare \
  --file backup.qcow2 \
  <image-name>
Warning

Windows images only — you must add the following properties, otherwise it will not be possible to associate a win-x-x flavor type from the OVHcloud Control Panel. This flavor type is required for authentication via the OVHcloud KMS.

Add the properties at creation time (standard region):

openstack image create \
  --disk-format qcow2 \
  --container-format bare \
  --file backup.qcow2 \
  --property "_system_cloud_property=windows" \
  --property "distro_family=windows" \
  --property "os_type=windows" \
  <image-name>

Add the properties at creation time (Local Zone):

openstack image create \
  --disk-format raw \
  --container-format bare \
  --file backup.qcow2 \
  --property "_system_cloud_property=windows" \
  --property "distro_family=windows" \
  --property "os_type=windows" \
  <image-name>

Or set them on an existing image:

openstack image set \
  --property "_system_cloud_property=windows" \
  --property "distro_family=windows" \
  --property "os_type=windows" \
  <image-uuid>
Info

To recreate your instance from this backup, follow our guide "Using instance backups to create or restore an instance".

Go further

Join our community of users.

Was this page helpful?