Thursday, March 7, 2013

EucaStart 2.0 Stage 5 - Install & Configure: Populating your image catalogue

As part of the EucaStart 2.0 engagement process, Eucalyptus Professional Services is providing detailed information on each stage of an IaaS cloud deployment in an open and transparent way for all to modify and implement. We hope this will help guide our users, customers and partners to setup successful IaaS cloud deployments

These topics are a work in progress, so we'd very much welcome your feedback and support if you would like to contribute. 


Populating your cloud 


In my last post I covered an overview of the Eucalyptus installation. This post will cover an overview of importing images into your Eucalyptus cloud, which will allow you to build up an image catalogue for your end users. Images are important as they form the basis of what your cloud users will interact with and having a useful set of up-to-date images will attract more users to your cloud. 


Eustore


Eustore is the Eucalyptus online image store containing some pre-configured images for CentOS, Fedora and OpenSuSE and is by far the easiest way to get images into your cloud. These images have been built to have a very minimal package set and a root disk of under 5GB. SElinux is disabled along with the iptables firewall, as you can use Eucalyptus security groups as the firewall. We have also allowed root logins via ssh, however this is restricted to the ssh keypair which you launch the instance with.

To install a CentOS 6 image from Eustore you can run the following commands:
 # List images in eustore available to be installed  
 eustore-describe-images  
 # Install centos6 image, into the centos6 bucket for the kvm hypervisor  
 eustore-install-image -b centos6 -k kvm -i 386865203  

This last step takes care of downloading the image and the bundle, upload and register process for the kernel, ramdisk and image.

The Eucalyptus Administration Guide contains further information on eustore.

Ubuntu


The Ubuntu project produce their own images which are regularly updated, visit their images website to download the Ubuntu image of your choice:




To upload a Ubuntu 12.04 LTS image to your cloud you can use the following steps:
 # Source your cloud credentials to the environment  
 source ~/creds/eucarc  
 # Make a directory to temporarily store your images  
 mkdir ~/images && cd ~/images  
 # Download the latest image image  
 wget -c http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64.tar.gz  
 # Uncompress the image  
 tar -xvf precise-server-cloudimg-amd64.tar.gz  
 # Bundle, upload and register the kernel  
 euca-bundle-image -i precise-server-cloudimg-amd64-vmlinuz-virtual --kernel true  
 euca-upload-bundle -b ubuntu-precise -m /tmp/precise-server-cloudimg-amd64-vmlinuz-virtual.manifest.xml  
 euca-register -a x86_64 ubuntu-precise/precise-server-cloudimg-amd64-vmlinuz-virtual.manifest.xml  
 # Bundle, upload and register the image, where EKI-XXXXX is the output from the previous command  
 euca-bundle-image -i precise-server-cloudimg-amd64.img --kernel <EKI-XXXXXX>  
 euca-upload-bundle -b ubuntu-precise -m /tmp/precise-server-cloudimg-amd64.img.manifest.xml  
 euca-register -a x86_64 ubuntu-precise/precise-server-cloudimg-amd64.img.manifest.xml  

That’s it! The Eucalyptus Machine Image (EMI) identifier will be displayed on the output of the last command, which can be used to identify the image within your image listing.


Ami-creator


If you are interested in building your own images from scratch, ami-creator is a great python based tool that will help you build images for CentOS and Fedora using a kickstart. You may want to carry out these steps on a spare system or test instance inside your cloud.

Follow the steps below to create a CentOS 6 image suitable for Eucalyptus or AWS:
 # Install the dependancies  
 yum -y install python-setuptools python-imgcreate  
 easy_install ez_setup  
 # Clone the latest release of the ami-creator script  
 git clone https://github.com/katzj/ami-creator.git  
 # Setup ami-creator  
 cd ami-creator/  
 python setup.py build  
 python setup.py install  
 # Create an image build directory  
 mkdir centos6-image  
 # You can either use the default kickstart and modify it  
 # or download one that we use regularly from: https://gist.github.com/tomellis/5064218  
 cp ks-centos6.cfg centos6-image/  
 cd centos6-image  
 # Build the image  
 ami-creator -c ks-centos6.cfg -n centos6 -v -e  


At the end of the build process you will have a number of files, including the image, kernel and ramdisk ready for upload to Eucalyptus:
 # Bundle, upload and register the kernel  
 euca-bundle-image -i vmlinuz-2.6.32-279.22.1.el6.x86_64 --kernel true  
 euca-upload-bundle -b centos6-amicreator -m /tmp/vmlinuz-2.6.32-279.22.1.el6.x86_64.manifest.xml  
 euca-register -a x86_64 centos6-amicreator/vmlinuz-2.6.32-279.22.1.el6.x86_64.manifest.xml  
 # Bundle, upload and register the ramdisk  
 euca-bundle-image -i initramfs-2.6.32-279.22.1.el6.x86_64.img --ramdisk true  
 euca-upload-bundle -b centos6-amicreator -m /tmp/initramfs-2.6.32-279.22.1.el6.x86_64.img.manifest.xml  
 euca-register -a x86_64 centos6-amicreator/initramfs-2.6.32-279.22.1.el6.x86_64.img.manifest.xml  
 # Bundle, upload and register the image  
 # XXXXXXX is the ERI ID and EKI ID returned by the previous steps  
 euca-bundle-image -i centos6.img --ramdisk eri-XXXXXXXXE --kernel eki-XXXXXXXX  
 euca-upload-bundle -b centos6-amicreator -m /tmp/centos6.img.manifest.xml  
 euca-register -a x86_64 centos6-amicreator/centos6.img.manifest.xml  

That's it, a custom CentOS image build from scratch and uploaded to your private cloud.


Windows


We don't provide pre-built Windows images for licensing reasons, however we do provide comprehensive documentation on how to build your images including the installation of the VirtIO drivers through the Eucalyptus Windows Integration Toolkit.

No comments:

Post a Comment