Upgrade Ubuntu Open vSwitch using packages in Mininet VM

Update: I’m updating this post with a few improvements and also changing the Open vSwitch version to 2.0.


In a previous post, I provided some instructions on how to upgrade Open vSwitch in the Mininet VM.  Since then, I have been doing the same in my VMs over and over and have slowly been optimizing the steps to do it.  So lately, I tried to figure out how to actually do the upgrade by building Debian install packages to install Open vSwitch instead of building and installing binaries directly.  The main advantage of building and installing deb packages is that you can easily upgrade over and over.

The next steps will be to upgrade the Open vSwitch that gets installed by Mininet, which in this case was Open vSwtich version 1.4.0.  I want to upgrade it to 2.0.0.  The following should be the cut and paste instructions for upgrading using built packages.

Remove old Open vSwtich:
sudo apt-get remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch

Download the new Open vSwtich source tarball:
mkdir openvswitch
cd openvswitch
wget http://openvswitch.org/releases/openvswitch-2.0.0.tar.gz
tar zxvf openvswitch-2.0.0.tar.gz
cd openvswitch-2.0.0

Install all the dependencies that will be needed:
sudo apt-get update
sudo apt-get -y install build-essential fakeroot debhelper autoconf automake libssl-dev pkg-config bzip2 openssl python-all procps python-qt4 python-zopeinterface python-twisted-conch

Build the Debian packages:
DEB_BUILD_OPTIONS='parallel=2 nocheck' fakeroot debian/rules binary

Install the packages:
cd ..
dpkg -i openvswitch-common*.deb openvswitch-datapath-dkms*.deb openvswitch-controller*.deb openvswitch-pki*.deb openvswitch-switch*.deb

Then do some post install steps to keep the Open vSwitch Controller from starting automatically on boot:
sudo /etc/init.d/openvswitch-controller stop
sudo update-rc.d openvswitch-controller disable
sudo /etc/init.d/openvswitch-switch start

That’s it.  I feel better about these instructions because you can keep using the same steps over and over to upgrade to the latest version of Open vSwitch.  You would only need to change the “Download” step to get the version you want.

This post ‘Another way to upgrade Open vSwitch in Mininet VM’ first appeared on https://gregorygee.wordpress.com/.


6 Responses to Upgrade Ubuntu Open vSwitch using packages in Mininet VM

  1. Pingback: Upgrading Open vSwitch in Mininet 2.0 VM to OVS 1.10 | Tech and Trains

  2. grady says:

    Yes, It is really a better way to support latest ovs version.

    But I met an error while using mininet, may you give me some advise or points? detail as below:

    After upgraded to ovs 2.1.2(follow your steps), then install mininet again:

    > sudo apt-get install mininet
    > sudo mn –test pingall

    > Results: 100% dropped (2/2 lost) //failed here.

    And, I watch the process, ” ps -A |grep ovs”, there are only 2 ovs processes:
    > 1296 ? 00:00:00 ovsdb-server
    > 1321 ? 00:00:00 ovs-vswitchd

    Compare witch ovs 1.4.6, there are 4 ovs processes, 2 db serve and 2 vswitchd.

    Thank you very much!

    • gregorygee says:

      Starting with OVS 2.1.0, it no longer has ovs-controller. When you start mn with the default parameters, it tries to start the ovs-controller, but fails, which is why you are seeing the failure. You are running a network without a controller. So you can either run your own controller or run mininet using the reference controller.

      sudo mn -test pingall –controller=ref

      • grady says:

        They rename the “ovs-controller” to “test-controller”.

        > sudo ln -s ovs/tests/test-controller /usr/local/sbin/ovs-controller
        > sudo ln -s /var /usr/local/var
        > sudo mn –test pingall –controller=ovsc

        It works now.

        Thank you so much!

  3. I downloaded Openvswitch version 2.1.3. After building with “DEB_BUILD_OPTIONS=’parallel=2 nocheck’ fakeroot debian/rules binary”, there is no openvswitch-controller*.deb coming out. How can I get this file?

    • gregorygee says:

      Stating in Open vSwitch 2.1.0, ovs-controller is not longer included. Actually, it has been renamed test-controller, but depending on the version you are using, it may not be compiled and packages by default in Open vSwitch. This controller should really only be used for basic tests anyway. You should be trying to use a more feature rich and programmable controller like POX, Floodlight, Open Daylight, etc.

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 )

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: