HOW-TO : Migrate instances from AWS to Oracle Cloud

Migrate to cloud is not an easy project and requires hard planning and preparation to guarantee a sophisticated, well-working IT infrastructure.

In this post, we will provide a step-by-step demonstration on how to move instances from AWS to Oracle cloud. All these steps can help to migrate from a VMware on-premise infrastructure too.

STEP 00: Connect to your EC2 instance and Enable the Serial Console

This is a very important step in order to enable the console connection when the instance is provisioning on OCI. That is done by using the following commands:

Edit the /etc/default/grub file to update the following values:

Replace GRUB_TERMINAL=”console” with GRUB_TERMINAL=”console serial”

Add GRUB_SERIAL_COMMAND=”serial –unit=0 –speed=115200″

Replace GRUB_CMDLINE_LINUX=”” with GRUB_CMDLINE_LINUX=”console=tty0 console=ttyS0,115200″

Next, you need to regenerate the initramfs as follow:

grub2-mkconfig -o /boot/grub2/grub.cfg

To verify, reboot the instance, and then run dmesg | grep console==tty* and look for the updated kernel parameters.

STEP 01: Convert the EC2 instance into a .ova file

Use the AWS cli to export the EC2 instance. For more information, see AWS Command Line Interface User Guide.

aws ec2 create-instance-export-task –instance-id i-008e12742fcee9786 –description “Export-To-OCI” –target-environment vmware –export-to-s3-task DiskImageFormat=vmdk,ContainerFormat=ova,S3Bucket=BuketName

STEP 02: Download the vmdk file from AWS S3 buckets

aws s3 cp s3://bucketname/filename c:\path-to-save

STEP 03: Upload the vmdk to OCI S3 buckets

Use OCI CLI to upload vmfk file to OCI S3 bucket, for more information about OCI, see OCI cli quick start

oci os object put –bn bucket name –file c:\xxxxxx.vmdk

All the processes and the rest of the steps are detailed in this video.

Please note, exporting instances and volumes is subject to the following limitations:

  • You cannot export a VM if it contains third-party software provided by AWS. For example, VM Export cannot export Windows or SQL Server instances, or any instance created from an image in the AWS Marketplace.
  • You must export your instances and volumes to one of the following image formats that your virtualization environment supports:
      • Open Virtual Appliance (OVA)
      • Virtual Hard Disk (VHD)
      • Stream-optimized ESX Virtual Machine Disk (VMDK)
  • You can’t export Amazon EBS data volumes.
  • You can’t export an instance that has more than one virtual disk.
  • You can’t export an instance that has more than one network interface.
  • You can’t export an instance from Amazon EC2 if you’ve shared it from another AWS account.
  • You can’t have more than five export tasks per Region in progress at the same time.
  • VMs with volumes larger than 1 TiB are not supported.
  • You can export a volume to either an unencrypted S3 bucket or to a bucket encrypted using SSE-S3.

Enjoy! 

6 thoughts on “HOW-TO : Migrate instances from AWS to Oracle Cloud”

  1. In the video, you downloaded an .ova file from S3 and uploaded a .vmdk file to OCI bucket. Is that the same file that was renamed or is there a step to convert ova to vmdk?

    1. The .ova file is essentially an archive, containing a vmdk file and a metadata file (which contains a sckum and can be deleted). So basically .ova = .vmdk.

  2. Hi. What versions of Ubuntu is this? I guess it must be really recent as I think you normally need to install and include the virtio drivers in the initramfs for it to boot successfully in OCI. I guess this version must have the drivers already? Thanks.

  3. # Description of Vultr as a cloud infrastructure provider
    # Emphasizes their reliability and flexibility
    # Mention of their target audience, including developers, businesses, and individuals
    # Highlighting their global presence with multiple data centers
    # Mention of fast and efficient cloud hosting solutions
    # Explanation of the services they offer, including virtual servers, storage, and networking
    # Emphasis on scalability and optimal performance
    # Encouragement to visit Vultr’s website for more information
    https://www.vultr.com/?ref=9497454

Leave a Reply

Your email address will not be published. Required fields are marked *