Migrate your VMs to a different region

To migrate a VM to a different region you 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.

Warning

This method includes turning off your VM, if you have any services running on it they will be unreachable during the migration process.

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. Switch to garr-ct1 - from the top navigation bar select the source region - garr-ct1

    ../../_images/mig0.png
  2. Shelve your VM - navigate to Compute/Instances section, find your VM and shelve it. This action will turn off the VM.

    ../../_images/mig23.png
  3. Note down your VM’s info - select the VM by clicking on it’s name in Instance Name column. In the VM’s 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
  4. Find your VM’s volumes - 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
  5. Upload each volume to an image - 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 a new image
      ../../_images/mig4.png
    • wait until the Upload process is completed
      ../../_images/mig5.png
  6. Note down info about network resources in garr-ct1 - navigate to Network/Security Groups, Network/Networks, Network/Routers, Network/Load Balancers and for each section note down the resources info. These resources must be recreated on garr-pa1 region with identical configurations (see step 7). If you don’t have a specific network configuration you can check only Network/Security Groups.

    • check if you have any Security Groups, and for each Security Group check the Rules. also check if you have created any rules inside “default” security group.

      ../../_images/mig24.png
    • check if you have created private networks and routers in your project. If not, the Network page will only show the shared networks “Default”, “floating-ip”, “iaas-pa-ext-net-DO-NOT-USE”, and the Routers page will be empty

      ../../_images/mig25.png
    • check if you have any Routers in your project
      ../../_images/mig26.png
    • check if you have any Load Balancers in your project
      ../../_images/mig27.png
  7. Recreate the network resources on garr-pa1 - from the top navigation bar select the destination region garr-pa1. Recreate Network/Security Groups, Network/Networks, Network/Routers and Network/Load Balancers on garr-pa1 (see step 6). If you don’t have a specific network configuration you can recreate only Network/Security Groups.

    ../../_images/mig7.png
  8. Check the images on garr-pa1 - now that we have recreated the resources on the new region garr-pa1 we can instantiate the VM. In Compute/Images section you should find the images that you have created on step 5.

    • test1_VDA_image

    • test1_VDB_image

    • test1_VDC_image

    ../../_images/mig8.png
  9. Launch a VM recreate the VM from the primary bootable image: test1_VDA_image (the one that has the operating system) with info from step 3.

    • 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. Create the volumes - recreate the volumes from 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. Attach the volumes to the VM - navigate to Compute/Instances and check if the VM was created successfully. Now we must attach all the secondary volumes to the VM. 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. For each volume X do the following:

    • From the dropdown select Attach Volume.
      ../../_images/mig17.png
    • Select the volume to attach
      ../../_images/mig18.png
  12. Reboot the VM after you attached all secondary volumes. Wait until the VM is Running.

    ../../_images/mig28.png
  13. Associate Floating IP - 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