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.