Downloading and transferring an instance backup from one OpenStack region to another
Learn how to transfer an instance backup from one OpenStack region to another while preserving the configuration and state of the instance.
Through this guide, you will create an OpenStack environment that will be used as a "jump host" to transfer the backup from one region to another. This environment can be an instance hosted on OVHcloud or your local machine.
Requirements
- A Public Cloud instance in your OVHcloud account
- OpenStack CLI (see this guide for more information)
- Connectivity to OVHCloud OpenStack APIs
- Available storage that matches the instance disk size (for temporary backup storage)
This environment will be used as a "jump host" to transfer the backup from one region to another. This environment can be an instance hosted on OVHcloud or your local machine.
Instructions
Download the backup
Next, run this command to list available instances:
$ openstack image list --long
+--------------------------------------+-----------------------------------------------+--------+
| ID | Name | Status |
+--------------------------------------+-----------------------------------------------+--------+
| 825b785d-8a34-40f5-bdcd-0a3c3c350c5a | snap_server1 | active |
| 3ff877dc-1a62-43e7-9655-daff37a0c355 | NVIDIA GPU Cloud (NGC) | active |
| a14a7c1e-3ac5-4a61-9d36-1abc4ab4d5e8 | Centos 7 | active |
| f720a16e-543b-42e5-af45-cc188ad2dd34 | Debian 8 - GitLab | active |
| d282e7aa-332c-4dc7-90a9-d49641fa7a95 | CoreOS Stable | active |
| 2519f0fb-18cc-4915-9227-7754292b9713 | Ubuntu 16.04 | active |
| b15789f8-2e2f-4f6c-935d-817567319627 | Windows Server 2012 R2 Standard - UEFI | active |
| ed2f327f-dbae-4f9e-9754-c677a1b76fa3 | Ubuntu 14.04 | active |
| 9c9b3772-5320-414a-90bf-60307ff60436 | Debian 8 - Docker | active |
Now identify the instance backup from the list:
| 825b785d-8a34-40f5-bdcd-0a3c3c350c5a | snap_server1 | qcow2 | bare | 1598029824 | active |
Finally, run this command to download the backup on the jump host:
$ openstack image save --file snap_server1.qcow 825b785d-8a34-40f5-bdcd-0a3c3c350c5a
Transfer the backup to another OpenStack region
To start the transfer process, you first need to load new environment variables.
Warning
NOTE: If you are transferring your backup to an OpenStack region within the same project, you will need to change the variable OS_REGION_NAME.
$ export OS_REGION_NAME=US-EAST-VA-1
If you are transferring your backup to another project or account, you will have to reload the environment variables linked to that account using the following command:
To transfer the backup to the new OpenStack region, use this command:
$ openstack image create --disk-format qcow2 --container-format bare --file snap_server1.qcow snap_server1
Warning
NOTE: If your instance uses a Windows image, you need to add specific properties. Otherwise, when creating the instance via the OVHcloud Control Panel, it will not be possible to associate a flavor of the win-x-x type. This type of flavor, and only this one, enables authentication to the OVHcloud KMS.
Add specific properties for image creation:
$ openstack image create --disk-format qcow2 --container-format bare --file snap_server1.qcow --property "_system_cloud_property=windows" --property "distro_family=windows" --property "os_type=windows" snap_server1
Add specific properties after image creation:
$ openstack image set --property "_system_cloud_property=windows" --property "distro_family=windows" --prope
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| checksum | 82cb7d57ec7278818bba0afcf802f0fb |
| container_format | bare |
| created_at | 2019-03-22T14:26:22Z |
| disk_format | qcow2 |
| file | /v2/images/1bf21cf3-8d39-40ae-b088-5549c31b7905/file |
| id | 0a3f5901-2314-438a-a7af-ae984dcbce5c |
| min_disk | 0 |
| min_ram | 0 |
| name | snap_server1 |
| owner | 4e03fd164d504aa3aa03938f0bf4ed90 |
| properties | direct_url='swift+config://ref1/glance/1bf21cf3-8d39-40ae-b088-5549c31b7905', locations='[{u'url': u'swift+config://ref1/glance/1bf21cf3-8d39-40ae-b088-5549c31b7905', u'metadata': {}}]' |
| protected | False |
| schema | /v2/schemas/image |
| size | 3004956672 |
| status | active |
| tags | |
| updated_at | 2019-03-22T14:41:05Z |
| virtual_size | None |
| visibility | private |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Go further
Browse all the Compute guides.
Browse the rest of the OVHcloud US documentation for guides on our other products and services.
Learn more about Public Cloud Compute on the OVHcloud US website.