Tuesday, April 19, 2011

Ubuntu Enterprise Cloud

Installation Process of Ubuntu Enterprise Cloud 10.04


System Requirement:


  1. Server 1 – CLC,Walrus in one machine. (CLC – Cloud Controller)

  2. Server 2 – CC, SC in one machine. (CC- Cluster Controller, SC- Storage Controller)

  3. Server 3 - NC in one machines. (NC – Node Controller)

    (The node must be capable of KVM support (either vmx or svm cpu support). You can check for this by doing the following in a terminal: egrep '(vmx|svm)' /proc/cpuinfo )

Hardware

Server 1

Server 2

Server 3

Minimum

Suggested

Minimum

Suggested

Minimum

Suggested

CPU

1GHz

2 x 2GHz

VT extensions

VT 64Bit, Multicore

VT extensions

VT 64Bit, Multicore

Memory

1 GiB

2 GiB

1 GiB

4 GiB

1 GiB

2 GiB

Disk

5400rpm IDE

7200rpm SATA

5400rpm IDE

7200rpm SATA or SCSI

5400rpm IDE

7200rpm SATA or SCSI

Disk Space

40 GiB

200 GiB

40 GiB

200 GiB

40 GiB

200 GiB

Networking

100 Mbps

1000 Mbps

100 Mbps

1000 Mbps

100 Mbps

1000 Mbps


Network Information:



Server1

Server2

Server3

Client


Functionality

CLC, Wlarus

CC,SC

NC

Bundling and web UI Client

No. of NICs

eth0 (Enterprise N/W)

eth1 (Eucalyptus N/W)

eth0 (Enterprise N/W)

eth1 (Eucalyptus N/W)

eth0 (Eucalyptus N/W)

eth0 – (Enterprise N/W)

IP Address

eth0 - 192.168.1.2

eth1 - 192.168.8.2

eth0 - 192.168.1.3

eth1 -192.168.8.3

eth0 - 192.168.8.4

Eth0 - 192.168.1.15


Hostname

cloudserver1.in

cloudserver2.in

cloudserver3.in

client1.in

DNS

xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxx

Gateway IP

192.168.1.1

192.168.1.1

192.168.8.3

192.168.1.1


Operating System Information:




Server1

Server2

Server3

Client

OS

Ubuntu 10.04 Server (64 bit)

Ubuntu 10.04 Server (64 bit)

Ubuntu 10.04 Server (64 bit)

Ubuntu 10.04 Desktop (64 bit)



Installation Instructions:


SERVER 1 : CLOUD CONTROLLER AND WALRUS


  • Select your language for installation and press Enter.

  • Select Install Ubuntu Enterprise Cloud and press Enter.

  • Select your language for the installed system and press Enter.

  • Select No to detect keyboard and press Enter.

  • Select your origin of keyboard and press Enter.

  • Select your Keyboard Type and press Enter.

  • Add your hostname and press Enter. (for Ex: cloudserver1.in)

  • Leave cloud controller address empty, and press Enter.

  • Check that the UEC installer selects by default: Cloud controller, Walrus

  • Press Enter to accept default of Cloud controller, Walrus as the install type

  • Confirm your Timezone if needed

  • Press Enter to select Guided - Use entire disk and set up LVM

  • Select the disk to install to and press Enter.

  • Select Yes on the partition layout page and press Enter.

  • Select Yes to write the changes to disk and press Enter.

  • Select the amount of disk to allocate (normally the whole drive will be represented by default) and press Enter.

  • Select Yes to finally write to disc and press Enter.

  • Add the default system user and press Enter.

  • Add the default system username and press Enter.

  • Add the password for the user and press Enter.

  • Re-type the password and press Enter.

  • Select whether to encrypt your home directory or not and press Enter.

  • Add http proxy information or leave blank if there is none and press Enter.

  • Select how to manage updates and press Enter.

  • Confirm grub installation by selecting Yes and pressing Enter.

  • Remove the CD and hit Enter to continue.











