Install A Private Cloud In One Hour Johnmwillis.

com @botchagalupe
Build a Private Cloud
Ubuntu Enterprise Cloud (UEC) is a private cloud that embeds Eucalyptus cloud on Ubuntu server. The current release of UEC runs on Ubuntu 9.04 Server running Eucalyptus 1.5. There is a latter version of Eucalyptus (i.e., 1.5.2); however, I didn't try that for this blog post. In this blog example I installed all of the UEC cloud components on a single system. Typically you would not want to do this; however, this works well as a demo system.

Quick UEC Overview
UEC is made up of three components: Cloud Controller (eucalyptus-cloud), Cluster Controller (eucalyptus-cc), and one or more Node Controllers (eucalyptus-nc). The Cloud Controller is the Webservices interface and the WEBUI server. The Cloud Controller also provides resource scheduling and S3 and EBS computable storage interfaces. A cluster in UEC is synonymous with an availability zone in AWS. In this release of UEC the Cluster Controller has to run on the same machine as the Cloud Controller. The Cluster Controller provides network control for the defined cluster and manages resources within the cluster (i.e., resources on the node). The Cloud Controller and the Cluster Controller are sometimes referred to as the Front End. Typically the Node Controller runs on a separate box from the Front End box. In a production environment there will be multiple Node Controllers making up a larger cluster (i.e., your cloud). Each Node Controller runs as a KVM hypervisor and all the Node Controllers in the cluster make up the cloud environment. In the current release, running multiple clusters is really not supported. In future releases of UEC, you will be able to run multiple clusters in one environment. Each cluster acts like an availability zone in the UEC environment. As I noted earlier, in this blog example, I am putting everything on the same box (my laptop). I will point out areas where the configuration would be different in a normal installation of UEC. The following diagram shows an example of an UEC environment.

The following list are the steps I followed to install a UEC environment: . 1) Download Ubuntu 9.04 Server (the latest version): 1. 2) Create an ISO image (I created a CD) 3) Install the ISO 1. I took all the defaults during the install 4) Install some pre-reqs for UEC 1. sudo apt-get install openssh 2. sudo apt-get install unzip 3. sudo apt-get install ssh 4. sudo apt-get install bridge-utils 5. sudo apt get install libopenssl-ruby curl ruby 5) Install the Cloud Manager (Front End) 1. sudo apt-get install eucalyptus-cloud (Cloud Manager) 2. sudo apt-get install eucalyptus-cc (Cluster Controller) 6) Create a cloud cluster 1. euca-conf -addcluster <clustername> localhost 7) Verify the Front End instal 1. https://<ip_address_of_the_FE>:8443 2. Default usr/pswd = admin/admin 3. You will be promoted to change the default admin password 4. You will be promoted to add an email account 5. In the configuration tab of the WEBUI you should change the localtion of Walrus from an IP address to "localhost". Walrus is the S3 emulation component. 6. Note: Sometimes I would have to invoke the first-time-in dialog a few times to get it to work. If at first you don't succeed . 8) All Node Controllers run as KVM hypervisors and must have a virtualization extension (IntelVT or AMD-V) chip. 9) Configure a bridge on the Node Controller 1. In this example, this is the same machine as the Front End 1. sudo /etc/init.d/networking stop 2. vi /etc/network/interfaces -- as follows:

# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # 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 dhcp bridge_ports eth0

3. Note: bridge_ports eth0 (there should be a tab on this line) 4. sudo /etc/init.d/networking start 5. Note: This would only be done on the NC if the NC was on a separate machine. 10) Install Node Controller 1. sudo apt-get install eucalyptus-nc 11) Configure /etc/eucalyptus/eucalyptus.conf on the Node Controller 1. Configure /etc/eucalyptus/eucalyptus.conf on the Node Controller 1. VNET_INTERFACE=br0 2. VNET_BRIDGE=br0 3. Note: When the Node Controller is on a separate box from the Front End the VNET_INTERFACE would be left as the default (VNET_INTERFACE=eth0). The Front End interface definitions do not have to be changed.. 4. Restart the Node Controller 5. sudo service eucalyptus-nc restart #### # there are the options for the network #### # VNET_INTERFACE specifies the local physical ethernet interface that # eucalyptus should use to manage the VM network. On the front-end, # this should be set to the device that is attached to the same # ethernet network as your nodes. On the nodes, this should be set to # either the name of the bridge that has been set up by Xen (xenbr0, # eth0, etc), or the physical ethernet device that is attached to the # xen bridge (peth0, peth1, etc), depending on your xen configuration. VNET_INTERFACE="br0"

