Corporate Home Open Source Home
Syndicate content
Eucalyptus

Eucalyptus Source Code (1.1)

Disclaimer: Installing this version of Eucalyptus from source is not a trivial matter. The combination of our limited resources and the unlimited variety of cluster configurations means that we may be incapable of assisting those who run into problems installing Eucalyptus from source code.

The following "cook book" illustrates how we build, deploy, and test Eucalyptus.

A Eucalyptus cloud setup consists of three types of components -- the cloud controller, the cluster controller(s), and the node controller(s). The cloud controller is a Java program that, in addition to high-level resource scheduling and system accounting, offers a Web services interface and a Web interface to the outside world. Cluster controller and node controller are written in C and deployed as Web services inside Apache.

Communication among these three types of components goes over SOAP with WS-security. There is one cluster controller per cluster, running on the head node; there is one node controller per each compute node, running as root in dom0. So, if you are installing Eucalyptus on one cluster, then one cloud and one cluster controller should be deployed on the head node and one node controller should be deployed on each compute node.

1. Download Eucalyptus

Download eucalyptus-1.1-src.tar.gz from http://eucalyptus.cs.ucsb.edu/downloads

$ tar zvxf eucalyptus-1.1-src.tar.gz 
$ cd eucalyptus-1.1-src
$ export EUCALYPTUS_SRC=`pwd`

Pub the following variable definitions into file named Makedefs:

export EUCALYPTUS=${EUCALYPTUS_SRC}/deployed/eucalyptus-1.1
export AXIS2_HOME=${EUCALYPTUS_SRC}/deployed/packages/axis2-1.4
export AXIS2C_HOME=${EUCALYPTUS_SRC}/deployed/packages/axis2c-1.4.0
export LIBVIRT_HOME=${EUCALYPTUS_SRC}/deployed/packages/libvirt-0.4.2
export GWT_HOME=${EUCALYPTUS_SRC}/deployed/packages/gwt-1.4.62

We assume that you are using the "bash" shell, but these instructions should be altered to reflect the corresponding commands for your shell.

$ source Makedefs

Set NFS_SHARE environment variable to point the location of a NFS-shared directory that will be shared between nodes and the cluster controller. It should have ample space for VM images, which can be several GB in size each.

2. Dependencies

To install Eucalyptus, you need to build packages that Eucalyptus depends on. Source tarballs for these are provided on the Eucalyptus downloads page. Please untar/unzip these before proceeding. For the sake of this discussion, we are going to assume that all packages are installed in "$EUCALYPTUS_SRC/deployed/packages":

$ mkdir -p $EUCALYPTUS_SRC/deployed/packages

The dependencies can be built as follows:

a. GWT

$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf gwt-1.4.62.tar.gz

b. Axis2

$ cd $EUCALYPTUS_SRC/deployed/packages
$ unzip axis2-1.4-bin.zip

c. Apache (Httpd)

The Eucalyptus node and cloud controller depend on Apache 2. We rely on running apache as root, therefore we recommend that apache 2 be installed separately from the webserver that might be included as part of your distribution.

$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf httpd-2.2.8-src.tar.gz
$ cd httpd-2.2.8
$ CFLAGS="-DBIG_SECURITY_HOLE" ./configure --prefix=$EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8
$ make ; make install

d. Axis2/C

$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf axis2c-src-1.4.0.tar.gz
$ cd axis2c-src-1.4.0
$ ./configure --with-apache2=$EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/include --prefix=${AXIS2C_HOME}
$>make ; make install

e. Libvirt

$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf libvirt-0.4.2-src.tar.gz
$ cd libvirt-0.4.2 
$ ./configure --prefix=$EUCALYPTUS_SRC/deployed/packages/libvirt-0.4.2
$ make ; make install

f. Rampart/C

$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf rampartc-src-1.2.0.tar.gz
$ cd rampartc-src-1.2.0  
$ export LD_LIBRARY_PATH=${AXIS2C_HOME}/lib:$LD_LIBRARY_PATH
$ ./configure --prefix=${AXIS2C_HOME} --enable-static=no --with-axis2=${AXIS2C_HOME}/include/axis2-1.4.0
$ make ; make install

g. VDE

$ cd $EUCALYPTUS_SRC/deployed/packages
$ tar zvxf vde-2.2.0-pre3.tgz
$ cd vde-2.2.0-pre3
$ ./configure --prefix=$EUCALYPTUS_SRC/deployed/packages/vde-2.2.0-pre3 --enable-cryptcab --enable-experimental
$ make ; make install

f. Other software

The following dependencies need to be met:

  • Java Runtime (JRE) version 1.6 or above
  • Apache ant
  • Maven version 2 or above

2. Building Eucalyptus

The following commands MUST be run as the superuser (root). This will build the cloud controller.

# cd $EUCALYPTUS_SRC/clc
# ant clean deps build jce setup

To build the node and the cluster controller, in the top level Eucalyptus source directory:

# cd $EUCALYPTUS_SRC
# make build
# make deploy

3. Configuring Eucalyptus

a. Axis2/C configuration

$ cd $EUCALYPTUS_SRC/deployed/packages/axis2c-1.4.0

Edit axis2.xml and search for "Security", changing

  <!--phase name="Security"/-->

to

  <phase name="Security"/>

Save the file.

b. Apache2 configuration

