You are on page 1of 5

http://blog.prakharsrivastava.com/2011/04/eucalyptus-private-cloudsetup.

html

Eucalyptus Private Cloud Setup


It is not always possible for an organization to move into the public cloud. Most organizations do not want to or hesitate moving their organization's data into the cloud. However, cloud deployments can significantly bring down the operation costs of an organizations.

To fully utilize the resources, organizations have started drifting towards the private clous. According to a Gartener Research, the market for private clouds will double by year 2015 leading to more private cloud deployments in organization facing inefficient and underutilization of resources. There are already a number of open source cloud platforms that can convert any datacenter into a private cloud without any expenses. Opensource projects like Eucalyptus, Opennebula an Openstack are among the most promising open source initiatives bringing the industry standard cloud standards to the private cloud.While setting up private clouds is not rocket science, migration from datatcenter to a private cloud is a complex task. In this post, I will provide the setup for Eucaluptus Commmuntiy Editiion , one of the most popular open-source cloud computing framework. The installation step for eucalyptus are briefly described below.

Eucalyptus Front-end Installation


Installation from source: On a linux distribution, eucalyptus can be easily installed from source.(Assuming eucalyptus source and dependencies package are in home directory) export VERSION=2.0.1 ##### Install the eucalyptus dependencies.

apt-get install gcc make apache2-threaded-dev ant openjdk-6-jdk libvirt-dev libcurl4-dev dhcp3-server vblade apache2 unzip curl vlan bridge-utils libvirt-bin kvm sudo vtun
##### Untar eucalyptus-source tar zvxf eucalyptus-$VERSION-src-offline.tar.gz

cd eucalyptus-$VERSION export EUCALYPTUS_SRC=`pwd` export EUCALYPTUS=/opt/eucalyptus ##### Untar eucalytus-deps cd $EUCALYPTUS_SRC tar zvxf ../eucalyptus-$VERSION-src-deps.tar.gz mkdir -p $EUCALYPTUS/packages/ ####Build and install the dependencies cd $EUCALYPTUS/packages tar zxvf $EUCALYPTUS_SRC/eucalyptus-src-deps/axis2-1.4.tgz export APACHE_INCLUDES=/usr/include/apache2 export APR_INCLUDES=/usr/include/apr-1.0 ####Build Axis2C export AXIS2C_HOME=$EUCALYPTUS/packages/axis2c-1.6.0 cd $EUCALYPTUS_SRC/eucalyptus-src-deps/ tar zvxf axis2c-src-1.6.0.tar.gz cd axis2c-src-1.6.0 CFLAGS="-w" ./configure --prefix=${AXIS2C_HOME} --withapache2=$APACHE_INCLUDES --with-apr=$APR_INCLUDES --enable-multi-thread=no make make install ####Build Rampart export AXIS2C_HOME=$EUCALYPTUS/packages/axis2c-1.6.0 export LD_LIBRARY_PATH=${AXIS2C_HOME}/lib:$LD_LIBRARY_PATH cd $EUCALYPTUS_SRC/eucalyptus-src-deps/ tar zvxf rampartc-src-1.3.0-0euca1.tar.gz cd rampartc-src-1.3.0 ./configure --prefix=${AXIS2C_HOME} --enable-static=no --withaxis2=${AXIS2C_HOME}/include/axis2-1.6.0 make make install #####Modify axis2.xml nano $AXIS2C_HOME/axis2.xml ###Uncomment Security tag in both inflow and outflow section ####Set JAVA_HOME and JAVA export JAVA_HOME="/usr/lib/jvm/java-6-openjdk"

export JAVA="$JAVA_HOME/jre/bin/java" ####Build Eucalyptus Components cd $EUCALYPTUS_SRC ./configure --with-axis2=$EUCALYPTUS/packages/axis2-1.4 --withaxis2c=$EUCALYPTUS/packages/axis2c-1.6.0 --enable-debug -prefix=$EUCALYPTUS make make install ##### Enable services on the front-end useradd eucalyptus $EUCALYPTUS/usr/sbin/euca_conf -d $EUCALYPTUS --setup $EUCALYPTUS/usr/sbin/euca_conf -d $EUCALYPTUS --enable cloud --enable walrus --enable sc ####iSCSI (SCSI over IP) apt-get install tgt

