Friday, July 19, 2013

Happy Birthday OpenStack!!!

OpenStack celebrates it’s third birthday today! 

I would like to wish a Very Happy Birthday to OpenStack! :)

Happy 3rd Birthday, OpenStack!
Happy 3rd Birthday, OpenStack!

Visit the OpenStack birthday page for more information!

Friday, June 21, 2013

Apache Stratos - The Open Source PaaS Framework

Recently, WSO2 proposed the "Apache Stratos" as an incubating project at the Apache Software Foundation. The vote for Stratos proposal started about a week ago.

We are really excited to hear the news that voting has passed less than 20 hours ago and Apache Stratos project is now officially in the incubator.

Apache Stratos will be a polyglot PaaS framework and it will be possible to run on any IaaS supported by jclouds. Interestingly, the jclouds is also currently an Apache incubating project.

The proposed Apache Stratos committer list includes developers from WSO2, Cisco, SUSE, Citrix, NASA Jet Propulsion Lab (JPL), Sungard and Engine Yard. I'm really happy that I'm also in the initial committer list!! :)

We recently released the Stratos Foundation 2.0 GA, which will be the last release of "Stratos" from WSO2.

The Stratos 2.0 GA release is also featured in many technology web sites such as InfoQ, JAXenter, BusinessWireKavis Technology etc.

Following diagram shows the Apache Stratos Architecture and you can find more details at WSO2 Wiki docs for now.

Everyone is welcome to join the Apache Stratos community and help to make it The Best 100% Open Source PaaS framework! :)

Tuesday, June 18, 2013

WSO2 Stratos 2.0 Foundation is Released!

We are happy to announce that WSO2 Stratos 2.0 Foundation General Availability (GA) is released!!!

Nothing much changed from the RC2 release. Please refer my previous post for more details about Stratos 2.0 and here is link to release note mail!

We updated our Amazon EC2 images with Stratos 2.0 GA release and you can find more details in our Quick Start Guide wiki page.

Visit our Stratos wiki page for more information:

Sunday, June 9, 2013

WSO2 Stratos 2.0 Foundation - RC2 Released!

Today we released WSO2 Stratos 2.0 Foundation Release Candidate 2, which will be the final release candidate of the upcoming Stratos 2.0 GA.

WSO2 Stratos 2.0 is the next major version of WSO2 Stratos 1.x, the most complete, enterprise-grade, open PaaS, with support for more core services than any other available PaaS today.

This release also comes with a very easy to configure demo setup that can be run on Amazon EC2 and you can find more details in our Quick Start Guide wiki page.

Following are the Key features available in Stratos 2.0.

Key Features
  • Artifact Distribution Coordinator (ADC) with support for external Git and GitHub repositories.
  • Plug-able architecture support for adding new cartridges
  • Support for PHP, Tomcat and MySQL and WSO2 Carbon cartridges (AS, ESB, BPS etc.)
  • Support for puppet based cartridge creation for WSO2 Carbon cartridges
  • Elastic Load Balancer (ELB) with Cartridge support
  • Multiple IaaS support (EC2, Openstack, vCloud) through JClouds APIs
  • Policy based Auto-scaling
  • S2 Cloud Controller
  • Git based deployment synchronizer
  • Interactive CLI Tool for tenants to manage Cartridge subscriptions
  • UI for tenants to manage subscriptions
  • Custom domain mapping support
  • Demo purpose internal GIT repository support
  • Usage metering and Billing.
  • Wiki Documentation (User Guide, Architecture Guide) 
  • Demo Ready Public Amazon EC2 Stratos 2.0 setup

Improved version of Stratos 2.0 Command Line Interface (CLI) Tool is available with release. We completely redesigned & implemented the CLI Tool using jline2 for our Stratos 2.0 Beta 3 release.

With jline2, we were able to support following features in Stratos2 CLI Tool

  • Command history
  • Auto-completion of commands
  • Character masking (for passwords)

Here is a link to Release Note mail.

Please try out Stratos 2.0 and report any issues to our issue tracker

Also visit our Stratos wiki page for more information:

Saturday, May 4, 2013

Installing NS-2 on Ubuntu

In this year I started following the Master of Computer Science (MCS) at University of Colombo School of Computing and these days I'm following a module named "Advanced Concepts in Data Communication Networks"

The lecturer asked us to install a program called NS-2 and to play around with it as we will get an assignment on it soon!

As usual when I hear a new name, I just googled for it and found the official website:

What is NS-2?

NS-2 is a Network Simulator. According to Wikipedia, NS-2 is a "discrete event network simulator" and the latest available version as of now is NS-3, which is available at

The difference between NS-2 and NS-3

The FAQ at clearly mentions the difference between NS-2 and NS-3. NS-3 is a new software development effort and uses C++ programs or python scripts to define simulations. However NS-2 uses OTcl for scripts. 

So the most important thing here is that NS-2 scripts will not run within NS-3.

Installing NS-2 - The Hard Way!

The installation instructions at the website is to download the source and build it. So, I downloaded the latest available ns-allinone version, i.e. ns-2.35, which was released on Nov 4, 2011.

From my experience, it's always better to install software on a Virtual Machine and try. You never know when your machine will crash, especially when doing unknown things such as building from source, which requires to install many development libraries.

I use an excellent virtualization software called VirtualBox. I created a Virtual Machine and installed Ubuntu 13.04 on it.

After installing Ubuntu 13.04, I upgraded existing software packages after updating the package list index.

sudo su
apt-get update && apt-get -y upgrade

Then I extracted the downloaded pack.

tar -xvf ns-allinone-2.35.tar.gz

Then I changed in to the directory, executed install script.

cd ns-allinone-2.35/

The installation script was not successful at the first attempt. It failed many times.

Then I found out some additional packages are also needed to install NS-2 successfully.

Following is the command to install all those packages at once.

sudo apt-get install libx11-dev build-essential autoconf automake xorg-dev g++ libxmu-dev libperl4-corelibs-perl

The last package "libperl4-corelibs-perl" was not needed during installation, however some tests were failing without it.

I also got following error during the installation.

linkstate/ls.h: In instantiation of ‘void LsMap<Key, T>::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/   required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map<int, LsIdSeq, std::less<int>, std::allocator<std::pair<const int, LsIdSeq> > >’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
See for problems

To fix above error, I edited linkstate/ls.h file as instructed.

I changed the line 137
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

Now you should be able to install NS-2 successfully by running "./install" command.

Following is the output I got at the end of installation.

Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.5.10: /home/isuru/ns-allinone-2.35/{bin,include,lib}
tk8.5.10:  /home/isuru/ns-allinone-2.35/{bin,include,lib}
otcl:  /home/isuru/ns-allinone-2.35/otcl-1.14
tclcl:  /home/isuru/ns-allinone-2.35/tclcl-1.20
ns:  /home/isuru/ns-allinone-2.35/ns-2.35/ns
nam: /home/isuru/ns-allinone-2.35/nam-1.15/nam
xgraph: /home/isuru/ns-allinone-2.35/xgraph-12.2
gt-itm:   /home/isuru/ns-allinone-2.35/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns


Please put /home/isuru/ns-allinone-2.35/bin:/home/isuru/ns-allinone-2.35/tcl8.5.10/unix:/home/isuru/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.


(1) You MUST put /home/isuru/ns-allinone-2.35/otcl-1.14, /home/isuru/ns-allinone-2.35/lib, 
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries 
    If you are using csh, you can set it like:
  setenv LD_LIBRARY_PATH <paths>
    If you are using sh, you can set it like:
  export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/isuru/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with
cd ns-2.35; ./validate

For trouble shooting, please first read ns problems page Also search the ns mailing list archive
for related posts.

NS-2 Successful Installation

As instructed, I also executed validate script inside ns-2.35 directory. All tests were passed! :)

All tests were passed

Now you need to export paths to environment. For that, just add following to your ~/.bashrc file.




Now you can start a new terminal or run "source ~/.bashrc" to start using NS-2!

Installing NS-2 - The Easy Way!

Apparently the NS-2 is also available on Ubuntu Software Center! I got to know that only after installing the NS-2 in the hard way! :)

There is just one command to install!

sudo apt-get install ns2 nam xgraph

Testing NS-2 Installation

After installing you should be able to run commands "ns" & "nam".

The "ns" command will go in to a prompt with "%".

You can type "exit"! :)

I'm hoping to write another blog post on using NS-2 soon. May be after I get the assignment! :)

Friday, May 3, 2013

OpenStack Single-Node Installation with DevStack

In my previous post, I explained how to install OpenStack in Multi-Node environment with DevStack.

If you want to install the OpenStack in a Single Machine, you can follow the same steps for the Controller Node Installation in my previous post.

You can omit the "MULTI_HOST=1" line from the localrc.

For example, following is a "localrc" configuration used to install OpenStack in a single machine.


Friday, April 26, 2013

Installing Multi-Node OpenStack Folsom with DevStack

These days we are preparing to release WSO2 Stratos 2.0 PaaS Foundation and we needed to install OpenStack in multiple nodes in our lab environment.

In this guide I'm going to explain how to install OpenStack Folsom using the DevStack script [1] and also how to install additional Compute Nodes.

Installing OpenStack was not an easy task. I spent last 5 days to install and configure the OpenStack and tried various guides.

Earlier we used Damitha's guide to Install OpenStack Essex on a single node [2]. Then we followed different guides. Finally we decided to try the DevStack script, which is a great option to install and run an OpenStack cloud in a local development environment.

Using Nova Network

This guide uses the Nova Network instead of the Quantum Network plugin. I followed a really good guide [3] at, which also use the Nova Network. Quantum Network Plugin is bit complicated and we need two physical network interfaces. I'm planning to install OpenStack with Quantum Plugin soon.

For the Nova Network, one physical network interface is enough.

Why another guide?

Following the exact steps in many guides didn't help me to complete the OpenStack installation successfully. Even the Muti-Node lab guide [4] from DevStack failed. When we run DevStack script according to that guide,  the compute node installation was failing and I figured out one important configuration of setting "SERVICE_HOST" was missing.

Out of all the guides, guide [3] was the best I found for installing OpenStack Folsom with Nova Network. However I couldn't get the OpenStack running successfully.

I think the reason might be that when we clone the DevStack GIT repository, we get the master branch. I tried to use Folsom branch as instructed in DevStack FAQ [5], but that attempt also failed.

Then I found that DevStack GitHub also maintain different branches for OpenStack releases. What I did was to clone the stable Folsom branch and everything worked perfectly!

Setting up the environment

For the multi-node setup, we had two desktop PCs. One for installing OpenStack Controller Node and the other one is for installing OpenStack Compute Node

Step 1: Installing Ubuntu Server

I installed Ubuntu Server 12.04.2 LTS (Precise Pangolin). After installation, we need to comment out existing eth0 configuration and use a static address for eth0 network interface. For that we need to edit /etc/network/interfaces file.

sudo vi /etc/network/interfaces

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static

Then upgrade of existing software packages after updating the package list index.

sudo su
apt-get update && apt-get -y upgrade

Step 2: Add "stack" user for DevStack as root user

sudo su

groupadd stack
useradd -g stack -s /bin/bash -d /opt/stack -m stack

echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

Step 3: Clone DevStack stable/folsom branch as stack user

This is the most important step for me!

sudo su stack

sudo apt-get install -y git
git clone git:// -b stable/folsom

cd devstack

Step 4: Installing OpenStack Controller Node

To install Controller node, we need to create a localrc inside devstack directory (/opt/stack/devstack), which is inside the home directory of stack user. 

Following is the content of localrc file I used.



Note that I have used an IP address range accessible from the network for  "FLOATING_RANGE". We can use any private network for "FIXED_RANGE". Subnet Calculator [6] can be a useful tool for deciding on which network ranges to use.

After creating the localrc file, just run the


Make sure completed successfully. Following is the output I get at last. completed in 3168 seconds.

Horizon is now available at
Keystone is serving at
Examples on using novaclient command line is in
The default users are: admin and demo
The password: labstack
This is your host ip:

Step 5: Installing OpenStack Compute Node

We are installing Compute Node in a different desktop PC and therefore we need to make sure Steps 1 to 3 are followed.

For compute node, we need to create following localrc inside devstack directory (/opt/stack/devstack).





Please note that the "SERVICE_HOST" points the Controller Node IP.

Now run


The should complete successfully.

Note: You can repeat this step to install any number of Compute Nodes.

Step 6: Testing the OpenStack Folsom Setup.

Now you can access the OpenStack Dashboard hosted at Controller Node.

Just open the browser and enter the IP of the Controller Node in address bar. The Login details were displays at the end of script for Controller Node.

OpenStack Commands:

There are also various commands to get more information and change configuration. Before running any command we need to run following command from devstack directory.

source openrc <user-name> <tenant-name>

For example:

source openrc demo demo

List services:
nova-manage service list

List images:
glance image-list

Disable nova compute service in controller:
nova-manage service disable --host=s2controller --service=nova-compute

Restarting OpenStack after a reboot

If for some reason you want to reboot the server, then you can start OpenStack again by running the script.

You might get an error like following when you run ./ 

Attaching to already started screen session..
Cannot open your terminal '/dev/pts/0' - please check.

To avoid that you can use either one of following options:

  • Run script /dev/null to own the shell [7]

script /dev/null

  • Change permissions for terminal [8]

sudo chmod o+rw /dev/pts/0

Now you should be able run

To exit from screen, press Ctrl-a d or Ctrl-a Ctrl-d [9]

That's it! Now you have an OpenStack cloud environment in your own lab environment! has also published another great guide to install OpenStack Grizzly [10]. I'm eagerly waiting to try that also with Quantum Network plugin!



Saturday, February 16, 2013

Oracle VM VirtualBox on Linux - Failed to access the USB subsystem

As you may know already, Oracle VM VirtualBox is a powerful x86 and AMD64/Intel64 virtualization software.

I installed it on my laptop, which runs on Linux Mint 14.

