Advertisment

Cloud Computing with Enomalism

author-image
PCQ Bureau
New Update

Continuing with our focus on Cloud Computing, this month we deploy a Cloud

Computing infrastructure with a web-based graphical client. This makes using the

setup a breeze.

Advertisment

Last month we talked about deploying an EC2 compatible cloud computing

infrastructure using Eucalyptus. The deployment of Eucalyptus was tedious but

easy due to the Rocks ISOs. But the only problem with Eucalyptus is that the

client for using it is Amazon's EC2 which is completely command line based and

as a result difficult to run.

So, this time we decided to deploy a Cloud Computing infrastructure which has

a neat web based graphical client, which can make usage of the setup pretty

simple. We selected Enomalism for the same. I cannot guarantee a complete

graphical usage due to some bugs and you might still need to use the command

line, but if you compare it against Eucalyptus, it's far more easier to use. The

other good thing is that if you plan to do a production class deployment with

Enomalism, you can first try out the free version and if you like it but are too

bothered by the management and troubleshooting part of it, you may buy the paid

support from Enomalism. But before we begin, let me warn you that deployment is

not going to be a cakewalk this time.

Prerequisites



There are a couple of things which you have to first identify and arrange before
we can start with the deployment. The first is the base OS on top of which you

want to run Enomalism. One can technically install it on any Linux distro.

However, the preferred distros for installing Enomalism are Fedora 9, CentOS 5.2

and RedHat 5.2.

Advertisment

We first tried installing it on top of a Fedora Box but due to some problem

with the Xen available on Fedora 9 repository, we shifted to CentOS 5.2, where

Enomalism installation worked perfectly. The second thing you need in place is

to have a couple of servers/machines with hardware virtualization support and

identify a machine as the master node which will have the database and the repo

directory on it. All other machines will connect to the master node. In our

setup we used a 24 Core Dunnington server as the master node and a couple of

Core 2 Duo machines as other nodes.

Step 1: Installing the Master Node



First do a base installation of CentOS 5.2 on all machines. I would recommend a
64-bit installation. Once the installation is done, identify one machine as the

master node and configure it first. The master node should have a good amount of

RAM and hard drive space because all of your virtual machines and the Enomalism

database is going to reside on that.



Now download and import two sets of public keys from the enomalism repository
and import them to your system by running following commands:

#wget



http://downloads.sourceforge.net/enomalism/enomalism.public


#wget


http://downloads.sourceforge.net/enomalism/enomalism001.pubkey.asc


# rpm --import enomalism.public


#rpm --import enomalism001.pubkey.asc



Advertisment

Once done, download libvirt 0.4.1 and libvirt-python 0.4.1 for CentOS 5.x for

x64 by running the following commands:

#wget



http://downloads.sourceforge.net/enomalism/libvirt-0.4.1-1.CentOS5.x86_64.rpm?modtime=1205833130&big_mirror=0




#wget


http://downloads.sourceforge.net/enomalism/libvirt-python-0.4.1-1.Cen


tOS5.x86_64.rpm?modtime=1205833291&big_mirror=0


But don't install it at this point, because if you do so you will not be able

to install Xen on this machine due to dependency troubles.

Advertisment

Now download Enomalism build for Python 2.4 (as CentOS 5.2 doesn't have Python

2.5) from http://tinyurl.com/enomalism2 and install it using yum so that all

dependencies for enomalism can be take care automatically. You can do so by

running the following command from the location where you just downloaded

enomalism rpm:

# yum install Enomalism2-2.1.1-3595-noarch-py24.rpm

Advertisment

Now this is the time to install Xen, Qemu and KVM on these machines.

Enomalism supports all these hypervisors. You can install them by running the

following commands:

#yum install yum install kernel-xen xen kvm kmod-kvm

qemu



# ln —s /usr/bin/qemu-kvm /usr/bin/kvm

Now install lib-virt 01.4.1 by running the following command from the

location where you have downloaded the libvirt and libvirt-python packages:

Advertisment

#yum install libvirt-0.4.1-1.CentOS5.x86_64.rpm

libvirt-python-0.4.1-1.CentOS5.x86_64.rpm

This entire procedure forms part of the first step and it is going to be same

for both nodes and the master server.

Step 2: Configuring SQL



Now you have to run MySQL on the master computer, configure it and create the
Enomalism database on it. First run mysqld by running:

Advertisment

# /etc/init.d/mysqld start

Then provide a password to the root user of MySql by running the following

command. Let's assume, we give a password “pass@word”:

# mysqladmin password pass@word

Now run the following command to make sure MySql starts automatically

whenever the machine boots:

# chkconfig mysqld on

Now you have to create the database in MySql for enomalism. To do so go to

/opt/enomalism2/scripts and run:

#./init-db.sh pass@ord enomalism2 pass@word

This command will create at database named enomalism2 and a MySql user called

enomalism2, give the user a password which is again pass@word. It will create

the required tables and fill values to it.

Downloading appliances



To create a virtual machine on top of your Enomalism cloud, the easiest
thing which you can do is just download a virtual appliance from enomalism

repository and use it to create virtual machines. To do so, go to

“Repository ” tab, then click on the “Remote Appliances”. It will list all

the appliances available in Enomalism's repo. Select the appliance and click

on the 'Add' button to start the download.

Provisioning a new VM



Once you have downloaded a couple of appliances from the remote repository,
you can start creating virtual appliances. To do so, first go to the

“Virtual Infrastructure” and click o the default cluster link at the right

side of the window. Once you do that, you will be able to see all the

physical machines (nodes) available in your cloud.

