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

Thursday, May 17, 2012

Try "Ubuntu Cloud Guest" free

Yep here is a solution to try cloud free of cost.
 Almost all cloud provide free trail, but they need your credit card number for sign up and we students don't have a credit card.

Ubuntu Cloud Gust is cloud running on top of Amazone EC2 and CANONICAL will pay for you. You can try it for one hour. It is based on AWS trial : AWS Trial is a web service that allows someone with an AWS account to allow others to launch "trial" instances, which give them 1 hour to play for free.

Below I am describing the sign up process and how to run it.
Here I am using linux terminal for ssh, you can use putty if you are using windows.
Here I will describe how to provision the image and how to create a web server in it and access it publicly.

the procedures are.

  • Click on "Let's go to the cloud" button on the bottom of the page.


  • If you have an UBUNTU account sign in using your email address and password or create an account.


  • Click continue



  • Click on yes sign me in
  •  Select Type of operating system you want . Here I am selecting Ubuntu server Base Install . 
  • Accept the license agreement and click Launch button.



  • Now wait for three minutes to provision your image. 



  • After that your image ip address one time password and  ssh key will appear as shown below. And remaining time also will be shown .




  • Now open terminal and type ssh ubuntu@obtained ip address
  • Then it will show any of the encryption key and ask you to whether connect or not 
  • type 'yes'
  • Then it will ask for password .Give the obtained one time password described above. 

Done now you logged in as root in your ubuntu server running on Amazone EC2.

Now you can do what ever you want !!!!!!!!
You can install software and run them.


Here I am describing how to install Apache web server and run it.

  • On the terminal type "sudo apt-get install apache2"
  • Now Apache web server will be automatically installed and  running. 
  • Now you want to open port 80 of your server to public
  • Type the following command "sudo ufw allow 80
  • Now your port 80 is opened for public
  • Open your favorite web browser and type "http://your obtained ip"
  • If every thing fine it will display a page saying "It works" as shown below.



Now lets crate our own page. 

  • Now go to the directory /var/www from terminal  by typing command cd /var/www
  • Create a new webpage by typing "sudo vi test.html"
  • Now you are in vi editor create a web page as shown below. (press i to insert text after finishing press Esc key and type wq and hit Enter key)




  • Now go to your web browser and type the url as http://ip/test.html


That's it

You can try a lot your self because you have a powerful server running on powerful machine


If you have any query please comment below.


Thank you