Tuesday, 16 July 2013

Eucalyptus 3.3 Tutorials- Gtting Started with EMIs

Eucalyptus 3.3 Tutorials
Getting Started with EMIs

In this set of tutorials, we are going have a look at the steps required to build your own EMI (Eucalyptus Machine Image).


An image is a fixed collection of software modules, system software, application software, and configuration information that is started from a known baseline (immutable/fixed). When bundled and uploaded to the Eucalyptus cloud, this becomes a Eucalyptus machine image (EMI).
A Eucalyptus Machine Image generally comprises of three important components:
  • kernel image, more specifically referred to as Eucalyptus Kernel Image (EKI)
  • ramdisk image, referred to as Eucalyptus Ramdisk Image (ERI)
  • one or more virtual hard disk image
Each of the images – EKI, ERI, and EMI – have associated XML files that contain meta-data info about the corresponding images respectively. 

There are two types of EMIs provided by Eucalyptus, instance store-backed and EBS-backed. In this set of tutorials, we will be looking at steps for creating both of them.

To know more about EMIs, you can read more at Eucalyptus User Guide 
In this tutorial, I am going to create a custom CentOS 64 Bit EMI.

You will need the following to get started with creating your own EMI:

  1. Qemu/ KVM installed and configured (I am going to use the Eucalyptus Frontend VM itself for this as it already has qemu set up and configured..)
  2. Atleast 5GB free space available
  3. Internet connectivity (You will require Internet Connectivity for downloading the necessary packages for your EMI)

NOTE: If your Eucalyptus Frontend does not have Internet connectivity, then no issues. You can follow the following steps to create a local yum repository on it. This will help you to install most of the necessary packages for your EMI. Its quick and simple. 
If you already have the requirements in place then proceed directly to the CREATE YOUR EMI section of this tutorial.
Firstly, mount a CentOS ISO (in this case, I am using a centOS 6.3 ISO) to your Eucalyptus Frontend VM. You can check whether the ISO was successfully mounted by using the mount command:

# mount

You should see the ISO mounted to /media directory as shown below:

Next step, is to edit our Local Repository file, in this case, its called as CentOS-Media.repo. These Repo files are typically found at /etc/yum.repo.d/ directory. 

Firstly, we create a temp directory and move all the other repo files to it, leaving just the CentOS-Media.repo file as shown below:
# cd /etc/yum.repo.d/
# mkdir oldrepos
The following command will move all items in /etc/yum.repo.d directory to oldrepos folder excepting the CentOS-Media.repo file
# find . -maxdepth 1 -mindepth 1 -not -name CentOS-Media.repo -print0 | xargs -0 mv -t oldrepos/

Once done, edit the CentOS-Media.repo file using any editor tool.

Make the following entries in it as shown:
  1. Change the baseurl to point to the exact same location as to where the CentOS ISO is mounted
  2. Change the parameter of gpgcheck variable to 0 (This will disable the gpgchecker)
  3. Change the parameter of enabled variable to 1 (This will enable your repo)

Once done, save the file and exit the editor.

Now, test your repository out with the following commands:

# yum clean all
# yum repolist

You should see an output similar to the one shown below. The repolist command will list the RPMs present in the ISO file (roughly 6,000 of them, depending on the CentOS ISO version as well..) If this returns error, then make sure your CentOS-Media.repo file does not contain any errors.

Once done, you care now ready to create your first CentOS EMI.

No comments :

Post a Comment