You are on page 1of 36

– Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.

5 –

Author – Nilesh Ravindra Joshi

Contents

Eucalyptus terminology & Architecture ......................................................................................................... 1


Hardware ....................................................................................................................................................... 3
Export the variables ...................................................................................................................................... 3
Setup yum repo for Eucalyptus ..................................................................................................................... 4
Prerequisites ................................................................................................................................................. 4
Install Xen package on NC............................................................................................................................ 4
Install Front end ............................................................................................................................................ 4
Install NC ....................................................................................................................................................... 5
Start CLC, SC and Walrus ............................................................................................................................ 5
Start NC......................................................................................................................................................... 5
Install Euca2ools on CentOS 5.5 [Front End server] .................................................................................... 6
Switch off OS firewall (On both front end as well NC) .................................................................................. 6
Install Certificate User side setup ................................................................................................................. 6
Registering Eucalyptus Components ............................................................................................................ 7
Add Images ................................................................................................................................................... 8
Run instances and login .............................................................................................................................. 11
Adding users and managing/launching VMs via command line ................................................................. 15
Creating customized images ....................................................................................................................... 21
Using KVM as a hypervisor ......................................................................................................................... 25

Eucalyptus terminology & Architecture

Eucalyptus consists of five main components that work together to provide the requisite cloud services.

Cloud Controller (CLC) - Within a Eucalyptus cloud, this is the main controller component responsible for
managing the entire system. It is the main entry point into the Eucalyptus cloud for all users and
administrators. All clients will communicate only with the CLC using the SOAP (Simple Object Access
Protocol) or REST (Representational State Transfer)-based API. The CLC is responsible for passing on
requests to the right component, collecting them, and sending the responses from the components back
to the client. This is the public face to the Eucalyptus cloud. CLC provides a UI (an https server on port
8443)

Cluster Controller (CC) - The controller component within Eucalyptus responsible for managing the entire
virtual instance network. Requests are communicated to the CC using the SOAP or REST-based
interface. The CC maintains all the information about the Node Controllers that run in the system and is
responsible for controlling the life cycle of the instances. It routes requests for starting virtual instances to
the Node Controller with available resources.

1 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Node Controller (NC) - This controls the host operating system and the corresponding hypervisor (Xen or
KVM currently, with support for VMware on the horizon). You must run an instance of the NC on each
machine that will be hosting the actual virtual instances instantiated upon request from a CC.

Walrus (W) - Walrus is a storage service similar to that of Amazon S3. The primary use of Walrus is to
store VM images called Eucalyptus Machine Images (EMIs). The controller component that manages
access to the storage services within Eucalyptus. Requests are communicated to Walrus using the SOAP
or REST-based interface.

Storage Controller (SC) - The storage service within Eucalyptus that implements Amazon’s S3 interface.
SC is used for storing and accessing virtual machine images. The VM images can be public or private
and are initially stored in compressed and encrypted form. The images are decrypted only when a node
needs to start a new instance and requests access to the image.

Setup Architecture –

In any Eucalyptus Cloud Installation, there are 2 top-level components: Cloud Controller (CLC) and
Walrus. These 2 components manage the various clusters, where cluster is a set of physical machines
that host the Virtual Instances. In each cluster, there are 2 components that interact with the high level
components: Cluster Controller (CC) and Storage Controller (SC). CC and SC is cluster – level
components. Each cluster is composed of various Nodes, or physical machines. Each Node will run a
Node Controller (NC) that will control the hypervisor for managing the Virtual Instances.
For this setup, we have implemented a Single-Cluster Installation, where all the components except NC
are co-located on one machine. As per Eucalyptus documentation, this co-located system is called: front-
end.

The Node Controller uses Xen as a hypervisor. The NC service runs on Domain-0 kernel in the Xen
Setup.

2 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Ideal Eucalyptus Cloud Setup –

Hardware

Our frontend server and NC build with following hardware config -

Intel Core 2 Duo Processor 1.8 GHz (VT enabled) with 4 GB RAM, 160 GB HDD.

Export the variables

# export VERSION=2.0.0
# export ARCH=x86_64

NOTE: Setup a proxy for yum –

# export http_proxy=http://username:******@proxy.domainname:8080

3 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Setup yum repo for Eucalyptus

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

[euca]
name=Eucalyptus
baseurl=http://www.eucalyptussoftware.com/downloads/repo/eucalyptus/2.0.0/yum/centos/
enabled=1

Prerequisites

Front-end, node(s), and client machine system clocks are synchronized (e.g., using NTP).

# yum install -y ntp


# /etc/init.d/ntpd start
# ntpdate xx.xx.xxx.xxx

Front end needs java, command to manipulate a bridge, and the binaries for dhcp server (do not
configure or run dhcp server on the CC):

# yum install -y java-1.6.0-openjdk ant ant-nodeps dhcp bridge-utils perl-Convert-


ASN1.noarch scsi-target-utils httpd

Configure SMTP (Sendmail) have front-end IP in relay list.

Disable firewall & SELinux

Install Xen package on NC

# yum install -y xen


# 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

Install Front end

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


eucalyptus-sc.$ARCH --nogpgcheck

4 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Install NC

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

Start CLC, SC and Walrus

# /etc/init.d/eucalyptus-cloud start
Starting Eucalyptus services: walrus sc cloud done.

# /etc/init.d/eucalyptus-cc start
Starting Eucalyptus cluster controller: done.

Start NC

# /etc/init.d/eucalyptus-nc start
You should have at least 32 loop devices
Starting Eucalyptus services:
Enabling IP forwarding for eucalyptus.

Enabling bridge netfiltering for eucalyptus.


done.

NOTE: When I start eucalyptus-nc service I get below message.

# /etc/init.d/eucalyptus-nc status
You should have at least 32 loop devices

So it means we have to create at least 32 loop devices to get rid of this message.

# vi /etc/modprobe.conf

>>>>> ADD options loop max_loop=32 at EOF <<<<<<

# for i in `seq 8 31`; do mknod -m660 /dev/loop$i b 7 $i; done


# chown root:disk /dev/loop*

Now, when I re-start the service again I don't see that same message -

# /etc/init.d/eucalyptus-nc start
Starting Eucalyptus services:
Enabling bridge netfiltering for eucalyptus.
done.

5 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Install Euca2ools on CentOS 5.5 [Front End server]

Create '/etc/yum.repos.d/euca.repo' file with the following four lines:

[euca2ools]
name=Euca2ools
baseurl=http://www.eucalyptussoftware.com/downloads/repo/euca2ools/2.0.0/yum/centos/
enabled=1

# export VERSION=1.3.1
# export ARCH=x86_64
# yum install euca2ools.$ARCH --nogpgcheck

Switch off OS firewall (On both front end as well NC)

# iptables -F
# /etc/init.d/iptables stop

Better use chkconfig or /etc/rc.local file to do this. I prefer using /etc/rc.local file.

On front end and NC -

/etc/init.d/iptables stop
/sbin/iptables -F

Install Certificate User side setup

visit https://frontend:8443
log in using the password you set (if you used the GUI earlier) or admin/admin
select the "Credentials" tab
Select "Download Credentials"

# mkdir ~/.euca
# chmod 700 ~/.euca
# ls -l euca2-admin-x509.zip
# mv euca2-admin-x509.zip ~/.euca
# unzip euca2-admin-x509.zip
Archive: euca2-admin-x509.zip
To setup the environment run: source /path/to/eucarc
inflating: eucarc
inflating: cloud-cert.pem
inflating: jssecacerts
inflating: euca2-admin-3947cb34-pk.pem
inflating: euca2-admin-3947cb34-cert.pem

# chmod 600 *

6 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# source eucarc
# echo "source ~/.euca/eucarc" >> ~/.bashrc
# cd

Registering Eucalyptus Components

NOTE: REF - http://community.eucalyptus.com/forum/failed-install-centos-54

While executing below commands I was getting below error -

"ERROR: failed to register Walrus, please log in to the admin interface and check cloud status."

After a lot of investigation what I understood is -

The issue turned out that my Proxy variables in roots shell were causing communication Issues
between the processes. As they use wget in some places inside the Eucalyptus code.. So if you
have issues you may want to make sure the following variables are unset:

http_proxy
ftp_proxy
HTTP_PROXY
FTP_PROXY

Register various front end components

# /usr/sbin/euca_conf --register-walrus "xx.xx.xx.xx"


# /usr/sbin/euca_conf --register-cluster Cluster01 "xx.xx.xx.xx"
# /usr/sbin/euca_conf --register-sc Cluster01 "xx.xx.xx.xx"
# /usr/sbin/euca_conf --register-nodes "xx.xx.xx.xx"
# euca-describe-availability-zones verbose

==========================================================

# /usr/sbin/euca_conf --register-walrus "xx.xx.xx.xx"


Adding WALRUS host xx.xx.xx.xx

Trying rsync to sync keys with "xx.xx.xx.xx"...The authenticity of host 'xx.xx.xx.xx


(xx.xx.xx.xx)' can't be established.
RSA key fingerprint is 7f:af:30:06:9c:a0:5f:ae:09:11:f0:26:5d:ef:5e:0d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xx.xx.xx.xx' (RSA) to the list of known hosts.
root@xx.xx.xx.xx's password:
done.

SUCCESS: new walrus on host 'xx.xx.xx.xx' successfully registered.

# /usr/sbin/euca_conf --register-cluster Cluster01 "xx.xx.xx.xx"

Trying rsync to sync keys with "xx.xx.xx.xx"...root@xx.xx.xx.xx's password:


done.

SUCCESS: new cluster 'Cluster01' on host 'xx.xx.xx.xx' successfully registered.

# /usr/sbin/euca_conf --register-sc Cluster01 "xx.xx.xx.xx"

7 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Adding SC xx.xx.xx.xx to cluster Cluster01

Trying rsync to sync keys with "xx.xx.xx.xx"...root@xx.xx.xx.xx's password:


done.

SUCCESS: new SC for cluster 'Cluster01' on host 'xx.xx.xx.xx' successfully


registered.

# /usr/sbin/euca_conf --register-nodes "xx.xx.xx.xx"

INFO: We expect all nodes to have eucalyptus installed in / for key synchronization.

Trying rsync to sync keys with "xx.xx.xx.xx"...The authenticity of host 'xx.xx.xx.xx


(xx.xx.xx.xx)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xx.xx.xx.xx' (RSA) to the list of known hosts.
Address xx.xx.xx.xx maps to hostname.domainname, but this does not map back to the
address - POSSIBLE BREAK-IN ATTEMPT!
root@xx.xx.xx.xx's password:
done.

ADD ENTRY FOR THIS SERVER TO THE /etc/hosts FILE.

# /usr/sbin/euca_conf --register-nodes "xx.xx.xx.xx"

INFO: We expect all nodes to have eucalyptus installed in / for key synchronization.

Trying rsync to sync keys with "xx.xx.xx.xx"...root@xx.xx.xx.xx's password:


done.

# euca-describe-availability-zones verbose
AVAILABILITYZONE Cluster01 xx.xx.xx.xx
AVAILABILITYZONE |- vm types free / max cpu ram disk
AVAILABILITYZONE |- m1.small 0002 / 0002 1 128 2
AVAILABILITYZONE |- c1.medium 0002 / 0002 1 256 5
AVAILABILITYZONE |- m1.large 0001 / 0001 2 512 10
AVAILABILITYZONE |- m1.xlarge 0001 / 0001 2 1024 20
AVAILABILITYZONE |- c1.xlarge 0000 / 0000 4 2048 20

==========================================================

Add Images

Before jumping into this you should know first?

- VM images are stored in Walrus - a storage subsystem of Eucalyptus cloud controller.


- Walrus is divided into several areas called buckets.
- Objects inside Walrus are identified by a bucket name and object name (think: path and
filename).
- To make your VM image available in Eucalyptus, you need to register it. If you want to delete it,
you should deregister it first.
- That means that storing object is a 3 step process: create, upload, register.