# (node setting only) VNET_BRIDGE should be set to the name of the # bridge that xen has configured. This is typically named 'xenbr0, # xenbr1, etc' on older Xen versions, and 'eth0, eth1, etc' on newer # Xen versions. The command 'brctl show' will give you more # information on your local bridge setup. VNET_BRIDGE="br0"

12) Add a node to the cluster controller. 1. euca-conf -addnode <dns hostname> 2. The -addnode will create a public key for the node controller you have just added. This key will need to be propagated over to the Node Controller machine. You need to cut and paste the sshkey. 1. /var/lib/eucalyptus/.ssh/authorized_keys 3. Note the addnode and addcluster need to be done on the FE box 13) Install the EC2 AMI and API tools on the EC2 client machine. It is a good practice to install the EC2 tools on the Front End box in case you have to trouble shoot from there. Otherwise you would install these tools on the client box where you want to manage EUC instances. 1. unzip -d /opt /mnt/ 2. unzip -d /opt /mnt/ 3. Note: For this release of UEC the exact version listed above must be used. 14) Update your shell source script on the EC2 tools client machine (e.g., .bashrc) 1. /etc/environment JAVA_HOME=/usr/lib/jvm/default-java 2. Update your shell source script (e.g., .bashrc) export EC2_HOME=/opt/ec2-api-tools-1.3-30349 export EC2_AMITOOL_HOME=/opt/ec2-ami-tools-1.3-26357 . ~/.euca/eucarc PATH=$PATH:${EC2_HOME}/bin:${EC2_AMITOOL_HOME}/bin

15) From the UEC WEBUI download the cert zip file 1. unzip the cert file directory to the EC2 clinet machine 2. mkdir -m 700 ~/.euca 3. unzip -d .euca /mnt/ 4. exit and login to the session

16) In the current release of UEC there is an issue with the startup order of libvertd and the node controller. A quick fix for this is to the make the eucalyptus-nc have a higher position in the startup order. 1. sudo update-rc.d -f eucalyptus-nc remove 2. sudo update-rc.d eucalyptus-nc start 99 1 2 3 4 5 . stop 99 0 6 . 17) Troubleshooting Tips 1. ps auxw | grep cloud (looking for a running Java process for eucaliptus-cloud 2. ps auxw | grep cc (looking for the cluster controller) 3. ps auxw | grep nc (looking for the node controller) 4. /var/log/eucalyptus/cc.log (for cluster controller) 5. /var/log/eucalyptus/nc.log (for node controller) 6. /var/log/eucalyptus/cloud-debug.log* (for the cloud controller) 18) Verify the FE and NC environment 1. ec2-describe-availability-zones verbose AVAILABILITYZONE AVAILABILITYZONE AVAILABILITYZONE AVAILABILITYZONE AVAILABILITYZONE AVAILABILITYZONE AVAILABILITYZONE AVAILABILITYZONE dcs UP localhost |- vm types free / max cpu ram disk |- m1.small 0002 / 0002 1 128 1 |- c1.medium 0002 / 0002 1 256 2 |- m1.large 0001 / 0001 2 512 10 |- m1.xlarge 0001 / 0001 2 1024 20 |- c1.xlarge 0000 / 0000 4 2048 20 |- localhost certs[cc=true,nc=true] @ Thu Sep 03 15:11:09 EDT 2009

Sign up to vote on this title
UsefulNot useful