Migrate your VMs to a different region¶
To migrate a VM to a different region we can create an Image from it’s primary bootable volume (usually mounted on /dev/vda) on the source region and use that Image to instantiate a new VM on the destination region.
Warning
you must have sufficient quotas on the destination region to complete the migration successfully.
In this example we will migrate a single VM named test1 and all its associated resources from the garr-ct1 region to garr-pa1 region.
From the top navigation bar select the source region - garr-ct1
Navigate to Compute/Instances and select test1. On the overview page you can visualize the VM metadata, note down the following info
Name - test1
Flavor - c1.small
Networks - default
Security Groups - default, ssh and http
Metadata Key Name - avram
Navigate to Volumes/Volumes and find your VM’s volumes. Look up the Attached to field, it contains the VM-name and the mountpoint. The volume mounted on /dev/vda is the volume where the operating system is stored. In our case we have the following volumes:
4cfa41a6-0104-4012-8db3-185bc7d81ed9 - /dev/vda on test1
test1_VDB_volume - /dev/vdb on test1
test1_VDC_volume - /dev/vdc on test1
For each volume X repeat the following steps:
from dropdown select Upload to image
name the new image test1_VDX_image, check Force and leave Disk Format to RAW.
click on Upload to create the new image
wait until the Upload process is completed
Navigate to Network/Security Groups, Network/Networks, Network/Routers, Network/Load Balancers and for each section note down the resources info. If you don’t have a specific network configuration you can check only Network/Security Groups.
check if you have any Security Groups defined, ignore “default”
check if you have any Networks defined, ignore “default”, “floating-ip” and “iaas-pa-ext-net-DO-NOT-USE”
check if you have any Routers defined
check if you have any Load Balancers defined
From the top navigation bar select the destination region - garr-pa1
On the garr-pa1 region recreate Network/Security Groups with the same Rules as on garr-ct1 region (see step 5).
Navigate to Compute/Images, you should find the following images
test1_VDA_image
test1_VDB_image
test1_VDC_image
Find the primary bootable image: test1_VDA_image (the one that has the operating system) select Launch and use the info from step2 to create a new VM test1.
use the same name from step 2 - test1
the source image is already set - test1_VDA_image (no action required)
use the same flavor from step2 - c1.small
select the same networks from step 2 - default
select the same security groups from step 2 - default, http, ssh
select the same key from step 2 - avram
Find the secondary volume images: test1_VDB_image, test1_VDC_image.
For each image select Create Volume.
Name the volumes test1_VDB_volume and test1_VDC_volume.
Navigate to Compute/Instances and check if the VM was created successfully.
From the dropdown select Attach Volume.
Attach one volume at a time in the following order: test1_VDB_volume, test1_VDC_volume. First goes the volume that was mounted on /dev/vdb on the old VM on garr-ct1 then the volume that was mounted on /dev/vdc and so on.
Recreate Network/Networks, Network/Routers and Network/Load Balancers with the same settings as on garr-ct1 region (see step 5). If you don’t have specific network configurations you can skip this step.
From the dropdown on the right select Attach Interface. If your VM wasn’t attached to a different network apart from “default” you can skip this step.
Attach one network interface at a time.
In our case the only network used is “default” so you can skip this step
From the dropdown on the right select Associate Floating IP to add a floating IP. You cannot use the same Floating IP of the VM on the source region, each region has a specific set of IP addresses that can be allocated for the VMs to use. If you use a DNS service you should also consider updating the record with the new allocated IP address.
From the top navigation bar select the source region - garr-ct1 and navigate to Compute/Instances.
from the dropdown select Shelve Instance to turn off the old VM