“Installing” Floodlight OpenFlow Controller – Debian Wheezy


It’s time to learn new things. I want to use an OpenFlow controller with my OVS switches. Openvswitch already provides “a simple OpenFlow controller reference implementation” (ovs-controller) but I’d like to start with Floodlight. I’m using the official documentation but, as always, I like to share my notes with you:

Floodlight works with Java so we’ll install some packages:

aptitude -y install default-jdk ant git

Let’s download the latest Floodlight stable version and compile the jar:

cd /opt
git clone git://github.com/floodlight/floodlight.git
cd floodlight/

[jar] Building jar: /opt/floodlight/target/floodlight.jar
[jar] Building jar: /opt/floodlight/target/floodlight-test.jar
Total time: 25 seconds

We’re going to start Floodlight. The controller by default will listen in the 6633 port.

java -jar target/floodlight.jar
19:53:53.434 INFO [n.f.c.m.FloodlightModuleLoader:main] Loading default modules
19:53:53.827 INFO [n.f.c.i.Controller:main] Controller role set to MASTER
19:53:53.834 INFO [n.f.c.i.Controller:main] Flush switches on reconnect -- Disabled
19:54:03.558 INFO [n.f.l.i.LinkDiscoveryManager:main] Setting autoportfast feature to OFF
19:54:03.779 INFO [o.s.s.i.c.FallbackCCProvider:main] Cluster not yet configured; using fallback local configuration
19:54:03.779 INFO [o.s.s.i.SyncManager:main] [32767] Updating sync configuration ClusterConfig [allNodes={32767=Node [hostname=localhost, port=6642, nodeId=32767, domainId=32767]}, authScheme=CHALLENGE_RESPONSE, keyStorePath=/etc/floodlight/auth_credentials.jceks, keyStorePassword is unset]
19:54:03.853 INFO [o.s.s.i.r.RPCService:main] Listening for internal floodlight RPC on localhost/
19:54:04.066 INFO [n.f.c.i.Controller:main] Listening for switch connections on
19:54:09.047 INFO [n.f.j.JythonServer:debugserver-main] Starting DebugServer on :6655

OK, the controller is waiting for connections. Now we’re going to add a new OVS bridge and set the controller for that bridge:

ovs-vsctl add-br br0
ovs-vsctl set-controller br0 tcp:

Floodlight is being contacted by Openvswitch! 🙂

