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.

  1. From the top navigation bar select the source region - garr-ct1

    ../../_images/mig0.png
  2. 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

    ../../_images/mig1.png
  3. 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

    ../../_images/mig2.png
  4. For each volume X repeat the following steps:

    • from dropdown select Upload to image

    ../../_images/mig3.png
    • name the new image test1_VDX_image, check Force and leave Disk Format to RAW.

    • click on Upload to create the new image

    ../../_images/mig4.png
    • wait until the Upload process is completed

    ../../_images/mig5.png
  5. 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”

    ../../_images/mig24.png
    • check if you have any Networks defined, ignore “default”, “floating-ip” and “iaas-pa-ext-net-DO-NOT-USE”

    ../../_images/mig25.png
    • check if you have any Routers defined

    ../../_images/mig26.png
    • check if you have any Load Balancers defined

    ../../_images/mig27.png
  6. From the top navigation bar select the destination region - garr-pa1

    ../../_images/mig6.png
  7. On the garr-pa1 region recreate Network/Security Groups with the same Rules as on garr-ct1 region (see step 5).

    ../../_images/mig7.png
  8. Navigate to Compute/Images, you should find the following images

    • test1_VDA_image

    • test1_VDB_image

    • test1_VDC_image

    ../../_images/mig8.png
  9. 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

    ../../_images/mig9.png
    • the source image is already set - test1_VDA_image (no action required)

    ../../_images/mig10.png
    • use the same flavor from step2 - c1.small

    ../../_images/mig11.png
    • select the same networks from step 2 - default

    ../../_images/mig12.png
    • select the same security groups from step 2 - default, http, ssh

    ../../_images/mig13.png
    • select the same key from step 2 - avram

    ../../_images/mig14.png
  10. Find the secondary volume images: test1_VDB_image, test1_VDC_image.

    • For each image select Create Volume.

    ../../_images/mig15.png
    • Name the volumes test1_VDB_volume and test1_VDC_volume.

    ../../_images/mig16.png
  11. Navigate to Compute/Instances and check if the VM was created successfully.

    • From the dropdown select Attach Volume.

    ../../_images/mig17.png
    • 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.

    ../../_images/mig18.png ../../_images/mig19.png
  12. 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.

  13. 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.

    ../../_images/mig20.png
    • In our case the only network used is “default” so you can skip this step

    ../../_images/mig21.png
  14. 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.

    ../../_images/mig22.png
  15. 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

    ../../_images/mig23.png