CSS Corp Open Source Services

UEC: CC and NC on a single machine

with 5 comments

Working on Ubuntu Enterprise Cloud, I  was wondering if both CC and NC could run on a single machine. Ofcourse, this is not a recommended UEC topology for production use, but thought of giving it a try. Moreover, for experimenting purposes this would be an ideal case, not requiring too many hardware resources. So here goes the process….

Eucalyptus Packages
The eucalyptus packages that form the core part of UEC are:

  • eucalyptus-cloud – Elastic Utility Computing Architecture – Cloud controller
  • eucalyptus-cc – Elastic Utility Computing Architecture – Cluster controller
  • eucalyptus-walrus – Elastic Utility Computing Architecture – Walrus (S3)
  • eucalyptus-sc – Elastic Utility Computing Architecture – Storage controller
  • eucalyptus-nc – Elastic Utility Computing Architecture – Node controller

Cluster Controller Installation
1. Install UEC using Ubuntu Server 9.10 CD.
2. During installation, select Cluster installation. NC installation can be done after this.
3. Select the same “eth0” interface as public and private interface.
4. Specify some arbitrary IP address range for Public IPs (say This can later be changed in /etc/eucalyptus/eucalyptus.conf.

As I selected to install Ubuntu Enterprise Cloud. So eucalyptus-cloud, eucalyptus-cc, eucalyptus-walrus, eucalyptus-sc packages will be automatically installed. If Install Ubuntu Server is selected, these packages need to be installed after installing Ubuntu Server using apt-get.

$ sudo apt-get install eucalyptus-cloud eucalyptus-cc eucalyptus-walrus eucalyptus-sc

1. Install system updates.

 $ sudo apt-get update
 $ sudo apt-get dist-upgrade

2. For convinence, I installed vim (vim looks more comfortable than vi… :)).

 $ sudo apt-get install vim

Network Configuration
NC expects a bridge, so created a bridge and added eth0 as an interface. Configured the bridge for a static IP.

auto eth0
 iface eth0 inet manual
auto br0
 iface br0 inet static
 address A.B.C.D
 network A.B.C.0
 broadcast A.B.C.255
 gateway A.B.C.1
 dns-nameservers W.X.Y.Z
 dns-search mydomain.com
 bridge_ports eth0
 bridge_fd 9
 bridge_hello 2
 bridge_maxage 12
 bridge_stp off

Node Controller Installation
1. Install Node Controller

$ sudo apt-get install eucalyptus-nc

UEC Web Console
The CC can be accessed via a web console with the IP https://A.B.C.D:8443. Using the web console, you would be able to:

  • download the account credentials
  • view currently installed images
  • make available or disable the installed images
  • browse through the store and install available images
  • add/edit/delete/enable/disable users
  • change the CC configuration
  • access external links of Ubuntu and Eucalyptus community
  • register the cloud with Landscape or RightScale

Retreiving Credentials
After installing CC and NC, users of the cloud will need to retrieve their credentials. This can be done either from a web browser or from command line.
I used command line and executed the following commands:

$ mkdir -p ~/.euca
$ chmod 700 ~/.euca
$ cd ~/.euca
$ sudo euca_conf --get-credentials mycreds.zip
$ unzip mycreds.zip
$ cd -

Using Your Credentials
After obtaining the credentials, we need to setup EC2 API and AMI tools on the server using X.509 certificates. For this, source the included “eucarc” file to set up the Eucalyptus environment

$ . ~/.euca/eucarc

This can be added to the ~/.bashrc file, so that the Eucalyptus environment is set up automatically when you log in.

$ echo "[ -r ~/.euca/eucarc ] && . ~/.euca/eucarc" >> ~/.bashrc

Node Registration
Execute following command to register the node:

$ sudo euca_conf --no-rsync --discover-nodes

The above command will prompt for adding the discovered nodes

New node found on A.B.C.D; add it? [Yn]

Since I was interested on running both CC and NC on a single machine, I added only that machine as the node and ignored other nodes present in my network.

Now euca-describe-availability-zones cleanly reports the node registration

$ euca-describe-availability-zones verbose
AVAILABILITYZONE        uec-cloud       A.B.C.D
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

Install store image
I installed the Ubuntu 9.10 – Karmic Koala (i386) image available from the store. After installing from the store euca-describe-images shows the image details.

$ euca-describe-images
IMAGE   eri-0D4D117E    image-store-1268999725/ramdisk.manifest.xml     adminavailable       public  x86_64  ramdisk
IMAGE   eki-F8BF1114    image-store-1268999725/kernel.manifest.xml      adminavailable       public  x86_64  kernel
IMAGE   emi-E2861098    image-store-1268999725/image.manifest.xml       adminavailable       public  x86_64  machine

Test… Test… Test
Before running an instance of this image, we should first create a keypair that can be used to log into the instance. Create a SSH keypair using the command:

