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)
Instructions
Create a backup
Next, run the following command to create a backup of your instance:
$ openstack server image create --name snap_server1 aa7115b3-83df-4375-b2ee-19339041dcfa
Download the backup
Next, run this command to list available instances:
$ openstack image list --long
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.
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
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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 |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Create an instance from your backup
To create an instance from your backup, use the backup ID as the image with this command:
$ openstack server create --key-name SSHKEY --flavor 98c1e679-5f2c-4069-b4da-4a4f7179b758 --image 0a3f5901-2314-438a-a7af-ae984dcbce5c --network Ext-Net Guide-test-va1-from-snap
Go further
For more information and tutorials, please see our other Public Cloud support guides or explore the guides for other OVHcloud products and services.