# Start enabled front-end services


$EUCALYPTUS/etc/init.d/eucalyptus-cloud start # Start the cluster controller

$EUCALYPTUS/etc/init.d/eucalyptus-cc status
####Regiter Eucalyptus Components (Cluster, Walrus and Storage ) $EUCALYPTUS/usr/sbin/euca_conf --register-walrus 192.168.145.102 $EUCALYPTUS/usr/sbin/euca_conf --register-cluster iCloudCluster1 192.168.145.102 $EUCALYPTUS/usr/sbin/euca_conf --register-sc iCloudCluster1 192.168.145.102 ####Set Eucalyptus to start at boot time $EUCALYPTUS/etc/init.d/eucalyptus-cloud /etc/init.d/eucalyptus-cloud $EUCALYPTUS/etc/init.d/eucalyptus-cc /etc/init.d/eucalyptus-cc update-rc.d eucalyptus-cloud defaults

Eucalyptus Node Controller Installation


To install from source, follow the steps used for installing eucalyptus. (or use the installation script for installation eucalyptus)
$EUCALYPTUS/usr/sbin/euca_conf -d $EUCALYPTUS --setup

#Modify /etc/libvirt/qemu.conf user = "eucalyptus"

#Modify /etc/libvirt/libvirtd.conf

Line 1. #unix_sock_group = "libvirt" => unix_sock_group = "libvirt" Line 2. #unix_sock_ro_perms = "0777" => unix_sock_ro_perms = "0777" Line 3. #unix_sock_rw_perms = "0770" => unix_sock_rw_perms = "0770" Line 4. #auth_unix_ro = "none" => auth_unix_ro = "none" Line 5. #auth_unix_rw = "none" => auth_unix_rw = "none"
#Restart libvirtd

/etc/init.d/libvirt-bin stop /etc/init.d/libvirt-bin start chown root:libvirt /var/run/libvirt/libvirt-sock chown root:libvirt /var/run/libvirt/libvirt-sock-ro
#brctl show Modify /etc/network/interface Modify eth0 entry to and add bridge-ports

#Modify /etc/network/interfaces

Add bridge_ports all for dhcp and bridge_ports eth0 for static
#Restart Networking /etc/init.d/networking restart #Modify /etc/eucalyptus/eucalyptus.conf VNET_BRIDGE="" HYPERVISOR="xen" #Restart eucalyptus-nc /etc/init.d/eucalyptus-nc restart Tail the /var/log/eucalyptus/nc.log file to check if the eucalyptus-nc is communicating with the eucalyptus-cc. The nc.log file updates continuously with each line added when Eucalyptus-CC invokes describeResources() on the Eucalyptus-NC. At this point, the machine is configured with Xen and Eucalyptus Node Controller.

Using Euca2ools to interact with Eucalyptus


Log in into the Eucalyptus at

https://192.168.0.1:8443 For administrator: The default user id and password is admin. Log in and change the password and provide a valid email address at which you want to receive the approval mails. Download the credentials file to the local machine. The name of the file should be euca2-admin-x509.zip. Source the .eucarc file from the zip.

mkdir $HOME/.euca unzip euca2-admin-x509.zip -d $HOME/.euca . $HOME/.euca/eucarc Obtaining Xen Kernel Images 1. Xen kernel images can be downloaded from Eucalyptus Webite. However it is always possible to use the Dom0 kernel as DomU kernel. Generating the key euca-add-keypair mykey | tee mykey.private chmod 0600 mykey.private
(Remember the location of the key as this will be the directory from where you will be able to ssh into your instances.)

Registering the kernel euca-bundle-image -i --kernel true euca-upload-bundle -b -m /tmp/.manifest.xml euca-register /.manifest.xml Registering the ramdisk euca-bundle-image -i --ramdisk true euca-upload-bundle -b -m /tmp/.manifest.xml euca-register /.manifest.xml Registering the Virtual Machine Image euca-bundle-image -i euca-upload-bundle -b -m /tmp/.manifest.xml

euca-register /.manifest.xml Run the instance euca-run-instances -k mykey -n euca-describe-instance Displaying the running Instance euca-describe-instances Displaying the stored images euca-describe-images To display the availabilty zones euca-describe-availabilty-zones verbose

-t

--kernel

--ramdisk

You might also like