Thursday, July 19, 2012

Deploying Ubuntu Enterprise Cloud

Ubuntu Enterprise Cloud
    is a cloud initiative from canonical . In Ubuntu release 10.04 LTS they included eucalyptus as part of this, and i think from version 11 onwards they include openstack instead of eucalyptus.

    Here I am going to describe how to setup the Ubuntu enterprise cloud using Ubuntu release 10.04.

    I followed the documentation given by Ubuntu community, and I will not repeat it here you can click here to see the documentation.

    So what I am going to do is that, this documentation is not complete ! Some error are occurring during the installation and the documentation didn't mentioned about it. So here I will list out common errors that can occur during installation and solutions for that.

Requirements

         You need at-least two system. May be you can go for one system using  virtualization   tools such as VMware.  We will dig in to that later.

So I hope  that you have two system.
The system requirements ? :See the documentation

    For testing purpose you can also go below this level but the only thing is that your processor should support virtualization. yep I had an intel core2duo processor and 4GB RAM and I started installation. During the installation it shown an error that my processor can't support virtualization acceleration which is necessary  for eucalyptus. But intel says that that processor support virtualization. Then only I came to know that your motherboard also plays a role in it, I will detail it in step by step procedure.

Step 1:

   Check your PC support virtualization. How? Boot from any live linux CD and boot. Open the terminal and type kvm-ok. Then it will show whether your system support virtualization acceleration or not.
The message will be like this

INFO: /dev/kvm does not exist
HINT:   sudo modprobe kvm_intel
INFO: Your CPU supports KVM extensions
KVM acceleration can be used

   Some times it will say your system supports acceleration but it is disabled in BIOS. In this go to BIOS settings and enable virtualization.

Why KVM-OK ?
    Because eucalyptus uses KVM as Hypervisor

Step 2:   

    Change SATA Emulation to IDE
       Go to your BIOS settings and check the settings of HDD. Usually the SATA Emulation will be ACHI change it IDE ..... Why?
      Because we are installing Ubuntu server and if you don't do like this your installation will fail in the middle and you can't install the boot loader.

Step 3:

   Now you are ready to boot. See Step 2 and Step 3 in documentation.

  Range of IP:  There is no need to give class c as shown in documentation. You can give class a or class b or you can leave it blank. Later I will tell you how to give range of ip if you leave it blank during installation.

Step 4:

            I hope the installation completes successfully. If you felt any problem give a comment, I will help you.
        All the eucalyptus components will be registered automatically. To check every thing registered properly from the cloud controller type the following command: cat /var/log/eucalyptus/registration.log 

Then it will show
2010-04-08 15:46:36-05:00 | 24243 -> Calling node cluster1 node 10.1.1.75
2010-04-08 15:46:36-05:00 | 24243 -> euca_conf --register-nodes returned 0
2010-04-08 15:48:47-05:00 | 25858 -> Calling walrus Walrus 10.1.1.71
2010-04-08 15:48:51-05:00 | 25858 -> euca_conf --register-walrus returned 0
2010-04-08 15:49:04-05:00 | 26237 -> Calling cluster cluster1 10.1.1.71
2010-04-08 15:49:08-05:00 | 26237 -> euca_conf --register-cluster returned 0
2010-04-08 15:49:17-05:00 | 26644 -> Calling storage cluster1 storage 10.1.1.71
2010-04-08 15:49:18-05:00 | 26644 -> euca_conf --register-sc returned 0

   If you are out put is different from this don't worry we will rectify it in next step.

Step 5:

    Follow step 5 in documentation

After you giving euca-describe-availability-zones verbose command the out put will be like this

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

If free/max is showing 000 in all five option then some problem is occurred.

error: euca-describe-availability-zones verbose shows 000

Diagnose : Its only because your node controller is not registered properly.

Solutions :
 1) Check whether the cloud controller and node controller have same system time, if not make it same.
    Linux command to see system time: date
    Linux command to set system time: sudo date -s "DD MM YYY hh:mm:ss" 

2) Check whether nc.log is present.
        In node controller  go to location /var/log/eucalyptus by typing       command: cd  /var/log/eucalyptus  
and then list the files using ls command. Check whether nc.log file is present there. (not nc_conf.log).
If not present
in cloud controller open the file eucalyptus.conf from location /etc/eucalypts using commands listed below

cd ~/
cd /etc/eucalyptus
sudo vi eucalyptus.conf

Come down the file and you can see node=""
press i to insert and type your node controllers ip address.
save the file pressing escape and then wq

Restart the cc: service eucalyptus-cc restart
Restart the nc : service eucalyptus-nc restart