eucalyptus installation guide

19
EUCALYPTUS 2.0 ON CENTOS 5.5 - INSTALLATION MANUAL Eucalyptus is an open source framework in order to set up a cloud environment. It can be installed on any Open Source OS from source or by using binary RPM packages. This document details the steps required to install Eucalyptus on centOS 5.5 from RPMs. Note : Check if your centOS is up-to-date before you start with the installation procedure. PREREQUISITES: XEN INSTALLATION: Login as root user using “su” command and then proceed with the installation procedures. Xen is a hypervisor which allows several guest operating systems to execute on the same computer hardware concurrently. Xen systems have a structure with the Xen hypervisor as the lowest and most privileged layer. Above this layer come one or more guest operating systems, which the hypervisor schedules across the physical CPUs. The first guest operating system, called in Xen terminology "domain 0" (dom0), boots automatically when the hypervisor boots and receives special management privileges and direct access to all physical hardware by default. The system administrator can log into dom0 in order to manage any further guest operating systems, Xen helps to realize virtualization concepts in Cloud Enviroments. Xen requires a specially modified Linux kernel and a number of tools in order to operate. You begin by installing the virtualization tools and kernel as follows: # yum groupinstall Virtualization This will install the following:

Upload: anugrahjonan

Post on 29-Nov-2014

400 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Eucalyptus Installation Guide

EUCALYPTUS 2.0 ON CENTOS 5.5 - INSTALLATION MANUAL

Eucalyptus is an open source framework in order to set up a cloud environment. It can be installed on any Open Source OS from source or by using binary RPM packages. This document details the steps required to install Eucalyptus on centOS 5.5 from RPMs.

Note: Check if your centOS is up-to-date before you start with the installation procedure.

PREREQUISITES:

XEN INSTALLATION:

Login as root user using “su” command and then proceed with the installation procedures.

Xen is a hypervisor which allows several guest operating systems to execute on the same computer hardware concurrently. Xen systems have a structure with the Xen hypervisor as the lowest and most privileged layer. Above this layer come one or more guest operating systems, which the hypervisor schedules across the physical CPUs. The first guest operating system, called in Xen terminology "domain 0" (dom0), boots automatically when the hypervisor boots and receives special management privileges and direct access to all physical hardware by default. The system administrator can log into dom0 in order to manage any further guest operating systems, Xen helps to realize virtualization concepts in Cloud Enviroments.

Xen requires a specially modified Linux kernel and a number of tools in order to operate. You begin by installing the virtualization tools and kernel as follows:

# yum groupinstall Virtualization

This will install the following:

Page 2: Eucalyptus Installation Guide

To install xen

# yum install -y xen

The following will be installed:

At this point, reboot the system. When the boot screen appears hit any key to enter to boot menu and select the CentOS with Xen boot option. When the boot has completed, log in as usual and open a Terminal window.

OTHER REQUISITIES:

Set date:

First you need to set data. This can be done in many ways. One of the options is as follows:

# date <today's date month/date/year>

For example, to set the date to January 22, 2011

The front end needs java, command to manipulate a bridge, and the binaries for dhcp server:

yum install -y java-1.6.0-openjdk ant ant-nodeps dhcp bridge-utils perl-Convert-ASN1.noarch scsi-target-utils httpd

Page 3: Eucalyptus Installation Guide

The installed dependencies are:

And then give the following command.

# yum install -y java-1.6.0-openjdk-devel libvirt-devel curl-devel httpd-devel apr-devel openssl-devel

......

Node needs to have a fully installed and configured installation of Xen that allows controlling the hypervisor via HTTP from localhost.

# sed --in-place 's/#(xend-http-server no)/(xend-http-server yes)/' /etc/xen/xend-config.sxp

# sed --in-place 's/#(xend-address localhost)/(xend-address localhost)/' /etc/xen/xend-config.sxp

# /etc/init.d/xend restart

Firewall rules must permit the Eucalyptus components to communicate with one another, and clients to communicate with Eucalyptus. On the front-end, port 8443 must be open; on the node (if on a separate machine), port 8775 must be open. If you are planning to use Elastic IPs and/or Security Groups, consider disabling the firewall and use Eucalyptus facilities for enabling custom firewall rules (see Network configuration for more information). To do so, on both the front-end and the nodes:

Page 4: Eucalyptus Installation Guide

# system-config-securitylevel-tui

select Security Level: Disabled

select OK

In what follows, the value of $VERSION must be set to the version of Eucalyptus you wish to install.

For example, you can set the value to 2.0.2 using bash:

# export VERSION=2.0.2

Page 5: Eucalyptus Installation Guide

DOWNLOAD AND INSTALL RPMS: Eucalyptus binary installation is broken up into several packages: one for each of the components (CLC, Walrus, CC, etc.), as well as a couple of common packages.

There are two options for downloading and installing the packages:

1. USING YUM OPTION:

Packages are available from the yum repository. To use this option, create '/etc/yum.repos.d/euca.repo' file with the following four lines:

Fill in the file with:

[euca]

name=Eucalyptus

baseurl=http://www.eucalyptussoftware.com/downloads/repo/eucalyptus/$VERSION/yum/centos/

enabled=1

Now install Eucalyptus on the front-end:

# yum install eucalyptus-cloud.$ARCH eucalyptus-cc.$ARCH eucalyptus-walrus.$ARCH eucalyptus-sc.$ARCH --nogpgcheck

.....

Page 6: Eucalyptus Installation Guide

and install Eucalyptus on the node:(node could be the same machine as your front end if you are comfortable with having them so)

# yum install eucalyptus-nc.$ARCH --nogpgcheck

where $ARCH is the architecture of your host (either 'i386' or 'x86_64')

.....

2. USING TARBALL OPTION:

The packages are available in a single tarball, wherein copies of third-party CentOS packages that Eucalyptus depends on (Rampart, Axis2C, many Java libraries) is also available, at http://open.eucalyptus.com/downloads (look for a CentOS tarball of the right Eucalyptus version and architecture).

Untar the bundle in a temporary location:

# tar zxvf eucalyptus-$VERSION-*.tar.gz

# cd eucalyptus-$VERSION-*

In the examples below we use x86_64, which should be replaced with i386 or i586 on 32-bit architectures.

Install RPMs on the front end

First, on the front end, install third-party dependency RPMs:

# cd eucalyptus-$VERSION*-rpm-deps-x86_64

#rpm -Uvh aoetools-21-1.el4.x86_64.rpm \

euca-axis2c-1.6.0-1.x86_64.rpm \

euca-rampartc-1.3.0-1.x86_64.rpm \

vblade-14-1mdv2008.1.x86_64.rpm \

vtun-3.0.2-1.el5.rf.x86_64.rpm \

lzo2-2.02-3.el5.rf.x86_64.rpm\

perl-Crypt-OpenSSL-Random-0.04-1.el5.rf.x86_64.rpm\

Page 7: Eucalyptus Installation Guide

perl-Crypt-OpenSSL-RSA-0.25-1.el5.rf.x86_64.rpm\

perl-Crypt-X509-0.32-1.el5.rf.noarch.rpm\

python25-2.5.1-bashton1.x86_64.rpm\

python25-devel-2.5.1-bashton1.x86_64.rpm\

python25-libs-2.5.1-bashton1.x86_64.rpm

# cd ..

then install the -cloud, -walrus, -cc and -sc RPMs:

# rpm -Uvh eucalyptus-$VERSION-*.x86_64.rpm \

eucalyptus-common-java-$VERSION-*.x86_64.rpm \

eucalyptus-cloud-$VERSION-*.x86_64.rpm \

eucalyptus-walrus-$VERSION-*.x86_64.rpm \

eucalyptus-sc-$VERSION-*.x86_64.rpm \

eucalyptus-cc-$VERSION-*.x86_64.rpm \

eucalyptus-gl-$VERSION-*.x86_64.rpm

Install RPMs on the nodes

Next, on each node install the dependency packages:

# cd eucalyptus-$VERSION*-rpm-deps-x86_64

# rpm -Uvh aoetools-21-1.el4.x86_64.rpm \

euca-axis2c-1.6.0-1.x86_64.rpm \

euca-rampartc-1.3.0-1.x86_64.rpm\

perl-Crypt-OpenSSL-Random-0.04-1.el5.rf.x86_64.rpm\

perl-Crypt-OpenSSL-RSA-0.25-1.el5.rf.x86_64.rpm\

perl-Crypt-X509-0.32-1.el5.rf.noarch.rpm\

python25-2.5.1-bashton1.x86_64.rpm\