Post Installation and Configuration


When it reboots, run the following to get the latest eucalyptus package and reboot. It recommended to update to the latest 10.04 status and set the password for all server.


# sudo apt-get update

# sudo apt-get upgrade

# sudo apt-get upgrade eucalyptus


and set the password eucalyptus user


# sudo passwd eucalyptus


Configure eth1 network interface


Setup static ipaddress of eth1 interface


# vi /etc/network/interface


auto eth1

iface eth1 inet static

address 192.168.8.2

netmask 255.255.255.0

network 192.168.8.0

broadcast 192.168.8.255


# /etc/init.d/networking restart


Enable Network Time Protocol Service


Install NTP packages


# sudo apt-get install ntp


Configuration of NTP


# vim /etc/ntp.conf


server 127.127.1.0

fudge 127.127.1.0 stratum 10



Restart NTP Service to the change effective


# /etc/init.d/ntp restart

SERVER 2 : CLUSTER CONTROLLER AND STORAGE CONTROLLER


  • Select your language for installation and press Enter.

  • Select Install Ubuntu Enterprise Cloud and press Enter.

  • Select your language for the installed system and press Enter.

  • Select No to detect keyboard and press Enter.

  • Select your origin of keyboard and press Enter.

  • Select your Keyboard Type and press Enter.

  • Add your hostname and press Enter. (for Ex: cloudserver2.in)

  • Check that the UEC installer selects by default: Cluster controller and Storage controller

  • Press Enter to accept default of Cluster controller + Storage controller as the install type

  • Confirm your Timezone if needed

  • Press Enter to select Guided - Use entire disk and set up LVM

  • Select the disk to install to and press Enter.

  • Select Yes on the partition layout page and press Enter.

  • Select Yes to write the changes to disk and press Enter.

  • Select the amount of disk to allocate (normally the whole drive will be represented by default) and press Enter.

  • Select Yes to finally write to disc and press Enter.

  • Add the default system user and press Enter.

  • Add the default system username and press Enter.

  • Add the password for the user and press Enter.

  • Re-type the password and press Enter.

  • Select whether to encrypt your home directory or not and press Enter.

  • Add http proxy information or leave blank if there is none and press Enter.

  • Select how to manage updates and press Enter.

  • Add your System Mail name (default is for example ubuntu.example.com) and press Enter. (If needed or leave blank)

  • Choose and enter a Eucalyptus Cluster name and press Enter. (ex: mycluster1)

  • Choose a range of valid public IP addresses on your network for instances to use and press Enter. (ex: 192.168.1.20 – 192.168.1.50)

  • Confirm grub installation by selecting Yes and pressing Enter.

  • Remove the CD and hit Enter to continue.



Post Installation and Configuration


When it reboots, run the following to get the latest eucalyptus package and reboot. It recommended to update to the latest 10.04 status and set the password for all server.


# sudo apt-get update

# sudo apt-get upgrade

# sudo apt-get upgrade eucalyptus

and set the password eucalyptus user


# sudo passwd eucalyptus


Configure eth1 network interface


Setup static ipaddress of eth1 interface


# vi /etc/network/interface


auto eth1

iface eth1 inet static

address 192.168.8.3

netmask 255.255.255.0

network 192.168.8.0

broadcast 192.168.8.255


# /etc/init.d/networking restart


Enable Network Time Protocol Service


Install NTP packages


# sudo apt-get install ntp


Configuration of NTP


# vim /etc/ntp.conf


server 127.127.1.0

fudge 127.127.1.0 stratum 10



Restart NTP Service to the change effective


# /etc/init.d/ntp restart


Save the change and Restart CC


# sudo stop eucalyptus-cc CLEAN=1

# sudo start eucalyptus-cc CLEAN=1

