Eucalyptus is opensource cloud computing software designed for private as well as public clouds. It pools together existing virtualized infrastructure to create cloud resources for compute, network and storage.
Today I am going to tell you how to install and operate Eucalyptus software that can help you to build the cloud VM instances.
VM instances are the instances, that are the end product of the software. We go through a number of steps to install Cloud software. In the VM instances we will have the IP of the virtual machine. We can enter that machine using various tools such as SSH and work on that machine. We can also clone that machine and use whenever we required.
Since I am working with opensource projects, so I will work with eucalyptus on RedHat Enterprise linux 5.6, however it doesn't matter which Operating system you are using.
1. Install rhel 5.6 on a machine, suggested machine should have larger resources than a normal machine. Also turn off the features such as firewall, IPtables etc on the boot time. Also ensure that yum is working on the system.
2. Download the java modules from the website. Following modules are sufficient.
3. Install ntp on the machine and sync your system with pool.ntp.org as
# yum install ntp
# ntpdate pool.ntp.org
4. Now install following packages, these are the dependencies for installing the main packages. Resolve the dependencies and install as:
# yum install -y ant ant-nodeps dhcp bridge-utils perl-convert-ASN1.noarch scsi-target-utils httpd
5. Download the main packages from following links:
Extract the downloaded tar files and create a repository from that. Copy those packages in a directory and make that make that repository available by yum. Now install the main eucalyptus tools as:
# yum install eucalyptus-cloud eucalyptus-cc eucalytpus-walrus eucalyptus-sc euca2ools
6. Restart the services of eucalyptus:
# /etc/init.d/eucalyptus-cc restart; chkconfig eucalyptus-cc on
#/etc/init.d/eucalytpus-cloud restart; chkconfig eucalytus-cloud on
Now Install a virtual machine on the same system, you can use KVM virtual machine. If you don't know how to do this, refer to my post KVM.
After you successfully install the virtual machine, create yum on that virtual machine in the same way as on the base machine.
On node controller(VM):
Now sync the time zone with pool.ntp.org as
# yum install ntp -y
# ntpdate pool.ntp.org
Now install xen on the virtual machine as:
# yum install xen -y
when completed, restart the system with xen kernel and modify the following:
# sed --in-place 's/#(xend-http-server no)/(xend-http-server yes)/' /etc/xend/xend-config.sxp
# sed --in-place 's/#(xend-address localhost)/(xend-address localhost)/' /etc/xend/xend-config.sxp
Restart the service of xend as:
# /etc/init.d/xend restart
Make sure that all the security features are disabled, for example, firewall IPTABLES. Now install the node controller on VM machine.
# yum install eucalyptus-nc -y
When completed open the configuration file of libvirtd and add
# vim /etc/libvirt/libvirt.conf
uncomment the following lines:
save and exit.
Now restart the service of node controller.
# /etc/init.d/eucalyptus-nc restart; chkconfig eucalyptus-nc on
This document describe the steps to install eucalyptus on single machine. However, these components if installed on different machines then we need to register all the components so that they can communicate with each other. For making these components to communicate with each other we will register all the components as:
We assume that all the components are installed and running.
# $EUCALYPTUS/usr/sbin/euca_conf --register-walrus 192.168.100.1
# $EUCALYPTUS/usr/sbin/euca_conf --register-cluster cluster_name 192.168.100.1
# $EUCALYPTUS/usr/sbin/euca_conf --register-sc cluster_name 192.168.100.1
# $EUCALYPTUS/usr/sbin/euca_conf --register-walrus 192.168.100.1# $EUCALYPTUS/usr/sbin/euca_conf --register-walrus 192.168.100.1 # $EUCALYPTUS/usr/sbin/euca_conf --register-nc "192.168.100.2# $EUCALYPTUS/usr/sbin/euca_conf --register-walrus 192.168.100.1"
Where 192.168.100.1 is the IP of the base machine and 192.168.100.2 is the IP of the virtual machine. When all the components are registered successfully, login to
this will prompt you username and password, which by default set to admin and admin.
When you login, you will be forced to change the password for admin and your email address will be asked.
Now download the credentials from graphical menu.
# mkdir /.euca
# unzip euca2-admin* -d /.euca/
The above command will unzip the contents in the above directory. Run this command to use your credentials if required.
# . /.euca/eucarc
Now download the 64 bit image from following url:
# wget http://open.eucalyptus.com/sites/all/modules/pubdlcnt/pubdlcnt.php?file=http://www.eucalyptussoftware.com/downloads/eucalyptus-images/euca-centos-5.3-x86_64.tar.gz&nid=4305
Extract the downloaded image as:
To enable a VM image as an executable entity, a user/admin must add a root disk image, a kernel/ramdisk pair (ramdisk may be optional) to Walrus and register the uploaded data with Eucalyptus.
Each is added to Walrus and registered with Eucalyptus separately, using three EC2 commands. The following example uses the test image that we provide. Unpack it to any directory. Add the kernel to Walrus, and register it with Eucalyptus (WARNING: your bucket names must not end with a slash!):
# tar zxvf euca-centos-5.3-x86_64.tar.gz
# cd euca-centos-5.3-x86_64
# euca-bundle-image -i xen-kernel/vmlinuz-18.104.22.168-0.1-xen --kernel true
# euca-upload-bundle -b centos-kernel-bucket -m /tmp/vmlinuz-22.214.171.124-0.1-xen.manifest.xml
# euca-register centos-kernel-bucket/vmlinuz-126.96.36.199-0.1-xen.manifest.xml
# euca-bundle-image -i xen-kernel/initrd-188.8.131.52-0.1-xen --ramdisk true
# euca-upload-bundle -b centos-ramdisk-bucket -m /tmp/initrd-184.108.40.206-0.1-xen.manifest.xml
# euca-register centos-ramdisk-bucket/initrd-220.127.116.11-0.1-xen.manifest.xml
Next, add the root filesystem image to Walrus:
# euca-bundle-image -i centos.5-3.x86-64.img --kernel eki-8D7316E7 --ramdisk eri-87EE16CF
# euca-upload-bundle -b centos-image-bucket -m /tmp/centos.5-3.x86-64.img.manifest.xml
# euca-register centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
=> Now, configure the dhcp server.
First copy the /usr/share/doc/dhcp3.0.5/dhcpd.conf.sample to /etc/dhcpd.conf
# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
# vim /etc/dhcpd.conf
Configure DHCP in this file.
=> Restart the service of dhcp
# /etc/init.d/dhcpd restart
Once the image is added, you can see the added image as:
We add keypairs to ssh the remote computer with password authentication.
# euca-add-keypair mykey > mykey.private
change the permission of mykey.private
#chmod 0600 mykey.private
Now run instances using following command:
# euca-run-instances -k mykey -n 1 <emi-id>
This will show the list of the instances, with ipaddresses.
Now ssh to the ip using following command.
# ssh -i .euca/mykey.private -l root 192.168.100.1 -v
you will get the command line access of the vm created.