Migrate a VM to a different region¶
To migrate a VM to a different region we can create an Image from it’s main bootable volume (usually mounted on /dev/vda) on the source region and use that Image to instantiate a new VM on the destination region.
In this example we will migrate a VM named test1 from the garr-ct1 region to garr-pa1 region.
From the top navigation bar select 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, http 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 usually the volume where the operating system is stored. In our case we have the following
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
From the top navigation bar select garr-pa1
On the garr-pa1 region recreate Network/Security Groups, Network/Networks, Network/Routers and Network/Load Balancers with the same settings as on garr-ct1 region.
Navigate to Compute/Images you should find the following images
test1_VDA_image
test1_VDB_image
test1_VDC_image
Find the main 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.
Find the secondary volume images - test1_VDB_image and test2_VDB_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.
From the dropdown on the right select Attach Interface. 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.