SERVER 3 : NODE CONTROLLER


  • Select your language for installation and press Enter.

  • Select Install Ubuntu Enterprise Cloud and press Enter.

  • Select your language for the installed system and press Enter.

  • Select No to detect keyboard and press Enter.

  • Select your origin of keyboard and press Enter.

  • Select your Keyboard Type and press Enter.

  • Add your hostname and press Enter. (for Ex: cloudserver3.in)

  • Check that the UEC installer selects by default: Node controller

  • Press Enter to accept default of Node controller as the install type

  • Press Enter to select Guided - Use entire disk and set up LVM

  • Select the disk to install too and press Enter.

  • Select Yes on the partition layout page and press Enter.

  • Select Yes to write the changes to disk and press Enter.

  • Select the amount of disk to allocate (normally the whole drive will be represented by default) and press Enter.

  • Select Yes to finally write to disc and press Enter.


Post Installation and Configuration


When it reboots, run the following to get the latest eucalyptus package and reboot. It recommended to update to the latest 10.04 status and set the password for all server.


# sudo apt-get update

# sudo apt-get upgrade

# sudo apt-get upgrade eucalyptus

and set the password eucalyptus user


# sudo passwd eucalyptus


Enable Network Time Protocol Service


Install NTP packages


# sudo apt-get install ntp


Configuration for Server3 – Node Controller


# vim /etc/ntp.conf

server 192.168.8.3



Restart NTP Service to the change effective


# /etc/init.d/ntp restart


Make the following Changes, Open the file /etc/eucalyptus/eucalyptus.conf


VNET_PUBINTERFACE="br0"

VNET_PRIVINTERFACE="br0"

VNET_BRIDGE="br0"

VNET_DHCPDAEMON="/usr/sbin/dhcpd3"

VNET_DHCPUSER="dhcpd"

VNET_MODE="MANAGED-NOVLAN"


Restart the Node Controller eucalyptus


# sudo restart eucalyptus-nc-publication

# sudo restart eucalyptus-nc


Check registration of components - Server1

After reboot and login, wait for components to be brought up:

	# sudo netstat -tnlp |grep 8443

should show port 8443 running

  • Type:

	# sudo euca_conf --get-credentials mycreds.zip 	# mkdir euca 	# mv mycreds.zip euca/ 	# cd euca/ 	# sudo unzip mycreds.zip 	# source eucarc
    # euca-describe-availability-zones verbose

and verify that there is more than 0 free VMs (example output follows):

AVAILABILITYZONE   cluster1                   192.168.8.3 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
  • Make sure that walrus is registered:

	# sudo euca_conf --list-walruses

Example output:

	registered walruses: 	   walrus 192.168.1.2
  • Make sure that the cluster controller is registered:

	# sudo euca_conf --list-clusters

Example output:

	registered clusters: 	   mycluster1 192.168.1.3

    If not register:

    # sudo euca_conf --list clusters

    # sudo euca_conf --register -cluster mycluster1 192.168.1.3

  • Make sure that the storage controller is registered:

# sudo euca_conf --list-scs

Example output:

	registered storage controllers: 		mycluster1 192.168.8.3
  • Make sure that the node controller is registered:

    # sudo euca_conf --no-rsync --discover-nodes (It will display list of node & Press Y to add

Example output:

registered storage controllers:

		192.168.8.4  mycluster1

Server 2 – Login and debug the node controller


  • Make sure that the node controller is registered:

    # sudo euca_conf –list nodes

Example output:

registered storage controllers:

		192.168.8.4  mycluster1

(if not shows node controllet – Debug option)


  • Make sure node controller is deregistered:

    # sudo euca_conf --deregister mycluster1 192.168.8.4

# sudo euca_conf –list nodes (it will shows blank space)


Example output:


registered storage controllers:

  • Make sure node controller is registered:

    # sudo euca_conf --discover -nodes (It will display NC & add the node into cc)

    # sudo euca_conf --register mycluster1 192.168.8.4