Copy over axis2 apache module

$ cp $EUCALYPTUS_SRC/deployed/packages/axis2c-1.4.0/lib/libmod_axis2.so.0.4.0 $EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/modules/mod_axis2.so

Modify $EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/conf/httpd.conf, adding the following lines:

LoadModule axis2_module modules/mod_axis2.so
Axis2RepoPath <full path to eucalyptus top level source>/deployed/packages/axis2c-1.4.0
Axis2LogFile <full path to eucalyptus top level source>/deployed/packages/axis2c-1.4.0/logs/axis2.log
Axis2MaxLogFileSize 128
Axis2LogLevel trace
<Location /axis2>
        SetHandler axis2_module
</Location>

Change the following lines:

  • Listen 80 to Listen 9090
  • User daemon to User root
  • Group daemon to Group root

Uncomment the following:

Include conf/extra/httpd-mpm.conf

Modify $EUCALYPTUS_SRC/deployed/packages/httpd-2.2.8/conf/extra/httpd-mpm.conf, changing:

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

to:

<IfModule mpm_prefork_module>

    StartServers          0
    MinSpareServers       1
    MaxSpareServers       0
    MaxClients            1
    MaxRequestsPerChild   0
</IfModule>

In the top level Eucalyptus source directory (cd $EUCALYPTUS_SRC), create the vde key:

$ ssh-keygen -t rsa1 -b 768 -f $EUCALYPTUS/var/eucalyptus/keys/vdekey -N ''

Copy the Eucalyptus configuration file

$ cp $EUCALYPTUS_SRC/tools/eucalyptus.conf $EUCALYPTUS/etc/eucalyptus/

and edit it ($EUCALYPTUS/etc/eucalyptus/eucalyptus.conf), as follows:

  • Set the EUCALYPTUS variable
  • Set CC_PORT and NC_PORT to 9090
  • Set NODES to fully qualified hostname of node controllers (space separated)
  • TEMPLATE_PATH=$NFS_SHARE/templates
  • REGISTERED_PATH=$NFS_SHARE/registered (remember to create these "templates" and "registered" directories)
  • Set INSTANCE_PATH to point to a local directory and create this directory on the nodes.

Create symlinks:

$ mkdir $EUCALYPTUS/bin
$ mkdir $EUCALYPTUS/lib
$ ln -s $EUCALYPTUS_SRC/deployed/packages/*/bin/* $EUCALYPTUS/bin
$ ln -s $EUCALYPTUS_SRC/deployed/packages/*/lib/* $EUCALYPTUS/lib

Add $EUCALYPTUS/bin to your PATH and $EUCALYPTUS/lib to your LD_LIBRARY_PATH

$ cp $EUCALYPTUS_SRC/tools/add_key.sh $EUCALYPTUS/usr/share/eucalyptus

Mirror $EUCALYPTUS_SRC on all hosts. Preferably use the same path on all hosts. scp or rsync can be used to do this.

Set up the Node and Cluster Controller(s)

On each host, change to the top-level source directory

$ source Makedefs

Make sure that LD_LIBRARY_PATH and PATH are set up as previously described on all hosts.

Make sure that the $NFS_SHARE/templates, $NFS_SHARE/registered and INSTANCE_PATH directories are created on all hosts.

$ deployed/eucalyptus-1.1/bin/apachectl start

At this point, apache2 should be running. Verify this.

$ ps aux | grep httpd

Axis2 webservices should be enabled. To verify this, point your browser to hostname:9090/axis2/services

To test that node(s) are available, execute the following.

$ $EUCALYPTUS_SRC/node/NCclient NChostname:9090 describeResource

To test that the cluster controller is available, execute the following.

$ $EUCALYPTUS_SRC/cluster/CCclient_full CChostname:9090 describeResources

Setting up the Cloud Controller

On the host that is designated to run the cloud controller, do:

$ cp $EUCALYPTUS_SRC/clc/cloud.xml $EUCALYPTUS/etc/eucalyptus/cloud-ant.xml

Add the cluster to the cloud controller configuration:

# ant -f $EUCALYPTUS/etc/eucalyptus/cloud-ant.xml cluster-add -Deuca.cluster.alias=<name of the cluster> -Deuca.cluster.host=<cluster controller hostname> -Deuca.cluster.port=9090 

Start the Cloud Controller:

# ant -f $EUCALYPTUS/etc/eucalyptus/cloud-ant.xml run &

Download and Register images

Download euca-ttylinux.tgz from the Eucalyptus website (or provide your own images)

$ cd $EUCALYPTUS_SRC
$ tar zvxf euca-ttylinux.tgz
$ cd $EUCALYPTUS_SRC/tools
$ ./euca add_image --disk-image $EUCALYPTUS_SRC/ttylinux/ttylinux.img --kernel-image $EUCALYPTUS_SRC/ttylinux/vmlinuz-2.6.16.33-xen --image-name ttylinux

Generating certificates

  • Navigate to https://<cloud controller hostname>:8443/
  • Login as admin with password admin (you will be forced to change it and to provide an email address)
  • Generate and download certificate, download EC2 tools and set up EC2 environment as described in the User's Guide

4. Testing Eucalyptus

On the host with the certificates:

$ ec2-describe-instances
$ ec2-describe-availability-zones
$ ec2-describe-images

At this point you should be able to run instances.