Eucalyptus: Euca2ools
In this series of posts on “Building an on-premise private cloud” we have so far:
- Installed Eucalyptus, an Infrastructure-as-a-Service offering, and
- Configured Eucalyptus to start VMs with IP addresses from a private VLAN
Before we jump into bundling, uploading, and registering images, let’s first download and install Euca2ools.
Euca2ools are command-line utilities to help:
- Manage Images (bundle, upload, register, delete, etc.)
- Manage Instances (start, reboot, terminate, list, etc.)
- Manage Volumes & Snapshots (attach, detach, list, create, delete, etc.)
- Manage IP addresses (associate, disassociate, list, etc.)
- Manage SSH key pairs (add, delete, list)
- Manage Security groups (add, delete, list, add rules)
- Query availability zones (clusters)
Euca2ools is compatible with Amazon EC2 and S3 web services. In fact, Euca2ools is modeled after Amazon EC2 API and EC2 AMI tools.
Since I have been using CentOS 5 32-bit, I’ll describe the tar ball install process for CentOS 5. Also, in my case I’ll install euca2ools on my front-end machine (192.168.0.114)
Note: You may choose to go the yum (you will need to add the http://www.eucalyptussoftware.com/downloads/repo/euca2ools/$VERSION/yum/centos/ repo first) route instead of the tar ball.
Note: If you are using a Debian-based distro, feel free to install using apt-get (apt-get install euca2ools)
First download the tar.gz package for CentOS 5 32-bit – in this case, euca2ools-1.2-centos-i386.tar.gz
Next un-tar the above package
tar zxvf euca2ools-1.2-centos-i386.tar.gz
Before you install the rpm packages in the euca2ools-1.2-centos-i386 directory, you need to install swig as follows:
yum update yum install swig
Next, go into euca2ools-1.2-centos-i386 directory and install the rpm packages as follows:
cd euca2ools-1.2-centos-i386 rpm -Uvh python25-2.5.1-bashton1.i386.rpm python25-libs-2.5.1-bashton1.i386.rpm euca2ools-1.2-1.i386.rpm
Confirm that euca2ools is install as follows:
rpm -qa euca2ools
In the first post I used Amazon EC2 API tools to test the Eucalyptus install. To be precise I had used the ec2-describe-availability-zones command.
Now that we have Euca2ools installed we can use the euca-describe-availability-zones command instead. Remember to source in the eucarc file first.
cd .euca source eucarc euca-describe-availability-zones verbose
AVAILABILITYZONE |- vm types free / max cpu ram disk
AVAILABILITYZONE |- m1.small 0004 / 0004 1 128 2
AVAILABILITYZONE |- c1.medium 0004 / 0004 1 256 5
AVAILABILITYZONE |- m1.large 0002 / 0002 2 512 10
AVAILABILITYZONE |- m1.xlarge 0000 / 0000 2 1024 20
AVAILABILITYZONE |- c1.xlarge 0000 / 0000 4 2048 20
Nice!
Feel free to play around with some of the other commands. You can get a list of commands by typing “euca” and pressing the TAB button twice. You could also run the command ls /usr/bin | grep euca
euca_conf
euca-delete-volume
euca-describe-keypairs
euca_killall
euca-run-instances
euca-add-keypair
euca-confirm-product-instance
euca-deregister
euca-describe-regions
eucalyptus-cloud
euca_sync_key
euca-allocate-address
euca-create-snapshot
euca-describe-addresses
euca-describe-snapshots
euca-modify-image-attribute
euca-terminate-instances
euca-associate-address
euca-create-volume
euca-describe-availability-zones
euca-describe-volumes
euca-reboot-instances
euca-unbundle
euca-attach-volume
euca-delete-bundle
euca-describe-groups
euca-detach-volume
euca-register
euca-upload-bundle
euca-authorize
euca-delete-group
euca-describe-image-attribute
euca-disassociate-address
euca-release-address
euca-version
euca-bundle-image
euca-delete-keypair
euca-describe-images
euca-download-bundle
euca-reset-image-attribute
euca-bundle-vol
euca-delete-snapshot
euca-describe-instances
euca-get-console-output
euca-revoke
To get more information on a particular command, type in the command name following by the argument –help. For instance:
euca-describe-availability-zones --help
Shows information about availability zones.
euca-describe-availability-zones [--region region] [-h, --help] [--version] [--debug] [zone1 zone2...zoneN]
OPTIONAL PARAMETERS
–region region to describe availability zones for
zone1 zone2…zoneN zones to describe.
-a, –access-key User’s Access Key ID.
-s, –secret-key User’s Secret Key.
-U, –url URL of the Cloud to connect to.
–config Read credentials and cloud settings from the
specified config file (defaults to $HOME/.eucarc or /etc/euca2ools/eucarc).
-h, –help Display this help message.
–version Display the version of this tool.
–debug Turn on debugging.
Euca2ools will use the environment variables EC2_URL, EC2_ACCESS_KEY, EC2_SECRET_KEY, EC2_CERT, EC2_PRIVATE_KEY, S3_URL, EUCALYPTUS_CERT by default.
As we continue these series, we will see more and more of the Euca2ools commands.

Hi,
I am facing some issues with installation of Eucalytus from the Source.
Is it required or mandatory to use Open JDK?
I have installed Eucalyptus with Sun Java and
“java -version” shows,
java version “1.6.0_20″
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
and uname -a shows,
Linux cloudcdac 2.6.26-2-xen-686 #1 SMP Sat Dec 26 11:29:49 UTC 2009 i686 GNU/Linux
I am using BOSS Linux(A Debian derived linux) and
the distro is lenny.
Also from ,
netstat -an | grep 8443
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN
netstat -an | grep 9001,
tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN
i found both ports are opened and in LISTEN state.
I was installing eucalyptus from source(version – eucalyptus-1.6.2-sr c) by referring the link,
http://open.eucalyptus.com/wiki/installing-eucalyptus-source-16
I was able to continue the installation .
Then i Configured for that in SYSTEM_MODE(networking).
In the file /opt/eucalyptus/etc/eucalyptus/eucalyptus.conf,
I made the following changes ,
VNET_PUBINTERFACE=”eth0″
VNET_PRIVINTERFACE=”eth0″
VNET_MODE=”SYSTEM”
VNET_BRIDGE=”eth0″
Later I started eucalyptus by using,
# enable services on the front-end
$EUCALYPTUS/usr/sbin/euca_conf –enable cloud –enable walrus –enable sc
# start enabled front-end services
$EUCALYPTUS/etc/init.d/eucalyptus-cloud start
# start the cluster controller
$EUCALYPTUS/etc/init.d/eucalyptus-cc start
$EUCALYPTUS/etc/init.d/eucalyptus-nc start
Then I follwed the following link.
http://open.eucalyptus.com/wiki/first-time-setup-16
When I put,
$EUCALYPTUS/usr/sbin/euca_conf –register-walrus 192.168.31.40
(My LAN IP),
I am getting ,
ERROR: you need to be on the CLC host and the CLC needs to be running.
When I checked cloud-error.log, I was able to see,
“14:53:24 [StorageProperties:main] ERROR com.eucalyptus.config.NoSuchComponentException: StorageControllerConfiguration named StorageController3698e36f-3232-4a57-9697-dd07d41ee30e
17:37:33 [ShutdownHook:Shutdown Hook] ERROR Problem calling “get cause” on IllegalStateException.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.logicalcobwebs.proxool.ShutdownHook.remove(ShutdownHook.java:40)
at org.logicalcobwebs.proxool.ProxoolFacade.shutdown(ProxoolFacade.java:238)
at org.logicalcobwebs.proxool.ProxoolFacade.shutdown(ProxoolFacade.java:220)
at org.logicalcobwebs.proxool.ShutdownHook.run(ShutdownHook.java:99)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.remove(ApplicationShutdownHooks.java:55)
at java.lang.Runtime.removeShutdownHook(Runtime.java:220)
… 9 more”
actaully What went wrong here…
Can any one help me to resolve this issue???
Thanks,
Sri
Also I am not able to get the Web GUI in my System.
I was not able to see the WEBUI.
When I enter the URL as,
https://localhost:8443,
I got,
HTTP ERROR: 503
Problem accessing /. Reason:
SERVICE_UNAVAILABLE
Can any one help….
Is it required or mandatory to use Open JDK?
No. You can use Sun JDK. You might need to set JAVA_HOME env variable though. And append $JAVA_HOME/bin to the PATH env variable.
Questions:
Are you running Eucalyptus on more than one node? i.e. is you node controller running on different machines than your cluster controller (CC) / cloud contoller (CLC)?
Did you register
Could you check to make sure CLC is started and running? You could do a quick check by running “ps auxww | grep eucalyptus-cloud” command on the the machine you installed the CLC. Pls post the output
Could you please run “netstat -tan | grep LISTEN”? Pls post the output. You should have ports 8443, 8773, 8774, 9001 listening
Ignore the “java.lang.IllegalStateException” error for now.
As for the “com.eucalyptus.config.NoSuchComponentException: StorageControllerConfiguration” eror, I cannot say for sure what is wrong by just looking at the one line log message.
Could you check the cloud-output.log and search for the “StorageContollerConfiguration” line. It should appear during startup.
For example. in my cloud-output log, I see the following:
<snippet>
…
…
| Entities for config
| ——————————————————————————–
13:59:33 INFO LogUtil | ?:? class edu.ucsb.eucalyptus.cloud.entities.Counters
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.entities.AbstractPersistent
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.entities.UserMetadata
13:59:33 INFO LogUtil | ?:? class edu.ucsb.eucalyptus.cloud.entities.LVMMetaInfo
13:59:33 INFO LogUtil | ?:? class edu.ucsb.eucalyptus.cloud.entities.LVMVolumeInfo
13:59:33 INFO LogUtil | ?:? class edu.ucsb.eucalyptus.cloud.state.AbstractIsomorph
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.config.ClusterConfiguration
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.config.ComponentConfiguration
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.config.StorageControllerConfiguration
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.config.System
13:59:33 INFO LogUtil | ?:? class com.eucalyptus.config.WalrusConfiguration
…
…
</snippet>
Perhaps you could stop eucalyptus-cc, eucalyptus-cloud, eucalyptus-nc and then start these in the following order:
/etc/init.d/eucalyptus-cc cleanstart
/etc/inid.d/eucalyptus-cloud start
/etc/init.d/eucalyptus-nc start
Tail out the logs cloud-output.log, cloud-error.log, nc.log to keep an eye out for error messages during stop and start.
You could also follow the binary install instructions laid out at: http://blogs.plexibus.com/2010/05/19/eucalyptus-setting-up-a-private-infrastructure-cloud
Seems like your CLC did not start up correctly. And make sure you have started CLC, CC and NC as root user
when i write this command:
euca-describe-availability-zones verbose
I got this error:
Traceback (most recent call last):
File “/usr/local/bin/euca-describe-availability-zones”, line 36, in ?
from euca2ools import Euca2ool, Util
File “/usr/lib/python2.4/site-packages/euca2ools/__init__.py”, line 1036
finally:
^
SyntaxError: invalid syntax
but i have installed euac2ools properly and have correct output of last command but this is new to me. can someone help to correct this error?
Khurram,
What do you mean by “have correct output of last command”? Does this mean the other euca-* commands run fine?
Thanks,
Rosh
Hi,
I plan to configure eucalyptus 1.6 in CenhtOS 5. What are all the files i’ve to check before proceeding?
Hi,
I am using eucalyptus 2.0.2 in Managed No-VLAN Mode.
euca-describe-address (as admin) is describing
the address with the status.
running
euca-allocate-address command gives a public IP address.
After this if I again run euca-describe-address (as admin).
its displaying the address alloted in the previous step as available.
How to deallocate address in eucalyptus?
can any one help me
Thanks,
Sri.
Sri,
You can try
euca-release-addresscommand