# sudo euca_conf –list nodes (it will shows blank space)

Example output:


registered storage controllers:

		192.168.8.4  mycluster1

SERVER 3: Node Controller

After reboot and login, wait for component to be brought up:

    # netstat -tl

should show port 8775 running (takes about 10 seconds)

  1. Make sure that node controller communicates with the cluster:

      # tail -f /var/log/eucalyptus/nc.log

should show doDescribeInstances() messages approximately every 6 seconds.

















Client Installation – Ubuntu Desktop (64 Bit) VT's Enablt


The purpose of Client1 machine is to interact with the cloud setup, for bundling and registering new Eucalyptus Machine Images (EMI).


OS Installation


  • Select your language for installation and press Enter.

  • Select Install Ubuntu Desktop and press Enter.

  • Select your language for the installed system and press Enter.

  • Select No to detect keyboard and press Enter.

  • Select your origin of keyboard and press Enter.

  • Select your Keyboard Type and press Enter.

  • Add your hostname and press Enter. (for Ex: client1.in)

  • Confirm your Timezone if needed

  • Press Enter to select Guided - Use entire disk and set up LVM

  • Select the disk to install to and press Enter.

  • Select Yes on the partition layout page and press Enter.

  • Select Yes to write the changes to disk and press Enter.

  • Select the amount of disk to allocate (normally the whole drive will be represented by default) and press Enter.

  • Select Yes to finally write to disc and press Enter.

  • Add the default system user and press Enter.

  • Add the default system username and press Enter.

  • Add the password for the user and press Enter.

  • Re-type the password and press Enter.

  • Select whether to encrypt your home directory or not and press Enter.

  • Add http proxy information or leave blank if there is none and press Enter.

  • Select how to manage updates and press Enter.

  • Confirm grub installation by selecting Yes and pressing Enter.

  • Remove the CD and hit Enter to continue.



Once Reboot Ubuntu Desktop 10.04,

Network configuration:

# vim /etc/network/interface

auto eth0

iface eth0 inet static

address 192.168.1.15

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1


# /etc/init.d/networking restart


DNS Configuration


# vim /etc/resolv.conf

nameserver 192.168.1.1



KVM platform the create a image and bundle


# sudo apt-get update

# sudo apt-get upgrade

# sudo apt-get install qemu-kvm

# sudo apt-get install eucalyptus-common

# sudo apt-get install euca2ools


Create a VM Image


# kvm-img create -f qcow2 ubuntu10.img 15G


Start the Installation process


Location System Installation


# kvm -m 1024 -cdrom ubuntudesktop.iso -drive file=ubuntu10.img,if=scsi,index=0 -boot d -net nic -net user


Remote System Installation


# kvm -m 1024 -cdrom ubuntudesktop.iso -drive file=ubuntu10.img,if=scsi,index=0 -boot d -net nic -net user -nographic -vnc :0


Boot OS from VM and Installation Packages


After finished installation, Reboot the VM and install required packages.


Access from Location machine


# kvm -m 1024 -drive file=ubuntu10.img,if=scsi,index=0,boot=on -net nic -net user


Access from Remote machine


# kvm -m 1024 -drive file=ubuntu10.img,if=scsi,index=0,boot=on -net nic -net user -nographic -vnc :0




Installed packages into VM images


# sudo apt-get update

# sudo apt-get upgrade

# sudo apt-get install apache2

# sudo apt-get install postgresql-8.4

# sudo apt-get install php5



Integrated with Eucalyptus


Before Bundled the image, we need to install curl for we needs to have the public key of the user allowed to do a passwordless access through SSH.


# sudo apt-get install curl


Now add the following lines to /etc/rc.local of the image:


# vim /etc/rc.local


depmod -a

modprobe acpiphp

# assuming user is the username of an account that has been created

mkdir -p /home/user/.ssh