8 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


- A registered object gets a unique identifier. Eucalyptus (non-Walrus) commands use this
identifiers instead of filenames.
- There are 3 types of objects: kernel, root filesystem and initrd (the last one is optional).
- At runtime, in addition to root filesystem, each VM will also get a swap and ephemeral partition.
The latter is an empty filesystem to store temporary files.

Setup the HTTP_PROXY environment variable and download the image

# wget http://eucalyptussoftware.com/downloads/eucalyptus-images/euca-centos-5.3-
x86_64.tar.gz
# tar zxvf euca-centos-5.3-x86_64.tar.gz
# cd euca-centos-5.3-x86_64
]# ls -lrt
total 1026040
-rw-r--r-- 1 root root 1049624576 Apr 24 2009 centos.5-3.x86-64.img
drwxr-xr-x 2 root root 4096 May 13 2009 xen-kernel
drwxr-xr-x 2 root root 4096 May 13 2009 kvm-kernel
# euca-bundle-image -i xen-kernel/vmlinuz-2.6.27.21-0.1-xen --kernel true
Traceback (most recent call last):
File "/usr/bin/euca-bundle-image", line 39, in ?
from euca2ools import Euca2ool, FileValidationError, Util, \
ImportError: No module named euca2ools

NOTE: I get above error for all euca2ools commands, every euca-* command fails with this error
and this is what I can figure it out == CentOS is still distributing Python 2.4 by default. The
euca2ools installer has a dependency on python2.5. So, python2.5 is installed and then euca2ools
is installed as a library for python2.5. However, when you run the euca2ools scripts, they are still
being run with the python2.4 interpreter and the euca2ools library cannot be found.

As a part of solution I've two options - either downgrade to euca2ools 1.2 or modify Phythondir variable.

#!/bin/sh
find /usr/bin -type f -name 'euca-*' | xargs sed -i
's/#!\/usr\/bin\/python/#!\/usr\/bin\/python25/g'
find /usr/sbin -type f -name 'euca-*' | xargs sed -i 's/#!\/usr\/bin\/env
python/#!\/usr\/bin\/env python25/g'

Okay, finally after executing above script I able to execute script successfully BUT later I again
encountered a lot of issues with euca-register commands and was getting an error like -

# euca-register centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
Warning: failed to parse error message from AWS: :1:0: syntax error
EC2ResponseError: 400 Bad Request
Failure: 400 Bad Request
Failed to bind the following fields:
Location = centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml

Hence I upgraded euca2tools to 1.3.1

# rpm -qa | grep euca2


euca2ools-1.3.1-1

Now unset the HTTP_PROXY variable and execute -

9 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# euca-bundle-image -i xen-kernel/vmlinuz-2.6.27.21-0.1-xen --kernel true
Checking image
Tarring image
Encrypting image
Splitting image...
Part: vmlinuz-2.6.27.21-0.1-xen.part.0
Generating manifest /tmp/vmlinuz-2.6.27.21-0.1-xen.manifest.xml

# euca-upload-bundle -b centos-kernel-bucket -m /tmp/vmlinuz-2.6.27.21-0.1-


xen.manifest.xml
Checking bucket: centos-kernel-bucket
Creating bucket: centos-kernel-bucket
Uploading manifest file
Uploading part: vmlinuz-2.6.27.21-0.1-xen.part.0
Uploaded image as centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml

# euca-register centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
IMAGE eki-8E3416F8

# euca-bundle-image -i xen-kernel/initrd-2.6.27.21-0.1-xen --ramdisk true


Checking image
Tarring image
Encrypting image
Splitting image...
Part: initrd-2.6.27.21-0.1-xen.part.0
Generating manifest /tmp/initrd-2.6.27.21-0.1-xen.manifest.xml

# euca-upload-bundle -b centos-ramdisk-bucket -m /tmp/initrd-2.6.27.21-0.1-


xen.manifest.xml
Checking bucket: centos-ramdisk-bucket
Creating bucket: centos-ramdisk-bucket
Uploading manifest file
Uploading part: initrd-2.6.27.21-0.1-xen.part.0
Uploaded image as centos-ramdisk-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml

# euca-register centos-ramdisk-bucket/initrd-2.6.27.21-0.1-xen.manifest.xml
IMAGE eri-889216D6

# euca-bundle-image -i centos.5-3.x86-64.img --kernel eki-8E3416F8 --ramdisk eri-


889216D6
Checking image
Tarring image
Encrypting image
Splitting image...
Part: centos.5-3.x86-64.img.part.0
Part: centos.5-3.x86-64.img.part.1
Part: centos.5-3.x86-64.img.part.2
Part: centos.5-3.x86-64.img.part.3
Part: centos.5-3.x86-64.img.part.4
Part: centos.5-3.x86-64.img.part.5
Part: centos.5-3.x86-64.img.part.6
Part: centos.5-3.x86-64.img.part.7
Part: centos.5-3.x86-64.img.part.8
Part: centos.5-3.x86-64.img.part.9
Part: centos.5-3.x86-64.img.part.10

10 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Part: centos.5-3.x86-64.img.part.11
Part: centos.5-3.x86-64.img.part.12
Part: centos.5-3.x86-64.img.part.13
Part: centos.5-3.x86-64.img.part.14
Part: centos.5-3.x86-64.img.part.15
Part: centos.5-3.x86-64.img.part.16
Part: centos.5-3.x86-64.img.part.17
Part: centos.5-3.x86-64.img.part.18
Generating manifest /tmp/centos.5-3.x86-64.img.manifest.xml

# euca-upload-bundle -b centos-image-bucket -m /tmp/centos.5-3.x86-


