Export AWS EC2 AMI and Import It into E2E Cloud — Complete Guide
Introduction
E2E Networks Myaccount Portal allow users to import their customized images. User can bring in their golden images from the on-premises environment or from other cloud providers to the E2E’s Myaccount portal and use them to create virtual machines with their choice of Plans. This option saves time and effort required to set up and configure your node right from the scratch again to get your required golden stack in place.
In this guide,We will demonstrate how to create an Image from aws instance and convert it to required format which then can be imported to E2E's Myaccount portal.
Step 1 : Download and Install the Contextualization Packages and Dependencies
Before Proceeding with saving image of your Instance, You need to Download and Install the Contextualization Packages and Dependencies on your aws instance to make sure once the image is imported in Myaccount, the virtual machine initialization process works correctly.
VM initialization method
There are different methods to pass information to a newly created Virtual Machine. This information can be the network configuration of the VM, user credentials, init scripts, and free form data.
In our cloud platform, we use the OpenNebula context package for virtual machine initialization, which configures the network, sets the user credentials, sets hostname, adds provided SSH keys, etc.
Download and Installation of Contextualization Packages and Dependencies to your VM
CentOS/RHEL 6.x
wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context-5.8.0-1.el6.noarch.rpm
yum install -y epel-release
yum install -y one-context-[0-9]*el6*rpm
CentOS/Fedora/RHEL 7.x
wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context-5.8.0-1.el7.noarch.rpm
yum install -y epel-release
yum install -y one-context-[0-9]*el7*rpm
Debian/Ubuntu
wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context_5.8.0-1.deb
apt-get purge -y cloud-init
dpkg -i one-context_*deb || apt-get install -fy
OpenSUSE 42,15
wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context-5.8.0-1.suse.noarch.rpm
zypper --no-gpg-check install -y one-context-[0-9]*suse*rpm
Alpine Linux
wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context-5.8.0-r1.apk
apk add --allow-untrusted one-context-[0-9]*apk
FreeBSD 11,12
wget https://github.com/OpenNebula/addon-context-linux/releases/download/v5.8.0/one-context-5.8.0_1.txz
pkg install -y curl bash sudo base64 ruby open-vm-tools-nox11
pkg install -y one-context-[0-9]*.txz
Windows
Download the MSI package into C:\:
Or execute this command in powershell:
(New-Object Net.WebClient).DownloadFile("https://github.com/OpenNebula/addon-context-windows/releases/download/v5.8.0/one-context-5.8.0.msi", "C:\one-context-5.8.0.msi")
Double-click on the downloaded MSI package icon in the same way you open other documents to install it.
If you have cloud-init present in your virtual machine for initialization, please make sure that the respective cloud-init service is disabled on boot before taking the image. The cloud-init will conflict with the OpenNebula context package which may result in failure of virtual machine initialization process.
Supported image formats
E2E cloud-platform supports images in QCOW2, qed, raw, vdi, and vhd formats for import.
To save space and reduce import time you can also compress the file using gzip and tar compression formats.
Disk requirements
The image should contain single disk partition. The primary partition on the disk can be in any format that you like as long as it boots properly from the MBR bootloader. The disk should not be larger than 2048 GB (2 TB).
Step 2 : Create an Image of your aws instance
Once contextualization packages and dependencies are installed, You can power off your aws instance and Proceed with creating image.
For this tutorial purpose we are going to use centos7 instance of aws

You will be Prompt to enter the Image name and other details, after entering these details, The status of image creation will be shown at ami section