echo >> /home/user/.ssh/authorized_keys

curl -m 10 -s http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key | grep 'ssh-rsa' >> /home/user/.ssh/authorized_keys


echo "AUTHORIZED_KEYS:"

echo "************************"

cat /home/user/.ssh/authorized_keys

echo "************************"


exit 0


Install VNC server for Remote Desktop Access


# sudo apt-get install vnc4server xinetd


Set the password


# sudo vncpasswd /root..vncpasswd


Add the VNC service into xinetd


# sudo vim /etc/xinet.d/Xvnc


service Xvnc

{

type = UNLISTED

disable = no

socket_type = stream

protocol = tcp

wait = yes

user = root

server = /usr/bin/Xvnc

server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

port = 5901

}


Restart xinetd Services


# /etc/init.d/xinet.d restart



Remove Network Persistent rules


# rm -rf /etc/udev/rules.d/70-persistent-net.rules



Copy the Kernel and the initrd image from the VM image to client1.in


# scp /boot/vmlinuz test@192.168.1.15:/home/test/Desktop

# scp /boot/initrd.img test@192.168.1.15:/home/test/Desktop



Bundled images, uploaded images and register images into Cloud


Open the browser, Login to the web interface of CLC (Cloud Controller) by using ipaddress of CLC. (For ex: https://192.168.1.2:8443). By default username is “admin” and password is “admin”. Download the credentials and save it.


# mkdir euca

# cd euca

# mv mycreds.zip euca/

# unzip mycreds.zip

# source /euca/eucarc

# euca-describe-availability-zones verbose


AVAILABILITYZONE cluster1 192.168.8.3

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

Register the Kernel Image


# euca-bundle-image -i vmlinuz --kernel true

# euca-upload-image -b ubuntu -m /tmp/vmlinuz.manifest.xml

# euca-register ubuntu/vmlinuz.manifest.xml

IMAGE eki-XXXXXXX

Register the Ramdisk Image


# euca-bundle-image -i initrd.img --ramdisk true

# euca-upload-image -b ubuntu -m /tmp/initrd.img.manifest.xml

# euca-register ubuntu/initrd.img.manifest.xml

IMAGE eri-XXXXXXX


Register the Disk Image


# euca-bundle-image -i ubuntu10.img --kernel eki-XXXXXXX --ramdisk eri-XXXXXXX

# euca-upload-image -b ubuntu -m /tmp/ubuntu10.img.manifest.xml

# euca-register ubuntu/ubuntu10.img.manifest.xml

IMAGE eri-XXXXXXX


Image Listing


# euca-describe-images


IMAGE emi-70B70EC0 ubuntu10/ubuntu10.img.manifest.xml admin available public x86_64 machine

IMAGE eri-A2BE13EC ubuntu10/initrd.img.manifest.xml admin available public x86_64 ramdisk

IMAGE eki-685F1306 ubuntu10/vmlinuz.manifest.xml admin available public x86_64 kernel


Create a keypair to lunch instance


# euca-add-keypair mykey >> mykey.priv

# chmod 600 mykey.priv

# euca-describe-keypair


KEYPAIR mykey

f7:ac:8e:f5:05:19:2b:31:28:8c:9b:d7:b8:07:0c:3c:b6:34:8f:79


Lunch the Instance and Manage


# euca-run-instance emi-70B70EC0 -k mykey -t c1.medium


RESERVATION r-55560977 admin admin-default

INSTANCE i-50630A2A emi- 70B70EC 192.168.1.20 172.0.0.24 pending

mykey 2010-08-04T09:17:48.23Z eki-685F1306 eri- A2BE13EC


# euca-describe-instance


RESERVATION r-55560977 admin admin-default

INSTANCE i-50630A2A emi- 70B70EC 192.168.1.20 172.0.0.24 running

mykey 2010-08-04T09:17:48.23Z eki-685F1306 eri- A2BE13EC