20:18:24.725 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-1] New switch connection from /
20:18:24.749 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-1] Disconnected switch [/ DPID[?]]
20:18:25.703 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-2] New switch connection from /
20:18:25.728 INFO [n.f.c.i.OFChannelHandler:New I/O server worker #2-2] Switch OFSwitchBase [/ DPID[00:00:b6:19:eb:08:04:4d]] bound to class class net.floodlightcontroller.core.internal.OFSwitchImpl, writeThrottle=false, description Switch Desc - Vendor: Nicira, Inc. Model: Open vSwitch Make: None Version: 1.9.3 S/N: None
20:18:25.731 INFO [n.f.c.OFSwitchBase:New I/O server worker #2-2] Clearing all flows on switch OFSwitchBase [/ DPID[00:00:b6:19:eb:08:04:4d]]
20:18:25.734 WARN [n.f.c.i.C.s.notification:main] Switch 00:00:b6:19:eb:08:04:4d connected.

Now thanks to Marist College (SDN Lab) and IBM I’ll use Avior as a Floodlight GUI, visit the webpage to download the 32bit or 64bit version

cd /opt
wget http://openflow.marist.edu/static/download/avior-1.3_linux_x64.jar
java -jar avior-1.3_linux_x64.jar

And here is a screenshot, the OpenVswitch is shown. Great.


This is just the beginning! More in a few days… I’ll update this post including how to add a daemon to start the controller.


Openvswitch 1.9.3 LTS – Debian Wheezy

I’m preparing a lab with two nodes, one with Debian Wheezy and the other one with CentOS 6.5.

I’m not a Debian guy so I hope I’m not doing things wrong, but first of all I’d like to thank again Nicira Inc as I used the information included in the README.Debian included in Openvswitch’s recent versions.

Here are my notes on how I installed Openvswitch 1.9.3 LTS, but first a warning, you may find Openvswitch in the official Debian repositories or from Ubuntu repositories, so use this post if you really can’t find the deb packages on the Internet. I just want to help 🙂

  1. Let’s install some development packages. If you have any problems you can try to install the build-essential packages.
    aptitude -y install gcc make automake autoconf debhelper libssl-dev pkg-config python-all python-qt4 python-zopeinterface python-twisted-conch gdebi-core
  2. Now we’re going to create a user, and “use” it to prepare the debian packages. Be patient, we need to compile.
  3. useradd -s /bin/bash -m openvswitch
    su – openvswitch
    wget http://openvswitch.org/releases/openvswitch-1.9.3.tar.gz
    tar xvfz openvswitch-1.9.3.tar.gz
    mv openvswitch-1.9.3.tar.gz openvswitch_1.9.3.orig.tar.gz
    cd openvswitch-1.9.3/
    dpkg-buildpackage -us -uc
  4. Now as root we are going to install the Debian packages we’ve just created and generate the kernel module. Remember to accept the installations :-):
    gdebi /home/openvswitch/openvswitch-datapath-source_1.9.3-1_all.deb
    module-assistant auto-install openvswitch-datapath
    gdebi /home/openvswitch/openvswitch-common_1.9.3-1_amd64.deb 
    gdebi /home/openvswitch/openvswitch-switch_1.9.3-1_amd64.deb accept to install 
    [ ok ] Inserting openvswitch module. 
    [warn] /etc/openvswitch/conf.db does not exist ... (warning). 
    [ ok ] Creating empty database /etc/openvswitch/conf.db. 
    [ ok ] Starting ovsdb-server. 
    [ ok ] Configuring Open vSwitch system IDs. 
    [ ok ] Starting ovs-vswitchd. 
  5. And now let’s if openvswitch is ready:
    # ovs-vsctl -V 
    ovs-vsctl (Open vSwitch) 1.9.3 
    Compiled Feb 18 2014 19:20:41
    # ovs-vsctl show 
        ovs_version: "1.9.3"

And… finished, or at least that’s what it seems.

Thanks for reading, and please visit my personal page if you want to hire me… for free.

Installing Openvswitch 1.10 on Debian Wheezy

Ok. Now that I’m using Debian again it’s time for Openvswitch. Building a .deb pack for openvswitch it’s very easy thanks to the readme files provided by Openvswitch and Nicira.

We’ll need a few packages first (thanks for the gdebi-core tip):

aptitude -y install gcc make automake autoconf debhelper libssl-dev pkg-config python-all python-qt4 python-zopeinterface python-twisted-conch gdebi-core

I’m building the package as a non root user. I’ll create a directory and download OVS 1.10 version. After that I’ll use dpkg-buildpackage to create the debian package.

mkdir openvswitch
cd openvswitch

wget http://openvswitch.org/releases/openvswitch-1.10.0.tar.gz

tar xvfz openvswitch-1.10.0.tar.gz

mv openvswitch-1.10.0.tar.gz openvswitch_1.10.0.orig.tar.gz

cd openvswitch-1.10.0
dpkg-buildpackage -us -uc
cd ..

Ok, now we’ll use our root account. Go to the directory where you’ve downloaded the openvswitch tar.gz file. We’ll install some debian packages and build the openvswitch kernel module. We’ll use gdebi to solve dependency problems when installing local deb files.

gdebi openvswitch-datapath-source_1.10.0-1_all.deb
module-assistant auto-install openvswitch-datapath // Wait a few minutes for compilation to finish
gdebi openvswitch-common_1.10.0-1_amd64.deb
gdebi openvswitch-switch_1.10.0-1_amd64.deb

Let’s try to run a few OVS commands:

# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 1.10.0
Compiled Jun 15 2013 19:23:15

# ovs-vsctl show
 ovs_version: "1.10.0"

# ovs-vsctl add-br brtest0
# ovs-vsctl show
 Bridge "brtest0"
 Port "brtest0"
 Interface "brtest0"
 type: internal
 ovs_version: "1.10.0"

It looks good. This one was easy….

Installing OpenNebula 4.0.1 using deb packages in Debian Wheezy

Hi again!

I’m a CentOS guy but a long time ago I started my Linux career with Debian. I’ve been asked to try to install OpenNebula 4.0.1 in Debian Wheezy so here is a post about what I’ve done.

Remember: I only want to try to help people, but I’m no Debian expert so I’m not responsible for direct or indirect damage caused by the use of the information on this site.

In general OpenNebula official packages works fine for Debian Wheezy, but there’s one package (opennebula_4.0.1-1_amd64.deb) that we’ll need to modify to avoid problems with dependencies. I’m going to execute all the commands as root and using a clean Debian minimal installation (only OpenSSH and utilies installed)

The first thing we’re going to do is to download and extract the OpenNebula source files from the official downloads page.

tar xvfz opennebula-4.0.1.tar.gz
cd opennebula-4.0.1

We’ll need to compile the opennebula source files using the instructions found in the README.md file but first we’ll need a few packages.

aptitude -y install g++ ruby ruby-sqlite3 openssl libxmlrpc-core-c3-dev libsqlite3-dev libxmlrpc-c++4-dev scons flex bison libxml2-dev libssl-dev rake rubygems ruby-dev libmysqld-dev ruby-xmlparser libxslt1-dev libcurl4-openssl-dev

Now we are going to compile opennebula with mysql support. After the compilation we’re going to install the opennebula files in a temp directory called one_build:

scons mysql=yes
mkdir ../one_build/
./install.sh -d ../one_build/

Ok we’re done. Now let’s download the opennebula 4.0.1 packages for debian 6.0.7 from the opennebula.org download site and move them to a directory. Uncompress the files.

tar xvfz Debian-6.0.7-opennebula-4.0.1-1.tar.gz
cd opennebula-4.0.1-1/

I’m a Debian newbie so I’ve decided to modify the existing deb package instead of building my own from scratch. I’ve used this useful forum post. We’ll use a temp directory called buildeb.

mkdir buildeb
dpkg-deb -x opennebula_4.0.1-1_amd64.deb buildeb/
dpkg-deb --control opennebula_4.0.1-1_amd64.deb
mv DEBIAN buildeb/
cd buildeb

Ok let’s modify the deb package.

Step 1, edit the DEBIAN/control file.

Change these dependencies:

  • libssl0.9.8 (>= 0.9.8m-1) -> libssl1.0.0 (>= 1.0.1e-2)
  • libmysqlclient16 (>= 5.1.21-1) -> libmysqlclient18 (>= 5.5.31)
  • libxmlrpc-c3 -> libxmlrpc-core-c3 (>= 1.16.33-3.2)

Add this dependency after libxmlrpc-core-c3 (the comma is to separate dependencies :-D):

  • , libxmlrpc-c++4 (>= 1.16.33-3.2)

Step 2, we are going to substitute some binaries from the .deb with those that we’ve just compiled so the right libraries are used.

# cp ../../one_build/bin/tty_expect usr/bin/
# cp ../../one_build/bin/oned usr/bin/
# cp ../../one_build/bin/one usr/bin/
# cp ../../one_build/bin/mm_sched usr/bin/
# cp ../../one_build/bin/onedb usr/bin/

OK now we’re ready to build our opennebula debian package for wheezy:

cd ..
# dpkg -b buildeb opennebula_4.0.1-1_amd64_wheezy.deb

OK. All packages are ready but before installing them we are going to insall gdebi. It’ll help us to install the local deb files solving dependencies.

aptitude -y install gdebi

Come on, let’s install!

# gdebi opennebula-common_4.0.1-1_all.deb
# gdebi ruby-opennebula_4.0.1-1_all.deb
# gdebi opennebula-tools_4.0.1-1_all.deb
# gdebi opennebula_4.0.1-1_amd64_wheezy.deb
# gdebi opennebula-sunstone_4.0.1-1_all.deb

Now we’ll check if opennebula and sunstone are running:

service opennebula status
[ ok ] one is running.grep

netstat -ntap | grep 9869
tcp 0 0* LISTEN 22034/ruby

And finally let’s switch to user oneadmin and run a few commands:

$ onehost list

oneadmin@lestrade:/home/mcabrerizo/opennebula-4.0.1-1$ onevm list

Ok. The installation seems fine! but I’ll check in the next days if I missed something important. If all is good I’ll post here an URL to download the deb package I’ve bulit so you can save time (or write me an email if you can’t wait! look for my contact information)

Please I appreciate your feedbacks it helps me to keep my blog useful for the community.