64.img.manifest.xml
Checking bucket: centos-image-bucket
Creating bucket: centos-image-bucket
Uploading manifest file
Uploading part: centos.5-3.x86-64.img.part.0
Uploading part: centos.5-3.x86-64.img.part.1
Uploading part: centos.5-3.x86-64.img.part.2
Uploading part: centos.5-3.x86-64.img.part.3
Uploading part: centos.5-3.x86-64.img.part.4
Uploading part: centos.5-3.x86-64.img.part.5
Uploading part: centos.5-3.x86-64.img.part.6
Uploading part: centos.5-3.x86-64.img.part.7
Uploading part: centos.5-3.x86-64.img.part.8
Uploading part: centos.5-3.x86-64.img.part.9
Uploading part: centos.5-3.x86-64.img.part.10
Uploading part: centos.5-3.x86-64.img.part.11
Uploading part: centos.5-3.x86-64.img.part.12
Uploading part: centos.5-3.x86-64.img.part.13
Uploading part: centos.5-3.x86-64.img.part.14
Uploading part: centos.5-3.x86-64.img.part.15
Uploading part: centos.5-3.x86-64.img.part.16
Uploading part: centos.5-3.x86-64.img.part.17
Uploading part: centos.5-3.x86-64.img.part.18
Uploaded image as centos-image-bucket/centos.5-3.x86-64.img.manifest.xml

# euca-register centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
IMAGE emi-1D2D15B1

Run instances and login

Create keypair first

# euca-add-keypair my-key > ~/.ssh/id_rsa-my-key


# chmod 600 ~/.ssh/id_rsa-my-key

Run the instance

See what all images available –

Command line –

11 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# euca-describe-images
IMAGE eki-8DE616F2 centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-
xen.manifest.xml admin available public x86_64
kernel instance-store
IMAGE emi-1CDA15AF centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
admin available public x86_64 machine eki-8DE616F2 eri-
883D16CD instance-store
IMAGE eri-883D16CD centos-ramdisk-bucket/initrd-2.6.27.21-0.1-
xen.manifest.xml admin available public x86_64
ramdisk instance-store

GUI –

Run the instance

# euca-run-instances -k my-key --kernel eki-8E3416F8 --ramdisk eri-889216D6 emi-


1D2D15B1
RESERVATION r-42CE07C1 admin admin-default
INSTANCE i-2DFB0640 emi-1D2D15B1 0.0.0.0 0.0.0.0 pending my-key 2010-
11-02T10:46:47.938Z eki-8E3416F8 eri-889216D6

After for a moment, instance has an IP address BUT in our case I was not that lucky and I got this –

# euca-describe-instances
RESERVATION r-4CC5098C admin default
INSTANCE i-402E07E7 emi-1CDA15AF 0.0.0.0 0.0.0.0 terminated my-
key 0 m1.small 2010-11-02T12:56:52.574Z Cluster01 eki-
8DE616F2 eri-883D16CD

Okay, finally I got it running state. The issue was insufficient disk space! So I changed INSTANCE_PATH
variable in /etc/eucalyptus/eucalyptus.conf

12 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# euca-describe-instances
RESERVATION r-3F7E0815 admin default
INSTANCE i-46D608A5 emi-1CDA15AF 0.0.0.0 0.0.0.0 running my-key
0 m1.small 2010-11-02T13:45:17.624Z Cluster01 eki-
8DE616F2 eri-883D16CD

BUT still there is no IP that we can see on the CC/CLC.

I’m using SYSTEM MODE and there is a caveat as described below.

CAVEATS - In this mode, as mentioned previously, VMs are simply started with their Ethernet
interfaces attached to the local Ethernet without any isolation. Practically, this means that you
should treat a VM the same way that you would treat a non-VM machine running on the network.
Eucalyptus does its best to discover the IP address that was assigned to a running VM via a third-
party DHCP server, but can be unsuccessful depending on the specifics of your network (switch
types/configuration, location of CC on the network, etc.). Practically, if Eucalyptus cannot
determine the VM's IP, then the user will see '0.0.0.0' in the output of 'describe-instances' in both
the private and public address fields. The best workaround for this condition is to instrument your
VMs to send some network traffic to your front end on boot (after they obtain an IP address). For
instance, setting up your VM to ping the front-end a few times on boot should allow Eucalyptus to
be able to discover the VMs IP.

We have to tweak our VM images in such a way that we should be able to ping front end server when VM
will boot. Let’s see how to do that –

First stop the running instance –

# euca-terminate-instances i-3D0D082D
INSTANCE i-3D0D082D

# euca-describe-instances
RESERVATION r-4C2E08BC admin default
INSTANCE i-3D0D082D emi-1CDA15AF 0.0.0.0 0.0.0.0 shutting-down my-
key 0 m1.small 2010-11-02T15:41:52.758Z Cluster01 eki-
8DE616F2 eri-883D16CD

After couple of minutes

# euca-describe-instances
RESERVATION r-4C2E08BC admin default
INSTANCE i-3D0D082D emi-1CDA15AF 0.0.0.0 0.0.0.0 terminated my-key
0 m1.small 2010-11-02T15:41:52.758Z Cluster01 eki-8DE616F2
eri-883D16CD

Now deregister the kernel, ramdisk and OS images

# euca-describe-images
IMAGE eki-8DE616F2 centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-
xen.manifest.xml admin available public x86_64
kernel instance-store
IMAGE emi-1CDA15AF centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
admin available public x86_64 machine eki-8DE616F2 eri-883D16CD
instance-store

13 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


IMAGE eri-883D16CD centos-ramdisk-bucket/initrd-2.6.27.21-0.1-
xen.manifest.xml admin available public x86_64
ramdisk instance-store

# euca-deregister eki-8DE616F2
IMAGE eki-8DE616F2

# euca-deregister eri-883D16CD
IMAGE eri-883D16CD

# euca-deregister emi-1CDA15AF
IMAGE emi-1CDA15AF

Now command “euca-describe-images” should not return any value.

Now we are ready to tweak the VM image.

# mount -o loop centos.5-3.x86-64.img /mnt/


# chroot /mnt/
bash-3.2#
bash-3.2# echo ping -c15 xx.xx.xx.xx >> /etc/rc.local >>>> For some reason vi
editor is not installed on sample VM
bash-3.2# passwd
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is based on your username
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
bash-3.2# exit

