Tuesday, 30 July 2013

Eucalyptus 3.3 Tutorials- Uploading EMI

Eucalyptus 3.3 Tutorials
Uploading Custom Built EMIs

In this tutorial, we are going have a look at the steps required to build a upload our CentOS-based Instance-store-backed EMI to Eucalyptus.

To upload the image, follow these simple steps once you have created your custom EMI.
First, we need to bundle our Image. To do so, run the following command:
To bundle an image, we use "euca-bundle-image"


euca-bundle-image -r <Architecture> -i <Image_Name>.img


euca-bundle-image -r x86_64 -i yoyoclouds-centos6-x86-64.img

The above command packages the kernel image and generates a manifest.xml file under /tmp directory.

We will pass the full path to the manifest file as an argument to euca-upload-bundle to upload the image to Eucalyptus.
Next, we upload the bundle an image, we use "euca-bundle-image"


euca-upload-bundle -b <bucket_name> -m <manifest_file>.xml


euca-upload-bundle -b yoyoclouds -m /var/tmp/bundle-vUIIz7/yoyoclouds-centos6-x86-64.img.manifest.xml

Next, we need to registers the manifest generated from our earlier step for use with the Eucalyptus cloud. To do this, we use the "euca-register" command

euca-register -n <Image_Name> -d <Image_Description>

Code: euca-register -n 'myimage' -d <My Custom Image>

This will provide you an EMI ID as shown below:

NOTE: The Images that you upload to Eucalyptus are set to 'Private' by default from Eucalyptus version 3.2 onwards. Before you start using the Image, you need to change its attributes to 'Public'. This is achieved by using the "euca-modify-image-attribute" command:

euca-modify-image-attribute -l -a all <EMI_ID>

euca-modify-image-attribute -l -a all emi-D8523D44

Once these basic steps are done, the rest remains the same. Create a Security Group and a Key Pair for accessing your Instance. Make sure you open up port 22 (SSH) for accessing your Instance. Provide necessary permission (chmod 600) to your Key Pair file. Once set, Launch your instance associated with the Security Group and the Key Pair.

Log in to your instance using ssh and the Key Pair that you used to associate the instance with.

That's all there is to it !! Stay tuned for the next and most interesting part of Eucalyptus 3.3 coming up next !! The Autoscaling functionality !!

>> Eucalyptus Tutorials: Getting Started with Autoscaling

No comments :

Post a Comment

Note: only a member of this blog may post a comment.