Overview

Skill Level: Any Skill Level

Basic understanding of cloud concepts, Virtual machines and migration.

This Recipe covers easy option for migrating the VM from one cloud account to another.

Ingredients

Source and target account VM are using classic infrastructure. In other words, you are NOT migrating the VM from classic infrastructure to VPC infrastructure.

Step-by-step

  1. High Level Steps

    This migration method is based on Image template and public image option. High-level migration steps are-

    ·         Create VM image template

    ·         Make this image Public

    ·         Use this image in target account to launch new VM

    ·         After the migration, change the hostname to same as old one

  2. Create VM image template in Source

    Remember, this step will cause outage since it creates consistent image. Instance shutdown and startup is automatically taken care by create image process. Time required for backup is mainly dependent on used space inside the VM etc. In a sample test- For 135 GB backup, it took 12 minutes to complete.

    To initiate VM image template, open the VM and go to Action->Create Image template as shown below.

     

    Image-1

     

    This step will create a private image. To see this image, Go to Classic Infrastructure->Devices->Manage->Images

     

    Image-2

  3. Make this image Public

    To access this image from other account, you have 2 options, either copy this image to Cloud Object Storage (COS) and then access it using this storage in target account or simpler option is to make this image public. To do so, click on Image property and opt for Create public image as shown in below screenshot.

    Image-3

    This will ask for Public Image name and location. For privacy, give some meaningless name like- zCrrQt and choose the location similar to your target VM location. This will help in faster VM creation in target.

     

    Image-4

     

    This operation will finish almost immediately and you will be able to see this public image in Image repository by selecting -> Public Images (My images).

  4. Use this image in target account to launch new VM

    Now go to target account and open images (Classic Infrastructure->Devices->Manage->Images)

    Here select visibility option as “Public Images (All Images)” and search for your image with the name that you gave earlier. In this example- search with zCrrQt and you will see your image. Go to image property and select Order Public VSI as shown below.

     

    Image-5

     

    This will show you a wizard to select various configuration parameters like- Instance type, location etc.

     

    Image-6

     

    Image-8

     

    Image-9

     

    Select these options as per source VM configuration and your need and after filling these details, click on the agreement and Create.

    This will provision a new VM in target account using the image template from old account. This means you will get exactly same VM with all data and application intact.

  5. After the migration, change the hostname to same as old one

    Now last step would be to change the hostname to same as old environment. For hostname change, follow OS specific guidelines. Like- Windows hostname change or Linux hostname change.

    This will require a reboot of server so go ahead and reboot it. Once it comes up, you can access your application. Just make a note of new Public IP.

    If your application has MAC address based licensing then you will need to get fresh license as MAC addresses are neither retained during migration nor you are allowed to change it to any given value.

    Once you are happy with the new environment, quickly delete the public image from Old account and also shutdown/remove the VM from old account. You should also remove the private image that was created for this migration. This will help in saving the storage charges.

  6. Summary

    Using image template and public image concepts, it is very easy to lift and shift the VMs across the accounts. Special caution should be taken for naming the public image and this image should be deleted as soon as migration is done.

Join The Discussion