# umount /mnt/

Okay, now image has been modified to send ping request to front-end server while it will boot and set root
password.

Now recreate the images using euca-* commands. [Jump to - Add Images section]

Now run the instance using euca-* commands. [Jump to - Run instances section]

Great news - it's working! Whoo hooo! I'm in. OK, a newbie victory but a victory all the same.

# euca-describe-instances
RESERVATION r-4E3208ED admin default
INSTANCE i-3EA5078C emi-1CF415A8 xx.xx.xx.xx xx.xx.xx.xx
running my-key 0 m1.small 2010-11-03T07:00:58.114Z
Cluster01 eki-8E5B1702 eri-886D16CE

Now happily connect to the instance –

# ssh -i .ssh/id_rsa-my-key -l root xx.xx.xx.xx


The authenticity of host 'xx.xx.xx.xx (xx.xx.xx.xx)' can't be established.
RSA key fingerprint is fd:e2:1f:86:a8:51:2d:e1:6c:66:65:43:ca:99:4a:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xx.xx.xx.xx' (RSA) to the list of known hosts.

14 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


-bash-3.2# uname -a
Linux localhost 2.6.27.21-0.1-xen #1 SMP 2009-03-31 14:50:44 +0200 x86_64 x86_64
x86_64 GNU/Linux
-bash-3.2# ifconfig
eth0 Link encap:Ethernet HWaddr D0:0D:3E:A5:07:8C
inet addr:xx.xx.xx.xx Bcast:xx.xx.xx.xxx Mask:xxx.xxx.xxx.x
inet6 addr: fe80::d20d:3eff:fea5:78c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7563 errors:0 dropped:0 overruns:0 frame:0
TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:606969 (592.7 KiB) TX bytes:11843 (11.5 KiB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

Adding users and managing/launching VMs via command line

Request account to Eucalyptus Administrator.

Login Eucalyptus interface with admin user - https://xx.xx.xxx.xx:8443

Click on users and click on Add User

15 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Take a note of “Skip email confirmation” checkbox ticked. This is because Eucalyptus administration will
create the accounts and user cannot subscribe.

Click on Add User

16 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# euca-describe-users
USER admin username@persistent.co.in ADMIN ENABLED
USER-GROUP admin default
USER-CERT admin CN=admin, OU=Eucalyptus, O=User, C=US 120834736467567
USER-KEYS admin WKy3rMzOWPouVOxK1p3Ar1C2uRBwa2FBXnCw
mQuz4wFMZ4RruidUvtoU1VLiwQwRhIpyYkcnw
USER-CODE admin
WTUloKRUfORDFYF1zCLDgXArvvyE6onwMdnYhw3z8QO9J0mOkneFQVkJsaKF6X2TQijWoKz3krn7DUgYQig
USER-WEB admin
PcJWbJXOd7wHszGdkCTfgaeKy4EndnQ73LZHtVqB3rtfPHXwfQ1MW01RtuMHPK5mxbxaEaCJq19cG7KLg
USER nj0001 username@persistent.co.in ENABLED
USER-GROUP nj0001 default
USER-CERT nj0001 None None
USER-KEYS nj0001 SN8sRFDGAFc6dNMxam6eW9XImZYWx2LNIMYNw
IZMItrkgR5C4zEINfH5zKiCR1yAkcD3EKiMtQ
USER-CODE nj0001
T36qm7uMO1wp9VWbt2JXnAsKwspKSC9zaJRXILj9kxS9KVJI8WchllxUZ0FtPCrIdIrOp858oVPiIjGlFy7w
USER-WEB nj0001
3XvQbMppjuGSppRTI5GeoGwxyMxgsKOxgI5vfUvY6x1KoCvbEeQrv7ogyamDBs4ocOWZAxAHuzh2jiy1RVkkA
USER st0001 username@persistent.co.in ENABLED
USER-GROUP st0001 default
USER-CERT st0001 None None
USER-KEYS st0001 VZBJz5dNWGSs0kGgWLqhAkPVvR0tTl68UmhMg
F6k4okH7YHlvSDXCW3hGyoKPDTPNKq1i3FVOA
USER-CODE st0001
rmllrk0RQv7K0Dc5WSSV0RceQzWJUgn3FcAnvYpogH7BPXPJ6o4OYShEl9Z1hyvWL4H8DVN2wel9l8TwHNTg
USER-WEB st0001
oPmoSViiax6IfMebyqRtTuWq52VFlSEWLKwIseHrXnCnPX8sUwaJqYcjERSM2Z4vMfopUGtq8dhY9wRAUmQ

Now create a normal user nj0001 on frontend server –

# useradd nj0001
# id nj0001
uid=501(nj0001) gid=501(nj0001) groups=501(nj0001)
# passwd nj0001
Changing password for user nj0001.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word

17 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Login to frontend server as nj0001

login as: nj0001


nj0001@xx.xx.xxx.xx's password:
$ id
uid=501(nj0001) gid=501(nj0001) groups=501(nj0001)

Access to https://your frontend server:8443 and login as nj0001

18 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Click 'Download Certificate' and download certificate to your PC and upload back it to front end server to
nj0001 home directory.

$ pwd
/home/nj0001
$ ls -l
total 8
-rw-rw-r-- 1 nj0001 nj0001 4942 Nov 3 17:22 euca2-nj0001-x509.zip

Now we will create a keypair for nj0001

$ mkdir -p ~/.euca/certs
$ chmod -R 700 ~/.euca/certs
$ mv euca2-nj0001-x509.zip ~/.euca/certs
$ cd ~/.euca/certs
$ unzip euca2-nj0001-x509.zip
Archive: euca2-nj0001-x509.zip
To setup the environment run: source /path/to/eucarc
inflating: eucarc
inflating: cloud-cert.pem
inflating: jssecacerts

19 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


inflating: euca2-nj0001-696a27ad-pk.pem
inflating: euca2-nj0001-696a27ad-cert.pem
$ rm -rf euca2-nj0001-x509.zip
$ chmod 600 *
$ source eucarc
$ echo "source ~/.euca/certs/eucarc" >> ~/.bashrc
$ cd
$ euca-add-keypair my_key > ~/.euca/my_key
$ chmod 600 ~/.euca/my_key

Now run the instance and login to it.

List the available images –

$ euca-describe-images -a
IMAGE eri-886D16CE centos-ramdisk-bucket/initrd-2.6.27.21-0.1-
xen.manifest.xml admin available public x86_64
ramdisk instance-store
IMAGE eki-8E5B1702 centos-kernel-bucket/vmlinuz-2.6.27.21-0.1-
xen.manifest.xml admin available public x86_64
kernel instance-store
IMAGE emi-1CF415A8 centos-image-bucket/centos.5-3.x86-64.img.manifest.xml
admin available public x86_64 machine eki-8E5B1702 eri-
886D16CE instance-store

$ euca-run-instances -k my_key --kernel eki-8E5B1702 --ramdisk eri-886D16CE emi-


1CF415A8
RESERVATION r-4FE9088F nj0001 nj0001-default
INSTANCE i-4AF50836 emi-1CF415A8 0.0.0.0 0.0.0.0 pending my_key 2010-
11-03T12:08:20.476Z eki-8E5B1702 eri-886D16CE

$ euca-describe-instances
RESERVATION r-4FE9088F nj0001 default
INSTANCE i-4AF50836 emi-1CF415A8 10.88.88.231 10.88.88.231
running my_key 0 m1.small 2010-11-03T12:08:20.476Z
Cluster01 eki-8E5B1702 eri-886D16CE

$ ssh -i ~/.euca/my_key -l root 10.88.88.231


The authenticity of host '10.88.88.231 (10.88.88.231)' can't be established.
RSA key fingerprint is 3b:f8:25:db:79:a4:6e:a7:7b:6b:90:37:a8:87:3f:25.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.88.88.231' (RSA) to the list of known hosts.
-bash-3.2# uname -a
Linux localhost 2.6.27.21-0.1-xen #1 SMP 2009-03-31 14:50:44 +0200 x86_64 x86_64
x86_64 GNU/Linux

In case if you’re not comfortable on command line then you can use Firefox plug-in known as Hybridfox to
manage the VMs.

The overall process is -

20 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Creating customized images

To create your own/ customized kernel, ramdisk and disk images follow below procedure and then extract
the kernel, ramdisk from that newly installed VM and then transfer them to frontend server along with disk
image after this using euca2tools bundle it, upload it and register it and run.

This section will describe above process.

# export ARCH=x86_64
# dd if=/dev/zero of=/home/images/centos5.5-base.img bs=1M count=10240
# /sbin/mke2fs -F -j /home/images/centos5.5-base.img
# mount -o loop /home/images/centos5.5-base.img /home/images/Baseimage
# mkdir -p /home/images/Baseimage/{etc,dev,proc,sys,var/lock/rpm}
# vi /home/images/Baseimage/etc/fstab

>>>>> fstab contents <<<<<

/dev/sda1 / ext3 defaults 1 1


/dev/sdb /mnt ext3 defaults 0 0
none /proc proc defaults 0 0

21 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


none /sys sysfs defaults 0 0

# mount -t proc none /home/images/Baseimage/proc/


# for i in console null zero ; do /sbin/MAKEDEV -d /home/images/Baseimage/dev -x $i ;
done
# vi /root/yum.centos.conf

>>>>>> yum.centos.conf contents <<<<<<<

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
gpgcheck=0
obsoletes=1
reposdir=/dev/null

[base]
name=CentOS 5 - $basearch - Base
baseurl=http://ftp.belnet.be/packages/centos/5.5/os/x86_64/
enabled=1

[updates-released]
name=CentOS 5 - $basearch - Released Updates
baseurl=http://ftp.belnet.be/packages/centos/5.5/updates/x86_64/
enabled=1

# yum -y -c /root/yum.centos.conf --installroot=/home/images/Baseimage groupinstall


Base
# yum -c /root/yum.centos.conf --installroot=/home/images/Baseimage groupinstall
Virtualization
# yum -c /root/yum.centos.conf --installroot==/home/images/Baseimage install
*openssh*
# cp /root/yum.centos.conf /home/images/Baseimage/etc/yum.conf
# /usr/sbin/chroot /home/images/Baseimage /sbin/chkconfig sshd --add
# /usr/sbin/chroot /home/images/Baseimage /sbin/chkconfig --level 12345 sshd on
# /usr/sbin/chroot /home/images/Baseimage /sbin/chkconfig --del kudzu
# chroot /home/images/Baseimage pwconv
# cp -rv /lib/modules/*xen* /home/images/Baseimage/lib/modules/
# mv /home/images/Baseimage/lib/tls /home/images/Baseimage/lib/tls.disabled
# cd /home/images/Baseimage/etc/sysconfig/
# vi network

>>>>> Contents of network file <<<<<<

NETWORKING=yes
HOSTNAME=localhost.localdomain

# vi /home/images/Baseimage/etc/sysconfig/network-scripts/ifcfg-eth0

>>>>> Contents of ifcfg-eth0 file <<<<<<

ONBOOT=yes
DEVICE=eth0

22 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


BOOTPROTO=dhcp

# vi /home/images/Baseimage/etc/resolv.conf

>>>>> Contents of resolv.conf file <<<<<<

search persistent.co.in
nameserver xx.xx.xxx.xxx
nameserver 10.77.224.100

# echo ping -c15 xx.xx.xx.xx >> /home/images/Baseimage/etc/rc.local


# mkinitrd --omit-scsi-modules --with=xennet --with=xenblk --preload=xenblk
/home/images-backup/CentOS/initrd-`uname -r`U.img `uname -r`
# umount /home/images/Baseimage/proc
# umount /home/images/Baseimage

Now we are ready to register kernel image, ramdisk image and disk image.

Kernel image -

# euca-bundle-image -i vmlinuz-2.6.18-194.el5xen --kernel true


# euca-upload-bundle -b centos-kernel-bucket -m /tmp/vmlinuz-2.6.18-
194.el5xen.manifest.xml
# euca-register centos-kernel-bucket/vmlinuz-2.6.18-194.el5xen.manifest.xml

IMAGE eki-9EBB177F

Ramdisk image –

# euca-bundle-image -i initrd-2.6.18-194.el5xenU.img --ramdisk true


# euca-upload-bundle -b centos-ramdisk-bucket -m /tmp/initrd-2.6.18-
194.el5xenU.img.manifest.xml
# euca-register centos-ramdisk-bucket/initrd-2.6.18-194.el5xenU.img.manifest.xml

IMAGE eri-001F18DD

Disk image –

# euca-bundle-image -i centos5.5-base.img --kernel eki-9EBB177F --ramdisk eri-


001F18DD
# euca-upload-bundle -b centos-image-bucket -m /tmp/centos5.5-base.img.manifest.xml
# euca-register centos-image-bucket/centos5.5-base.img.manifest.xml

IMAGE emi-F744159C

23 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Available images on front end server via GUI –

Run the instance –

# euca-run-instances -k my_key -t m1.large --kernel eki-9E8B177F --ramdisk eri-


FF8C18C0 emi-F7B315AF

NOTE: I got below error while running above command

[EUCAFATAL ] error: insufficient disk capacity remaining (9725MB) in VM Type of instance i-


429D07E4 for component root

Solution - You can increase the VM type through the admin web interface ("Configuration" tab). Make
sure that values are ordered and you change one VM type at a time.

24 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# euca-run-instances -k my_key -t m1.xlarge --kernel eki-9EBB177F --ramdisk eri-
001F18DD emi-F744159C

# euca-describe-instances
RESERVATION r-44B2087D admin default
INSTANCE i-2D89056A emi-F7761599 10.88.88.190 10.88.88.190
running my-key 0 m1.xlarge 2010-11-13T13:44:17.482Z
Cluster01 eki-9EAF1784 eri-19C41922

At this point you can also use HybridFox to access the VM launched via Eucalyptus private cloud.

Here you go! You own customized VM is ready to use.

Using KVM as a hypervisor

IMPORTANT – ENABLE THE VIRTUALIZATION SUPPORT FROM BOIS.

Important Note: To use multiple hypervisors with Eucalyptus you will have to separate them into
different availability zones i.e. different subnets/networks with two different CC components
installed on either the NCs or hypervisors. The reason to that is, Eucalyptus does not have the
enough intelligence to send an user request to appropriate hypervisor which will understand the
source image format targeted for a particular hypervisor or at least you will have to make sure the
images you have created will work on or compatible to work on hypervisors like KVM, Xen or
VMware.

Install CentOS 5.5 and have KVM as default hypervisor. We will have to add this server as a new NC with
KVM hypervisor to our Eucalyptus cloud setup.

# yum install --enablerepo=extras kvm kmod-kvm qemu

Creating bridge device –

NOTE: If you have only one NIC card on your KVM host ,don’t assign IP to that NIC and use eth0
to interface with the bridge vnet0 (give static IP to the bridge) now the bridge IP can be used to
Connect over SSH and VNC to the host.

Create a new file as below –

# cat /etc/sysconfig/network-scripts/ifcfg-br0
# Broadcom Corporation NetLink BCM5784M Gigabit Ethernet PCIe
DEVICE=br0
BOOTPROTO=static
BROADCAST=xx.xx.xx.xxx
HWADDR=xx.xx.xx.xx.xx.xx
IPADDR=xx.xx.xx.xx
IPV6INIT=no
NETMASK=xxx.xxx.xxx.x
NETWORK=xx.xx.xx.x

25 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


ONBOOT=yes
GATEWAY=xx.xx.xx.x
TYPE=Bridge
DELAY=0

Your ifcfg-eth0 file should look like as below –

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetLink BCM5784M Gigabit Ethernet PCIe
DEVICE=eth0
BRIDGE=br0
BOOTPROTO=none
HWADDR=xx.xx.xx.xx.xx.xx
ONBOOT=yes
TYPE=Ethernet

Your ifconfig out should look like as below –

# ifconfig | more
br0 Link encap:Ethernet HWaddr xx.xx.xx.xx.xx.xx
inet addr:xx.xx.xx.xx Bcast:xx.xx.xx.xxx Mask:xxx.xxx.xxx.x
inet6 addr: fe80::223:aeff:fe85:ee3e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:61880 errors:0 dropped:0 overruns:0 frame:0
TX packets:1665 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3640272 (3.4 MiB) TX bytes:416773 (407.0 KiB)

eth0 Link encap:Ethernet HWaddr xx.xx.xx.xx.xx.xx


inet6 addr: fe80::223:aeff:fe85:ee3e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62717 errors:0 dropped:0 overruns:0 frame:0
TX packets:1727 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4873288 (4.6 MiB) TX bytes:435520 (425.3 KiB)
Interrupt:169 Memory:dfbf0000-dfc00000
[…]

# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0023ae85ee3e no eth0
virbr0 8000.000000000000 yes

NTP setup –

# yum install -y ntp


# /etc/init.d/ntpd start
# ntpdate xx.xx.xxx.xxx

To install Node controller please follow below sections –

26 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Setup yum repo for Eucalyptus

Install NC

Install CC –

# yum install eucalyptus-cc.$ARCH –nogpgcheck

Start NC

NOTE: Change below part from /etc/eucalyptus/eucalyptus.conf file

# The hypervisor that the Node Controller will interact with in order
# to manage virtual machines. Currently, supported values are 'kvm'
# and 'xen'.
HYPERVISOR="kvm"

# (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="virbr0"

# The 2 variable VNET_PRIVINTERFACE and VNET_PUBINTERFACE specify the


# local physical ethernet interfaces that eucalyptus should use to manage
# the VM network. On the front-end, VNET_PRIVINTERFACE should be set to
# the device that is attached to the same ethernet network as your nodes.
# - VNET_PUBINTERFACE should be set to the device which is connected to
# the 'public' network. If you have only one interface, these should
# be set to the same value. On the nodes, both 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_PUBINTERFACE="br0"
VNET_PRIVINTERFACE="br0"

# The following three KVM-specific options determine whether the


# hypervisor uses Virtio for specific types of I/O with the VM.
# (To use VirtIO, the VM must have the appropriate drivers installed.)

# If "1", use Virtio for EBS (elastic block store) volumes


USE_VIRTIO_DISK="1"

# If "1", use Virtio for the root file system disk


USE_VIRTIO_ROOT="1"

# If "1", use Virtio for the network card


USE_VIRTIO_NET="1"

Registering Eucalyptus Components <<< Refer registering NC & CC part.

Now we will create a new VM so that we will get the .img file, initrd file and kernel file.

Take a VNC access of NC and execute virt-manager

27 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# virt-manager

28 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


29 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5
30 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5
31 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5
32 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5
Once you click on finish button it will create a disk image of 4G

After this it will create a domain and then you will have to follow a regular installation flow.

33 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


Take note of disk layout

Okay, so Fedora 11 has been successfully installed and now next task is to configure the VM for few
security settings shown below –

Check the network related files to verify they are correct and as expected.

Append -

# echo ping -c15 xx.xx.xx.xx >> /etc/rc.local

Copy over – initrd, kernel and image file to front end server from KVM NC.

Note: - Before copying the image file to front end server just make sure the VM is shutdown.

Now we are ready to register kernel image, ramdisk image and disk image.

Register and upload Kernel image –

# euca-bundle-image -i vmlinuz-2.6.29.4-167.fc11.x86_64 --kernel true

34 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


# euca-upload-bundle -b centos-kernel-bucket -m /tmp/vmlinuz-2.6.29.4-
167.fc11.x86_64.manifest.xml
# euca-register centos-kernel-bucket/vmlinuz-2.6.29.4-167.fc11.x86_64.manifest.xml

IMAGE eki-29F2189C

Register and upload ramdisk image –

# euca-bundle-image -i initrd-2.6.29.4-167.fc11.x86_64.img --ramdisk true


# euca-upload-bundle -b centos-ramdisk-bucket -m /tmp/initrd-2.6.29.4-
167.fc11.x86_64.img.manifest.xml
# euca-register centos-ramdisk-bucket/initrd-2.6.29.4-
167.fc11.x86_64.img.manifest.xml

IMAGE eri-8E9819E5

Register and upload disk image –

# euca-bundle-image -i euca1_fedora11.img --kernel eki-29F2189C --ramdisk eri-


8E9819E5
# euca-upload-bundle -b centos-image-bucket -m /tmp/euca1_fedora11.img.manifest.xml
# euca-register centos-image-bucket/euca1_fedora11.img.manifest.xml

IMAGE emi-FB1615B0

Run the instance –

# euca-run-instances -k my_key -t m1.large --kernel eki-29F2189C --ramdisk eri-


8E9819E5 emi-FB1615B0

NOTE: ERROR

I got the below error while launching the instance

[Wed Nov 24 17:21:22 2010][007353][EUCAFATAL ] Failed to connect to qemu:///system


[Wed Nov 24 17:21:22 2010][007353][EUCAFATAL ] could not start instance i-40EA07E8,
abandoning it
[Wed Nov 24 17:21:22 2010][007353][EUCADEBUG ] state change for instance i-40EA07E8:
Staging -> Shutoff (Extant)
[Wed Nov 24 17:21:26 2010][007353][EUCAFATAL ] Failed to connect to qemu:///system
[Wed Nov 24 17:21:26 2010][007353][EUCAINFO ] cleaning up state for instance i-
40EA07E8
[Wed Nov 24 17:21:26 2010][007353][EUCAINFO ] vrun(): [rm -rf
/home/VM_Deploy//admin/i-40EA07E8/]
[Wed Nov 24 17:21:26 2010][007353][EUCAINFO ] stopping the network (vlan=-1)
[Wed Nov 24 17:21:26 2010][007353][EUCADEBUG ] state change for instance i-40EA07E8:
Shutoff -> Teardown (Teardown)

Here is a solution – REF –


http://open.eucalyptus.com/forum/instance-shuts-down-immediately-after-running

There's no such group (libvirtd) present in Centos 5.5 after installing the libvirtd daemon. I've added it
artificially (groupadd):

35 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5


kvm:x:36:eucalyptus
libvirt:x:501:eucalyptus

Adjusted permissions on the sockets this way:

# ls -alh /var/run/libvirt
total 40K
drwxr-xr-x 4 root root 4.0K Aug 13 17:25 .
drwxr-xr-x 23 root root 4.0K Aug 13 17:25 ..
srwxrwx--- 1 root libvirt 0 Aug 13 17:25 libvirt-sock
srwxrwxrwx 1 root libvirt 0 Aug 13 17:25 libvirt-sock-ro
drwxr-xr-x 2 root root 4.0K Aug 11 00:06 network
drwxr-xr-x 2 root root 4.0K Aug 11 00:06 qemu

Adding eucalyptus to libvirt as you suggest, and adjusting /etc/libvirt/libvirtd.conf this way:

# Set the UNIX domain socket group ownership. This can be used to
# allow a 'trusted' set of users access to management capabilities
# without becoming root.
#
# This is restricted to 'root' by default.
unix_sock_group = "libvirt"
# If not using PolicyKit and setting group ownership for access
# control then you may want to relax this to:
unix_sock_rw_perms = "0770"

Which, after restarting euca services, it worked!

I had to put a symlinks in place too, according to nc.log error messages (I find it incredible that CentOS
kvm package does not put this in place correctly):

# ln -sf /usr/libexec/qemu-kvm /usr/bin/kvm

After this fix you will see the node is provisioned and ready for use.

There is lot more to explore and will be working on it however this document is enough to at least getting
started with experiment! Hope this helps.

36 Installing & Configuring Eucalyptus 2.0.0 on CentOS 5.5

You might also like