Whenever I go to VM settings, I get a warning saying "Failed to access the USB subsystem". The warning also provides the solution!

"VirtualBox is not currently allowed to access USB devices. You can change this by adding your user to the 'vboxusers' group. Please see the user manual for a more detailed explanation."

The vboxusers group is created during the VirtualBox installation.

Now you can use following command to add your username to vboxusers group.

$ sudo usermod -a -G vboxusers username

Please remember to log out and log back in again.

You can see whether you are in vboxusers using following command.

$ cat /etc/group | grep vboxusers

That's it!

No more warning message and you can use USB devices with VirtualBox!

Wednesday, January 30, 2013

Demystifying OSGi - Java Colombo Meetup - 24 January 2013

The 6th Java Colombo Meetup [1] was held on 24th January 2013 (Last Thursday) at WSO2 premises. The topic on that day was "Demystifying OSGi" and it was presented by Sameera Jayasoma and Pradeep Fernando.

It was the second time I participated for this meetup. Both Sameera (@sameerajayasoma) and Pradeep (@pradeepfn) presented really well and they answered every question asked.

I joined WSO2 recently and we also had internal training sessions on OSGi & OSGi-based WSO2 Carbon Platform [2]. I would say Sameera and Pradeep are experts on OSGi.

Following is the presentation. You can also go through it to get an idea of OSGi.

I must also thank Prabath (@prabath) for organizing the Java Colombo Meetup and I admire his effort to bring the Sri Lankan Java developer community together.

Here are some photos of the event!

Next Meetup:

The next meetup [3] will be the 1st Anniversary of Java Colombo Meetup and it is scheduled to be held on 15th March.

There will be a workshop on OpenShift and keynote by Dr. Sanjiva Weerawarana (@sanjiva)

For more information and to confirm your participation visit


Friday, January 25, 2013

Filling the gap!!

So, my last blog post is back in 2009!! So many things happened in my life last few years.

Here are some highlights:


  • July, 2010:
    • Moved to Habarakada, Sri Lanka. It was not easy moving to a whole new place after living for more than 2 decades in the same place, which used to call "Home"!
  • September 2010:
    • Started using Windows 7 for the first time at office!
  • October, 2010:
    • Participated to APICTA 2010 Malaysia with my manager. The InfoTrack product we presented there won the Gold Award at NBQSA 2010 in the commercial R&D category and won Silver overall.
  • December, 2010:
    • Bought Sony Ericsson Vivaz! My first smartphone!


  • April, 2011:
    • Sri Lanka lost in ICC World cup 2011 final. It was a very sad day!
  • July, 2011:
    • I was offered Associate Tech Lead position at Informatics International Limited
  • October, 2011:
    • Graduated with First Class Honors in BSc (Hons) Software Engineering from the Informatics Institute of Technology, Sri Lanka which is affiliated to the University of Westminster, UK. It wasn't an easy one and I must thank everyone for supporting me in various ways.
  • November, 2011:
    • Went to Horton Plains with my friends! Had a great time!
    • Bought Nikon D5100 Digital SLR! It was a dream for me for a long time! I simply love it!
  • December, 2011:
    • Watched The Adventures of Tintin Movie at Savoy, Wellawatta with my friends! Tintin is one of the best cartoons I have ever watched.
    • Bought Sony Ericsson Xperia Neo. My first ever Android experience!


  • January, 2012:
    • Participated for Android Forum organized by Etisalat.
  • May, 2012:
    • I was one of the groomsmen at one of my Best Friend's Wedding! I was really honored to be there!
  • August, 2011
    • Went on a trip to Dambulla and Sigiriya.
  • September, 2012:
    • Participated for TweetupSL 3 organized by Dialog!
    • Went to Knuckles and it was one of the best trips in my life!
  • October, 2012:
    • Watched T20 World Cup Finals Sri Lanka vs West Indies at the ground and it was my first experience of watching a cricket match live! Had a great time with & my friends, danced like crazy and enjoyed every moment of it. A bit sad about losing the match, but it was really great to be there.
  • November, 2012:
    • Went for Java Colombo Meetup at WSO2. It was a great event!
    • Took the initiative to advance my career and gave my resignation letter.
  • December, 2012:
    • Survived 21.12.2012!


  •  January, 2013
    • Joined WSO2 as a Senior Software Engineer. Joining WSO2 was one of my dreams for last few years and I am really happy to be a part of such a great company founded by two great people, Dr. Sanjiva Weerawarana & Paul Fremantle.
    • Bought Samsung Galaxy S3, the best smartphone in the world! :)
    • Participated for Java Colombo Meetup at WSO2 for the second time.

That's it! This pretty much sums up my life in last few years..

Looking forward to write more blog posts! :)