python25-devel-2.5.1-bashton1.x86_64.rpm\

python25-libs-2.5.1-bashton1.x86_64.rpm

# cd ..

Page 8: Eucalyptus Installation Guide

then install the node controller RPM with dependencies:

# rpm -Uvh eucalyptus-$VERSION-*.x86_64.rpm \

eucalyptus-gl-$VERSION-*.x86_64.rpm \

eucalyptus-nc-$VERSION-*.x86_64.rpm

POST-INSTALL STEPS

The last step in the installation is to make sure that the user 'eucalyptus', which is created at RPM installation time, is configured to interact with the hypervisor through libvirt on all of your compute nodes. On each node, access the libvirtd configuration file at:

# /etc/libvirt/libvirtd.conf

Confirm that the following lines are uncommented, as shown:

#unix_sock_group = "libvirt" => unix_sock_group = "libvirt"

#unix_sock_ro_perms = "0777" => unix_sock_ro_perms = "0777"

#unix_sock_rw_perms = "0770" => unix_sock_rw_perms = "0770"

To check that libvirt is configured and interacting properly with the hypervisor, run the following

Page 9: Eucalyptus Installation Guide

command on each node:

# virsh list

The output of that command may include error messages (failed to connect to xend), but as long as it includes a listing of all domains (at least Domain-0), the configuration is in order.

Now start up your Eucalyptus services. On the front-end:

# /etc/init.d/eucalyptus-cloud start

# /etc/init.d/eucalyptus-cc start

On the node:

# /etc/init.d/eucalyptus-nc start

Page 10: Eucalyptus Installation Guide

FIRST-TIME SETUP : After you've started all components, you will need to perform registration so that they can communicate with each other.

Registering Eucalyptus Components

This section will assume that you have installed all Eucalyptus components and they are up and running. We will assume that your Eucalyptus setup consists of one front end and one or more nodes.

useful command: to find the ip address in centOS

# /sbin/ifconfig

The one corresponding to eth0 inet addr: xxx.xxx.xxx.xxx is your ip addr

First, you will need to register various front end components like walrus, cluster and storage controller. To do this, run the following commands on the front end.

# $EUCALYPTUS/usr/sbin/euca_conf --register-walrus <front end IP address>

Page 11: Eucalyptus Installation Guide

# $EUCALYPTUS/usr/sbin/euca_conf --register-cluster <clustername> <front end IP address>

# $EUCALYPTUS/usr/sbin/euca_conf --register-sc <clustername> <front end IP address>

Finally, you need to register nodes with the front end. To do so, run the following command on the front end,

# $EUCALYPTUS/usr/sbin/euca_conf --register-nodes "<Node 0 IP address> <Node 1 IP address> ... <Node N IP address>"

where "<Node X IP address>" is the IP address of host X that is running the Node Controller (NC).

At this point, you have successfully registered Eucalyptus components and are ready to begin your initial configuration.

Page 12: Eucalyptus Installation Guide

INITIAL CONFIGURATION: Point your browser to,

https://front-end-ip:8443

Since Eucalyptus is using a self-signed certificate, your browser is likely to prompt you to accept the certificate.

Click on add-exception if the prompt is like above.

NOTE: On some machines it may take few minutes after the starting of the Cloud Controller for the URL to be responsive the first time you run Eucalyptus.

You will be prompted for a user and password both of which are set to admin initially.

Page 13: Eucalyptus Installation Guide

Upon logging in the first time you will be asked to change the admin password, set the admin's email address, and confirm the IP of the Cloud Controller host.

After clicking 'Submit', you will see the 'Configuration' tab. Since you've used euca_conf to register Walrus and a cluster, they will be listed along with a few configurable parameters. Look over the parameters to see if any need adjustment.

To use the system with client tools, you must obtain user credentials. From the 'Credentials' tab, Eucalyptus users can obtain two types of credentials: x509 certificates and query interface credentials. Use the 'Download Credentials' button to download a zip-file with both or click on the 'Show Keys' to see the query interface credentials. You will be able to use your credentials with Euca2ools, Amazon EC2

Page 14: Eucalyptus Installation Guide

tools and third-party tools like rightscale.com.

Create a directory to store your credentials, unpack the zip-file into it, and source the included 'eucarc':

# mkdir $HOME/.euca

# unzip euca2-admin-x509.zip -d $HOME/.euca

# . $HOME/.euca/eucarc