if [ ! -e ~/.euca/mykey.priv ]; then
    touch ~/.euca/mykey.priv
    chmod 0600 ~/.euca/mykey.priv
    euca-add-keypair mykey > ~/.euca/mykey.priv

The default security group should be configured to allow SSH access (port 22). I also plan to run Windows VM for which I have allowed access to RDP.

$ euca-describe-groups
$ euca-authorize default -P tcp -p 22 -s
$ euca-authorize default -P tcp -p 3389 -s
$ euca-describe-groups
GROUP   admin   default default group
PERMISSION      admin   default ALLOWS  tcp     3389    3389    FROM    CIDR0.0.0.0/0
PERMISSION      admin   default ALLOWS  tcp     22      22      FROM    CIDR0.0.0.0/0

So all set to launch the instance…

From euca-describe-images, get the EMI ID.

$ euca-describe-images
IMAGE   eri-0D4D117E    image-store-1268999725/ramdisk.manifest.xml     adminavailable       public  x86_64  ramdisk
IMAGE   eki-F8BF1114    image-store-1268999725/kernel.manifest.xml      adminavailable       public  x86_64  kernel
IMAGE   emi-E2861098    image-store-1268999725/image.manifest.xml       adminavailable       public  x86_64  machine

Now launch the instance….

$ euca-run-instances emi-E2861098 -k mykey

Alternatively you can launch the instance using Hybridfox.I haven’t tested using ElasticFox.

My eucalyptus.conf


# network configuration from the input configuration file

I was able to get both SYSTEM and MANAGED_NOVLAN modes. Remember to do a cleanstop and cleanstart of eucalyptus services between changing network modes.

$ sudo service eucalyptus stop CLEAN=1
$ sudo service eucalyptus-nc stop CLEAN=1
$ sudo service eucalyptus start CLEAN=1
$ sudo service eucalyptus-nc start CLEAN=1

Issues: One notable issue that I faced was, some how the directory /var/lib/eucalyptus/instances was having root:root ownership, due to which was preventing the instance from coming up.  Changing the ownership of /var/lib/eucalyptus/instances to eucalyptus:eucalyptus fixed the issue. I need to probe this further to see if this is always the case.

Written by kiranmurari

March 19, 2010 at 12:02 pm

5 Responses

Subscribe to comments with RSS.

  1. I am considering running UEC on a single machine, but it will run as a virtual machine using Oracle VM VirtualBox on a Windows Server 2008 R2 platform. Have you ever seen UEC-CC and/or UEC-CC-NC run as a virtual machine?, a virtual machine using Oracle VM VirtualBox?, and/or virtualized on a Windows Server 2008 R2 Platform.




    December 12, 2010 at 1:42 am

    • Hi Evan,

      In order to run instances on NC, you need a VT enabled machines with kvm installed. Having said that, if you run the NC as a virtual machine, you are creating an additional layer of vitualization and hence KVM may not work properly. CC/CLC/WS3/SC can run as a VM under VirtualBox provided that the VM should have allocated good resources on memory, disk space. But again the amount disk space required for WS3/SC depends on how many images you want to store to WS3 and how much disk space you want to allocate to each instance as an EBS volume.

      Is this Win 2008 machine VT enabled? If yes then you can wipe out the Windows Server (if you intend to use this machine only for UEC), install Ubuntu server, install VirtualBox, run a Ubuntu VM for CC/WS3/CLC/SC. On the host machine, you can install NC and proceed further. But again single machine setup does have some constraints. Refer http://open.eucalyptus.com/wiki/FAQ#MinConfig

      Hope that helps.



      December 13, 2010 at 2:47 pm

      • Hi Kiranmurari,

        So after installing CC/WS3/CLC/SC on the VM, you go out of the VM and install NC on the host machine not on the VM in the host machine right?

        Am trying to work out my research using a single macbook with VM running on it.

        Thank you



        August 22, 2011 at 10:48 pm

  2. Hi there,

    I am a student at a University in New Zealand, and want to implement Cloud Network in the lab. I have read your book and it explained a lot. But i have a question, that can we provide Operating System as a Service to clients and how? I mean i would install UEC and install the image of Windows XP on it, so if i have 2 other pc’s which need the service, can i load operating system from cloud on those pc’s. Any help would be much appreciated.



    August 18, 2011 at 5:31 am

  3. hey kiranmurari,
    I really liked this content and I thinnk its going to be very useful for ME in MY project.
    I am trying to simulate cloud environment. I was wondering that people say that we should use 2 dedicated systems atleast. However can we use one system with 2 instance of Virtual Machine. 1 with walrus, SC, CC and cluster
    and the 2nd VMwith NC
    will it possible ?? If so wat r thing to be kept in MY mind.
    I need some expert suggestions and opinions.

    MAYANK Singh Rana

    January 23, 2013 at 12:51 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: