Eucalyptus Source Installation

Eucalyptus 3.2 is becoming ready. It is going to be out soon. But if you think, it’s too hard for you to wait till GA, there are two solutions for you to try out. You can check out nightly builds or go for source installation, which is *fairly* easy.

For this installation I am using two CentOS 6.3 boxes, one as Frontend (CLC/Walrus/CC/SC) and another for backend (NC).

Download the source code from Github,

 # git clone git://github.com/eucalyptus/eucalyptus --recursive 

Configure repositories,

 # yum --nogpg install http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm -y 

[walrus host only]

 # yum --nogpg install http://elrepo.org/linux/elrepo/el6/x86_64/RPMS/elrepo-release-6-4.el6.elrepo.noarch.rpm -y 

Create a eucadeps.repo file for eucalyptus dependencies,

[euca-deps]name=euca-deps
baseurl= http://downloads.eucalyptus.com/software/eucalyptus/build-deps/3.1/rhel/$releasever/$basearch
gpgcheck=0
enabled=1

[euca-runtime]
name=euca-deps
baseurl= http://downloads.eucalyptus.com/software/eucalyptus/runtime-deps/3.1/rhel/$releasever/$basearch
gpgcheck=0
enabled=1

[euca2ools]
name=euca2ools
baseurl= http://downloads.eucalyptus.com/software/euca2ools/2.1/centos/$releasever/$basearch
gpgcheck=0
enabled=1

Install the required dependencies,

 # yum install gcc make ant ant-nodeps axis2-adb-codegen axis2-codegen axis2c-devel jpackage-utils libvirt-devel libxml2-devel libxslt-devel python-devel python-setuptools rampartc-devel swig velocity xalan-j2-xsltc gawk java-devel java-devel openssl-devel curl-devel axis2c dhcp41 dhcp41-common postgresql91 postgresql91-server python-boto rampartc iscsi-initiator-utils perl-Crypt-OpenSSL-RSA perl-Crypt-OpenSSL-Random sudo which jpackage-utils java lvm2 velocity drbd83 drbd83-kmod drbd83-utils drbd euca2ools bitstream-vera-fonts dejavu-serif-fonts bridge-utils iptables vtun device-mapper coreutils e2fsprogs file parted util-linux rsync PyGreSQL libcurl curl httpd libvirt scsi-target-utils vconfig wget kvm patch 

Download euca-WSDL2C.sh and save it to /opt on both machines,

 # wget https://raw.github.com/eucalyptus/eucalyptus-rpmspec/master/euca-WSDL2C.sh -O /opt/euca-WSDL2C.sh 

Download and save eucalyptus-nc-libvirt.pkla to /var/lib/polkit-1/localauthority/10-vendor.d/

 # wget https://raw.github.com/eucalyptus/eucalyptus/master/tools/eucalyptus-nc-libvirt.pkla -O /var/lib/polkit-1/localauthority/10-vendor.d/eucalyptus-nc-libvirt.pkla 

Add user “eucalyptus” on frontend,

 # adduser eucalyptus 

On NC,

 # useradd -G kvm eucalyptus 

Lets build Eucalyptus source now.

Set the following paths on both machines,

# export EUCALYPTUS="/"

Now start compiling Eucalyptus on both machines. Go to the eucalyptus directory and run the following,

 # ./configure '--with-axis2=/usr/share/axis2-*' --with-axis2c=/usr/lib64/axis2c --prefix=$EUCALYPTUS --with-apache2-module-dir=/usr/lib64/httpd/modules --with-db-home=/usr/pgsql-9.1 --with-wsdl2c-sh=/opt/euca-WSDL2C.sh 
 # make clean ; make ; make install 

Add the following in /etc/sysconfig/network,

 NOZEROCONF=yes 

On NC run the following,

# modprobe kvm_intel
# modprobe vhost_net

Configure eucalyptus.conf on both machines.

Run the following on both machines to set permission properly,

 # su -c "euca_conf --setup" 

On Frontend, initialize database and start eucalyptus-cloud service, which will start Cloud Controller, Walrus, Storage Controller, as we have put all in one box. And then start the Cluster Controller. Finally, start Node controller.

# euca_conf --initialize
# service eucalyptus-cloud start

# service eucalyptus-cc start

# service eucalyptus-nc start

Register Eucalyptus components,

# euca_conf --register-walrus --partition walrus --host 10.104.1.179 --component W00
# euca_conf --register-cluster --partition cluster01 --host 10.104.1.179 --component CC00
# euca_conf --register-sc --partition cluster01 --host 10.104.1.179 --component SC00

From 3.2.0, it is a must to set storage manager,

 # euca-modify-property -p cluster01.storage.blockstoragemanager=overlay 

Register node,

 # euca_conf --register-nodes 10.105.1.180 

Good Luck!

Eucalyptus installation

For installation three two PC (Server1 and Server2) is needed for the cloud purpose and one PC is for client which will also be serving for creating KVM images. Server2 and the client machine should have VT enabled as we will be running all our VMs on Server2 and client PC will be using to create the necessary KVM images.

Required configuration

Required Setup
Required Setup

Server1 setup

  • Boot the Ubuntu 11.04 64 bit Server CD/pen drive and from the graphical menu, select Ubuntu Enterprise Cloud and follow the installation menu.
  • If you are using DHCP for the public network, then just select eth0 and let the network to be setup automatically. Otherwise set your ethernet as mentioned above.
  • When the installation will be asking for the Cloud Controller address just put it blank.
  • For Server1 it’ll install the ‘Cluster Controller’, ‘Walrus Storage Service’, ‘Cluster Controller’ and ‘Storage Controller’.
  • Select eth1 for communication with nodes
  • Eucalyptus cluster name – Cluster1 (on anything)
  • Select an IP range to be used for the nodes, i.e. 192.168.1.10-192.168.1.99

Post installation setup

Set up static IP for eth1, edit /etc/network/interfaces and add the following to it,

auto eth1
iface eth1 inet static
address 192.168.20.1
netmask 255.255.255.0
network 192.168.20.0
broadcast 192.168.20.255

Run the following command to restart the networking,

localadmin@server1:~$ sudo /etc/init.d/networking restart

Update and upgrade the Eucalyptus to get the latest version of it,

localadmin@server1:~$ sudo apt-get update
localadmin@server1:~$ sudo apt-get upgrade eucalyptus

Install NTP package. Server1 is going to act as an NTP server for the nodes.

localadmin@server1:~$ sudo apt-get install ntp

Open and edit /etc/ntp.conf to make sure that the server serves time even when it’s connectivity to the internet is down. Add the following line to the file so that NTP server uses it’s own clock source.

server 127.127.1.0
fudge 127.127.1.0 stratum 10

Restart NTP server to make the changes active

localadmin@server1:~$ sudo /etc/init.d/ntp restart

Restart the Cluster Controller

localadmin@server1:~$ sudo restart eucalyptus-cc CLEAN=1

[NTP stands for Network Time Protocol, and it is an Internet protocol used to synchronize the clocks of computers to some time reference]

Server2 setup

  • Boot Ubuntu 11.04 64 bit Server and select ‘Install Ubuntu Enterprise Cloud’ and continue the basic installation process.
  • For network setup select eth0 and configure it manually. Set the private IP to 192.168.20.2 and the gateway as 192.168.20.1.
  • For UEC setup it’ll ask certain configuration option. If it doesn’t select the Cluster Controller by itself, put the the Cluster Controller address 192.168.20.1
  • In cloud installation mode select ‘Node Controller’

Post installation setup

Set up static IP for eth1 by adding the few lines to /etc/network/interfaces so that it looks like following

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
    address 192.168.20.2
    netmask 255.255.255.0
    network 192.168.20.0
    broadcast 192.168.20.255
    # gateway 192.168.20.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 192.168.1.1
    bridge_ports eth0
    bridge_fd 9
    bridge_hello 2
    bridge_maxage 12
    bridge_stp off

auto eth1
iface eth1 inet static
address 192.168.1.103
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Run the following command to restart the networking,

localadmin@server1:~$ sudo /etc/init.d/networking restart

Update and upgrade the Eucalyptus to get the latest version of it,

localadmin@server1:~$ sudo apt-get update
localadmin@server1:~$ sudo apt-get upgrade eucalyptus

Install NTP package.

localadmin@server1:~$ sudo apt-get install ntp

Open the file /etc/ntp.conf and add the following line

server 192.168.20.1

Restart NTP server to make the changes active

localadmin@server1:~$ sudo /etc/init.d/ntp restart

Open the file /etc/eucalyptus/eucalyptus.conf and make the following changes,

VNET_PUBINTERFACE=”br0”
VNET_PRIVINTERFACE=”br0”
VNET_BRIDGE=”br0”
VNET_DHCPDAEMON=”/usr/sbin/dhcpd3”
VNET_DHCPUSER=”dhcpd”
VNET_MODE=”MANAGED−NOVLAN”

Now run the following command to restart the Node Controller to make all the changes active,

localadmin@server2:~$ sudo restart eucalyptus-nc

Setup CC’s SSH public key to NC

On the Node Controller, temporarily set a password for the “eucalyptus” user,

localadmin@server2:~$ sudo passwd eucalyptus

On the Cluster Controller:

localadmin@server1:~$ sudo -u eucalyptus ssh-copy-id -i ~eucalyptus/.ssh/id_rsa.pub eucalyptus@192.168.20.2

Remove the password of the “eucalyptus” account from the Node,

localadmin@server1:~$ sudo passwd -d eucalyptus

Client setup

  • Boot the 11.04 32/64 bit Desktop and install it.

Install KVM on the client machine.

shaon@client:~$ sudo apt-get install qemu-kvm

Post installation setup

To administrate the cloud we need to install euca2ools

shaon@client:~$ sudo apt-get install euca2ools

Monitoring

  • Login to the web interface from https://192.168.10.121:8443, default username is ‘admin’ and password is ‘admin’.
  • Download the user credentials from credential tab and save it to ~/.euca directory (if .euca is not there just create and save the credentials there)
  • Extract the credentials and source the eucarc script so that euca2ools can used this as environmental variables.
$ cd .euca
$ unzip xxxxxxxxx.zip
$ source eucarc

Verify that euca2ools can communicate with the UEC properly and all the services are running correctly run the following command,

$ euca-describe-availability-zones verbose

It’ll give output something like this,

AVAILABILITYZONE	cluster1	192.168.1.102
AVAILABILITYZONE	|- vm types	free / max   cpu   ram  disk
AVAILABILITYZONE	|- m1.small	0001 / 0002   1    192     2
AVAILABILITYZONE	|- c1.medium	0001 / 0002   1    256     5
AVAILABILITYZONE	|- m1.large	0000 / 0001   2    512    10
AVAILABILITYZONE	|- m1.xlarge	0000 / 0001   2   1024    20
AVAILABILITYZONE	|- c1.xlarge	0000 / 0000   4   2048    20

If VCPUs are found 0000, then use the following command on the Server1 to make sure that it finds the Node Controller and approve when prompts 192.168.20.2

localadmin@server1:~$ sudo euca_conf --discover-nodes

tadaa!!!