Now select any physical machine on which you want to create a virtual

machine. And click on the star icon (which says Toggle Machine details) at

the left side of the machine name. This will open the details of the

machine. Now click on “Provision a new VM on this machine” option. A window

will open, give a name to the VM, select the appliance from the first drop

down menu. And select the hypervisor which you want to use from the second

drop down menu and click on 'Create' button. After a few moments you will

see this new virtual machine in your cluster. Now you can toggle its detail

and click on the 'Start' button to boot the virtual machine. If you want to

change the machine vitals such as Max VCPU, RAM, VNC port, HDD image etc,

you can click on the 'Edit VM XML Definition' and change the settings into

the XML file. Once done, click on 'Update' and your machine will be created.

Bug Fix



Sometimes, after creating a virtual machine, you might find difficulty
booting it. Enomally has a bug which sometimes prevents the VMs to boot

directly through the web interface. The work around for this bug is pretty

simple. All you have to do is to copy the XML file from the 'Edit VM XML

Definition' window and save it to a text file. Let's call the file test.xml.

Once done, go to the terminal and run the command #virsh create /test.xml.

And the machine will boot. Now if you go back to the web interface, you will

find the status of the machine as Power ON. You can even manage and modify

the VM from the interface now.


Step 3: Configuring Enomalism



This is the time to configure and run Enomalism on the master computer. To do so
first create the enomalism configuration file by copying the sample default.cfg

file from /opt/enomalism2 to /opt/enomalism2/config by running the following

command:

#cp /opt/enomalism2/default.cfg /opt/enomalism2/config/$HOSTNAME.cfg

This will copy the default file with the same name as that of your hostname

to the config folder. Now open the file by using your favourite text editor and

change the following lines:

sqlobject.dburi="mysql://enomalism2:pass@word@localhost/enomalism2"

Here you are actually providing the Enomalism mysql user name and its

password to your FQDN or IP address/ the name of the Enomalism database.

enomalism2.baseurl=http://127.0.0.1:8080/rest/



enomalism2.ip_addr="192.168.3.82"

Here you are providing the land IP of Enomalism server.

Now go to a terminal and run the following command:

#uuidgen

You will get a 32 character value, like

“5fe6f05e-7ee0-11dc-ba7c-0011d88b8e81.” Copy this line and paste it to

enomalism2.self line in the config file. The line would look like this:



enomalism2.self="5fe6f05e-7ee0-11dc-ba7c-0011d88b8e81"


Now open /etc/xen/xend-config.sxp and add a line which says


(vnc-listen '0.0.0.0')


And your master node setup is done.


Step 4: Configuring the client nodes



To configure the client machines, you have to follow Step 1 exactly as you did
it for the Master Node. Once you are done with it, the extra thing which you

have to do here is to configure the enomalism configuration file in a bit

different way. To do so, copy the default.cfg file from /opt/enomalism2 to /opt/

enomalism/config by running the same command as we did earlier, like this:

#cp /opt/enomalism2/default.cfg /opt/enomalism2/config/ $HOSTNAME.cfg

Now open this file and do the following modifications.

enomalism2.ip_addr="192.168.3.82".



Here give the IP address of the client node on which you are working now:





sqlobject.dburi=”mysql: // enomalism2:pass@word @192. 168.3.82/enomalism2
".

Here you will provide the MySQL username, IP address and database name which you

have configured in the master node:

Change enomalism2.baseurl="http://192.168.3.82:8080/rest/". Here also give

the IP address of the master node.

Now again run uuidgen command from the terminal and paste the value to the

line which starts with enomalism2.self. It should look something like this:

enomalism2.self="5fe6f05e-7ee0-11dc-ba7c-0011d88b8e81"

Just make sure, no two machines should have the same uuid.

Step 5: Granting MySQL

access




Now you have to configure MySQL running on the master node in such a way that it
can let the node access it remotely. For this, you have to grant the access from

the nodes to the MySQL server. To do so, run the following commands:

#mysql —p



GRANT ALL ON enomalism2.*


TO enomalism2@192.168.3.82 IDENTIFIED BY 'pass@word';


FLUSH PRIVILEGES;

Here change the IP address with the address of the client nodes one by one.

Once done, restart MySQL by running the following commands:

#/etc/inet.d/mysqld restart

Now the only thing which is left is mounting the repo directory of the Master

Node to all the client nodes over NFS. To do so, go to the master node and open

/etc/exports file and add “/opt/ enomalism2/repo local.nfs. ip.range/ 24 (rw,no_

root_ squash,no_all_squash)” line to it. Now save and exit the file and run the

following commands:

#service nfsd start



#export —r

Now, go to the client machines and add “master.nfs.ip.

address:/opt/enomalism2/repo /opt /enomalism2/repo nfs” to the /etc/fstab file.

Once done, reboot all the machines and run the following command to start

enomalism:

#/etc/init.d/enomalism2.sh start

Step 6: Accessing the web interface



Now, open a web browser and open http:// IPaddress:8080 /install address for all
the machines (both master and client nodes). So for instance, in our case the

Master Node was 192.168.3.82 and the client was 192.168.3.100. So we went to

http:// 192.168. 3.82:8080/install first and then to http:// 192.168

.3.100:8080/install.

This will add the node details to the SQL server. Once done, access the main

page by going to the IP address of the master node and port 8080. It will ask

you a username and password. Give 'admin' as user name and 'password' as

password. And you will be logged in to the web based interface.

The web based interface is pretty self explanatory, and you can easily

understand using it. Below are some tips on doing some basic operations.

Advertisment