NOTE: that you will have to source this file every time you intend to use the command-line tools, or you may add it to your local default environment.

Page 15: Eucalyptus Installation Guide

INSTALLING EUCA2OOLS: Euca2ools are command-line tools for interacting with Web services that export a REST/Query--‐based API compatible with Amazon EC2 and S3 services. There are 2 ways to install Euca2ools.

1) Yum option: Packages are available from Eucalyptus yum repository. To use it, create '/etc/yum.repos.d/euca.repo' file with the following four lines: # vi /etc/yum.repos.d/euca.repo [euca2ools]

name=Euca2ools

baseurl=http://www.eucalyptussoftware.com/downloads/repo/euca2ools/1.3.1/yum/centos/

enabled=1

and install euca2ools using the following option: # yum install euca2ools.$ARCH –nogpgcheck where $ARCH is either i386 or x86_64

2) Tarball option: Download the appropriate tarball from http://open.eucalyptus.com/downloads. Untar the bundle in a temporary location, install Python 2.5, and install euca2ools.

Page 16: Eucalyptus Installation Guide

# tar zxvf euca2ools-$VERSION-*.tar.gz

# cd euca2ools-$VERSION-*

# sudo -s

# yum install -y swig

# rpm -Uvh python25-2.5.1-bashton1.x86_64.rpm\

python25-libs-2.5.1-bashton1.x86_64.rpm\

euca2ools-$VERSION-*.x86_64.rpm

(replace x86_64 with i386 for 32-bit hosts)

MANAGING EUCALYPTUS IMAGES(2.0): First, be sure to source your 'eucarc' file before running the commands below.

NOTE: All users may upload and register images (depending on access granted to them by the Eucalyptus administrator), but only the admin user may ever upload/register kernels or ramdisks.

Adding Images

To enable a VM image as an executable entity, a user/admin must add a root disk image, a kernel/ramdisk pair (ramdisk may be optional) to Walrus and register the uploaded data with Eucalyptus. Each is added to Walrus and registered with Eucalyptus separately, using three EC2 commands. The following example uses the test image that we provide. Unpack it to any directory:

Add the kernel to Walrus, and register it with Eucalyptus.

(WARNING: Your bucket names must not end with a slash!):

# euca-bundle-image -i <kernel file> --kernel true

The following procedure shows adding euca-ubuntu-9.04-i386.

# euca-upload-bundle -b <kernel bucket> -m /tmp/<kernel file>.manifest.xml

Page 17: Eucalyptus Installation Guide

# euca-register <kernel-bucket>/<kernel file>.manifest.xml

Our test kernel does not require a ramdisk to boot. If the administrator would like to upload/register a kernel/ramdisk pair, the procedure is similar to the above:

# euca-bundle-image -i <initrd file> --ramdisk true

# euca-upload-bundle -b <initrd bucket> -m /tmp/<initrd file>.manifest.xml

# euca-register <initrd bucket>/<initrd file>.manifest.xml

Associating kernels and ramdisks with instances

A user may associate a specific kernel/ramdisk identifier with an image at the 'euca-bundle-image' step:

# euca-bundle-image -i <vm image file> --kernel <eki-XXXXXXXX> --ramdisk <eri-XXXXXXXX>

Page 18: Eucalyptus Installation Guide

Next, add the root filesystem image to Walrus:

# euca-upload-bundle -b <image bucket> -m /tmp/<vm image file>.manifest.xml

# euca-register <image bucket>/<vm image file>.manifest.xml

You can now view the updated status of the images uploaded under the images tab as shown below:

CONGRATS on successful installation of EUCALYPTUS 2.0 on centOS 5.5!!!

Page 19: Eucalyptus Installation Guide

Before starting a VM, you need to create at least one key pair. This key pair will be injected into the VM, allowing you to login to the VM Instance using the SSH command. # euca-add-keypair mykey >mykey.private Instantiate the VM, Where n is the number of instances and <emi-id> Is the specific image you wish to instantiate, as follows:

# euca-run-instances –k mykey –n <number-of-instances-to-start> <emi-id>

Query the system to view information about your VM instance(s) and verify that the VM instance is running as follows: # euca-describe-instances Once the VM instance is shown as running it will show two IP addresses that are assigned to it. Log into the IP address with the SSH key that you created as follows: # ssh –i mykey.private root@<ip-address>