problems in configuring ovs to act as switch

1,988 views
Skip to first unread message

Sanghamitra De

unread,
Feb 5, 2015, 1:26:08 PM2/5/15
to emulab...@googlegroups.com
Hi,
attached is the NS file of my project.

With node1 i tried to issue the following commands:

$ apt-get update
$ apt-get install openvswitch-datapath-source bridge-utils
$ module-assistant auto-install openvswitch-datapath
$ apt-get install openvswitch-brcompat openvswitch-common
$ apt-get install curl traceroute
the 3rd command, that is:   $ module-assistant auto-install openvswitch-datapath           fails
screenshot is attached with email.
For node 4 which already has ovs installed in it, the following commands (to configure Open vSwitch to use those interfaces as if they were the interfaces of a switch) were meant to be attempted. The very first command gave an error:
ovs-vsctl add-br br-int
ovs-vsctl add-port br-int eth2
ifconfig eth2 0
ifconfig br-int 10.10.1.2 netmask 255.255.255.0
route add -net 10.10.1.0 netmask 255.255.255.0 dev br-int

ovs-vsctl add-br br-int2
ovs-vsctl add-port br-int2 eth4
ifconfig eth4 0
ifconfig br-int2 10.10.2.1 netmask 255.255.255.0
route add -net 10.10.2.0 netmask 255.255.255.0 dev br-int2

which command sequence may be used to configure a switch node (one that has ovs installed) so that its ethernet interfaces can be used for switch interfaces?
Thanks & Regards
Sanghamitra
NSfile.txt
switch1.jpg

Eric Eide

unread,
Feb 5, 2015, 3:21:31 PM2/5/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> attached is the NS file of my project.

Just a quick note to say that I've been quite busy for the past week, so I
haven't had time to reply to your messages. I will try to reply tomorrow or
this weekend.

Of course, other readers of emulab-users should feel free to beat me to a
reply...

Eric.

--
-------------------------------------------------------------------------------
Eric Eide <ee...@cs.utah.edu> . University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX

Daniel Havey

unread,
Feb 5, 2015, 5:31:36 PM2/5/15
to emulab...@googlegroups.com
Hi Sanghamitra,

Put the third line together with the second like this:

apt-get install openvswitch-datapath-source bridge-utils
module-assistant auto-install openvswitch-datapath

That way apt-get can install all of your programs ;^)
...Daniel
PS...I hope that was what you needed. I only had a few moments to
scan the email. Good luck!



apt-get update
$ apt-get install openvswitch-datapath-source bridge-utils
$ module-assistant auto-install openvswitch-datapath
$ apt-get install openvswitch-brcompat openvswitch-common
$ apt-get install curl traceroute

> --
> You received this message because you are subscribed to the Google Groups "emulab-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to emulab-users...@googlegroups.com.
> To post to this group, send email to emulab...@googlegroups.com.
> Visit this group at http://groups.google.com/group/emulab-users.
> For more options, visit https://groups.google.com/d/optout.

Sanghamitra De

unread,
Feb 6, 2015, 1:11:41 PM2/6/15
to emulab...@googlegroups.com
Many Thanks to Daniel and Eric.

I gave the commands together as:
apt-get install openvswitch-datapath-source bridge-utils
module-assistant auto-install openvswitch-datapath

and it says:

E: Unable to locate package auto-install
E: Unable to locate package openvswitch-datapath

what can I do to do this right?

I got a few more questions:

I'm writing the following in the switch nodes which have ovs installed already:





You received this message because you are subscribed to a topic in the Google Groups "emulab-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emulab-users/xU2m6C9LaKE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emulab-users...@googlegroups.com.

Sanghamitra De

unread,
Feb 6, 2015, 1:33:43 PM2/6/15
to emulab...@googlegroups.com
---------- Forwarded message ----------
From: Sanghamitra De <sangham...@gmail.com>
Date: Fri, Feb 6, 2015 at 11:41 PM
Subject: Re: [emulab-users] Re: problems in configuring ovs to act as switch
To: emulab...@googlegroups.com


Many Thanks to Daniel and Eric.

I gave the commands together as:
apt-get install openvswitch-datapath-source bridge-utils
module-assistant auto-install openvswitch-datapath

and it says:

E: Unable to locate package auto-install
E: Unable to locate package openvswitch-datapath

what can I do to do this right?

I got a few more questions:

I'm writing the following in the switch nodes which have ovs installed already:

apt-get update
apt-get install openvswitch-datapath-source bridge-utils
module-assistant auto-install openvswitch-datapath
apt-get install openvswitch-brcompat openvswitch-common
apt-get install curl traceroute

1) what about the controller node? what do i write in there?
2)since these are software switches and software controller therefore a controller and a switch may be the same node? Yes?
3) a switch will route traffic to the hosts, use the firewall ruleset to sieve traffic in and out. But what is the function of the controller? Also is a controller supposed to be 'linked' to its switch interface or to other switch interfaces ?

4) where do i write down these:

ovs-vsctl add-br br-int
ovs-vsctl add-port br-int eth2
ifconfig eth2 0
ifconfig br-int 10.10.1.2 netmask 255.255.255.0
route add -net 10.10.1.0 netmask 255.255.255.0 dev br-int

ovs-vsctl add-br br-int2
ovs-vsctl add-port br-int2 eth4
ifconfig eth4 0
ifconfig br-int2 10.10.2.1 netmask 255.255.255.0
route add -net 10.10.2.0 netmask 255.255.255.0 dev br-int2
5) where exactly (for e.g. inside /user) may I save the .py files written for controller. Say for e.g. if my controller is residing in the same node which is also a switch for a lan then exactly inside which folder do i save the py file with the controller code?
6) how may the switches be connected to each other and to the rest of the nodes for e.g. like connecting the ethernet of the nodes or connecting the in_port of one node with the out_port of a switch and so on........?
7) Is the above code/below code mentioned enough for connecting the switch nodes to other nodes and for connecting switches to each other?

apt-get install openvswitch-datapath-source bridge-utils
module-assistant auto-install openvswitch-datapath
apt-get install openvswitch-brcompat openvswitch-common
apt-get install curl traceroute



and


ovs-vsctl add-br br-int
ovs-vsctl add-port br-int eth2
ifconfig eth2 0
ifconfig br-int 10.10.1.2 netmask 255.255.255.0
route add -net 10.10.1.0 netmask 255.255.255.0 dev br-int

ovs-vsctl add-br br-int2
ovs-vsctl add-port br-int2 eth4
ifconfig eth4 0
ifconfig br-int2 10.10.2.1 netmask 255.255.255.0
route add -net 10.10.2.0 netmask 255.255.255.0 dev br-int2
so these codes too should reside in the start file (that runs to set up the expt.) along with the code for building an image that loads each node with ovs????
Sorry ... too long queries form my end. & the last post got send incomplete (accidental press of the send button)
Thanks & Regards
Sanghamitra

Eric Eide

unread,
Feb 7, 2015, 6:32:28 PM2/7/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> attached is the NS file of my project.
>
> With node1 i tried to issue the following commands:
>
> $ apt-get update
> $ apt-get install openvswitch-datapath-source bridge-utils
> $ module-assistant auto-install openvswitch-datapath
> $ apt-get install openvswitch-brcompat openvswitch-common
> $ apt-get install curl traceroute
> the 3rd command, that is:  $ module-assistant auto-install openvswitch-datapath fails

I'm not familar with Ubuntu's Open vSwitch (OVS) packages, sorry.

In previous email, I suggested building OVS from source:
https://groups.google.com/d/msg/emulab-users/p8SmaVx6pmQ/zJF4Y-ePfkcJ

If you build OVS from source, the command for installing the OVS kernel module
should be:

sudo /sbin/modprobe openvswitch

See step 7 of the OVS installation instructions, here:
http://git.openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL;hb=HEAD

> For node 4 which already has ovs installed in it, the following commands (to
> configure Open vSwitch to use those interfaces as if they were the interfaces
> of a switch) were meant to be attempted. The very first command gave an
> error:
>
> ovs-vsctl add-br br-int

What was the error?

Without knowing the error, my guess is that either (1) the OVS kernel module
wasn't installed --- see the "modprobe" discussion above, or (2) you didn't
issue the "ovs-vsctl" command as root, or (3) the "ovs-vsctl" command wasn't in
your command search path.

Good luck! ---

Sanghamitra De

unread,
Feb 8, 2015, 2:56:22 PM2/8/15
to emulab...@googlegroups.com
Yes as per the earlier mail i had build OVS from source by doing this:

## Create a local work directory.
sudo mkdir /work
sudo chown `whoami` /work
cd /work


## Download, configure, compile, and install Open vSwitch.
wget 
http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
tar zxf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure
make
sudo make install

## Clean up.
cd /
sudo rm -rf /work

## Logout, use Emulab web interface to make a disk image.


and made the disk image following the instructions at:    https://wiki.emulab.net/wiki/Tutorial#section-24




So I'll now try the modified sequence as:?


## Create a local work directory.
sudo mkdir /work
sudo chown `whoami` /work
cd /work


## Download, configure, compile, and install Open vSwitch.
wget 
http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
tar zxf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure

make modules_install (instead of: make)
sudo /sbin/modprobe openvswitch                        (instead of:   sudo make install)

## Clean up.
cd /
sudo rm -rf /work

## Logout, use Emulab web interface to make a disk image as per
:    https://wiki.emulab.net/wiki/Tutorial#section-24


& to verify that the modules have been loaded, run "/sbin/lsmod" and check that openvswitch is listed.






For a node which already has ovs installed in it, trying to run the following commands (to configure Open vSwitch to use those interfaces as if they were the interfaces of a switch) were meant to be attempted. The very first command gave an error. The comand & error are:


Command given: apt-get install openvswitch-datapath-source bridge-utils module-assistant auto-install openvswitch-datapath


error generated is :  E: Unable to locate package auto-install

                             E: Unable to locate package openvswitch-datapath





I will let you know how things turn out after running the modified command.



Thanks & Regards


Sanghamitra De

unread,
Feb 10, 2015, 6:07:56 AM2/10/15
to emulab...@googlegroups.com
Hi,
I was trying to run the following commands in the exact sequence:

Sequence1: 

## Create a local work directory.
sudo mkdir /work
sudo chown `whoami` /work
cd /work


## Download, configure, compile, and install Open vSwitch.
wget 
http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
tar zxf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure

make modules_install (instead of: make)
sudo /sbin/modprobe openvswitch                        (instead of:   sudo make install)

## Clean up.
cd /
sudo rm -rf /work

## Logout, use Emulab web interface to make a disk image as per
:    https://wiki.emulab.net/wiki/Tutorial#section-24


& to verify that the modules have been loaded, run "/sbin/lsmod" and check that openvswitch is listed.



However, on trying to execute the command: make modules_install (marked in red) instead of make the following error is produced:


make: Nothing to be done for modules_install


So then i changed the sequence a bit and ran the following:



Sequence2: 

## Create a local work directory.
sudo mkdir /work
sudo chown `whoami` /work
cd /work

wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
tar zxf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure

make

make modules_install

sudo /sbin/modprobe openvswitch                        (instead of:   sudo make install)


make modules_install gives the same error (in green as shown above).

On running /sbin/lsmod openvswitch and modules like gre, vxlan & libcrc32c which use openvswitch are listed



1) what will be the modified sequence of commands that i need to run?

2) will the modified sequence also enable a successful execution of the following commands & writing and working of controllers in pox environment?




apt-get install openvswitch-datapath-source bridge-utils
module-assistant auto-install openvswitch-datapath

apt-get install openvswitch-brcompat openvswitch-common
apt-get install curl traceroute

ovs-vsctl add-br br-int
ovs-vsctl add-port br-int eth2
ifconfig eth2 0
ifconfig br-int 10.10.1.2 netmask 255.255.255.0
route add -net 10.10.1.0 netmask 255.255.255.0 dev br-int

ovs-vsctl add-br br-int2
ovs-vsctl add-port br-int2 eth4
ifconfig eth4 0
ifconfig br-int2 10.10.2.1 netmask 255.255.255.0
route add -net 10.10.2.0 netmask 255.255.255.0 dev br-int2



Thanks & Regards
Sanghamitra

Eric Eide

unread,
Feb 10, 2015, 10:10:20 AM2/10/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> However, on trying to execute the command: make modules_install (marked in
> red) instead of make the following error is produced:
>
> make: Nothing to be done for modules_install

This is not an error. It's telling you that whatever "make modules_install"
would do, it has already been done.

When I install OVS, I simply compile it and then run "sudo make install".

To load the OVS kernel module, I do: "sudo /sbin/modprobe openvswitch".

> 2) will the modified sequence also enable a successful execution of the
> following commands & writing and working of controllers in pox environment?

Sorry, I can't answer questions about POX.

Good luck ---

Sanghamitra De

unread,
Feb 10, 2015, 11:58:49 PM2/10/15
to emulab...@googlegroups.com
Thank You. And I was thinking its an error... !! Thanks. Now I can proceed with :

sudo make install
sudo /sbin/modprobe openvswitch

and then try with the other commands. 


Thanks & Regards
Sanghamitra

Sanghamitra De

unread,
Feb 11, 2015, 12:24:25 PM2/11/15
to emulab...@googlegroups.com
Hi,
I used the following commands successfully, created disk image from source, and loaded 3 nodes with that image:


## Create a local work directory.
sudo mkdir /work
sudo chown `whoami` /work
cd /work

## Download, configure, compile, and install Open vSwitch.
wget 
http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz

tar zxf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure
make
sudo make install
sudo /sbin/modprobe openvswitch


/sbin/lsmod


## Clean up.
cd /
sudo rm -rf /work



/sbin/lsmod gave the list of modules installed.


However, on trying to run the following commands, errors are produced:

apt-get install openvswitch-datapath-source bridge-utils

Package bridge-utils is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted or is only available from another source

E: Unable to locate package openvswitch-datapath-source
E: package bridge-utils has no installation candidate



module-assistant auto-install openvswitch-datapath 

The package module-assistant is not currently installed. You can install it by typing: apt-get install module-assistant

apt-get install module-assistant
Unable to locate package module-assistant



apt-get install  openvswitch-switch openvswitch-common openvswitch-controller

Package openvswitch-switch is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted or is only available from another source
E: package openvswitch-switch has no installation candidate
E: Unable to locate package openvswitch-common
E: Unable to locate package openvswitch-controller


The above commands should be executed if OVS has to be configured to use a node as a router or firewall.... what to do now...???!



Thanks & Regards
Sanghamitra

Eric Eide

unread,
Feb 11, 2015, 1:41:55 PM2/11/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> ## Download, configure, compile, and install Open vSwitch.
> [...]
>
> However, on trying to run the following commands, errors are produced:
>
> apt-get install openvswitch-datapath-source bridge-utils
>
> Package bridge-utils is not available, but is referred to by another package.
> This may mean that the package is missing, has been obsoleted or is only
> available from another source

Two answers:

FIRST, I'm not sure why you are having trouble installing "bridge-utils" or
other packages. In the Utah Emulab site, I just swapped in a one-node
experiment running the UBUTNU14-64-STD disk image, logged in, and I had no
trouble installing packages:

sudo bash
apt-get update # worked
apt-get install bridge-utils # worked
apt-get install openvswitch-datapath-source # worked

If you're not using the UBUNTU14-64-STD disk image, perhaps you can modify your
experiment to use that. (As I recall, you previously built your own disk image
with OVS installed? If so, try using UBUNTU14-64-STD instead and build OVS on
top of it.)

SECOND, I'm not familiar with the OVS packages that are maintained by Ubuntu
--- sorry! --- so I can't answer specific questions about them.

But more generally, I don't understand why you are trying to install these
packages. You've already built and installed OVS from source. I don't
understand why you would need to, or want to, install OVS packages on top of
what you've already done.

Either install OVS from packages or install OVS from source. It doesn't make
sense to do both.

Sanghamitra De

unread,
Feb 12, 2015, 1:34:44 AM2/12/15
to emulab...@googlegroups.com
Hi,
I have initially installed all the nodes with UBUNTU14-64-STD (i.e. the nodes are loaded as is mentioned in the NS file as:

set node5 [$ns node]
tb-set-node-os $node5 UBUNTU14-64-STD

and then on a node i am running the following statements:

## Create a local work directory.

sudo mkdir /work
sudo chown `whoami` /work
cd /work

## Download, configure, compile, and install Open vSwitch.

tar zxf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure
make
sudo make install
sudo /sbin/modprobe openvswitch


/sbin/lsmod

## Clean up.
cd /
sudo rm -rf /work


/sbin/lsmod gave the list of modules installed.

So the OVS is being built and installed from source.


You are saying:

"But more generally, I don't understand why you are trying to install these packages.  You've already built and installed OVS from source.  I don't understand why you would need to, or want to, install OVS packages on top of what you've already done.

Either install OVS from packages or install OVS from source.  It doesn't make sense to do both."


So that means that I dont need to install those packages separately. They are already installed since i built OVS from source. So does that indicate that i can move on to configuring OVS?

If YES then is the sequence mentioned in below link sufficient for configuring OVS to route packets?



Also, before I move on to configuring I need to have a controller installed i guess??
 The bridges will be linked to the controller? So controller must be in place... I think

Is that how it should proceed....?

First install OVS and install it on required nodes, then have the controller up and running then configure the OVS and finally the nodes start exchanging via switches and controller?

Thanks & Regards
Sanghamitra

Eric Eide

unread,
Feb 16, 2015, 10:10:20 PM2/16/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> You are saying:
>
> "But more generally, I don't understand why you are trying to install these
> packages. You've already built and installed OVS from source. I don't
> understand why you would need to, or want to, install OVS packages on top of
> what you've already done. Either install OVS from packages or install OVS
> from source. It doesn't make sense to do both."
>
> So that means that I dont need to install those packages separately. They are
> already installed since i built OVS from source. So does that indicate that i
> can move on to configuring OVS?

Yes: I think that after you compile and install OVS from source, you should be
able to configure it. That has always worked for me.

> If YES then is the sequence mentioned in below link sufficient for
> configuring OVS to route packets?
> http://groups.geni.net/geni/wiki/HowTo/ConfigureOVSWithLayer3Routing

Well, it is sufficient, yes, but:

+ The exact commands that one needs to issue depend on the network topology
at hand. The page that you reference describes a three-node topology with
specific network interfaces (eth1, eth2) and specific IP addresses assigned
to to the interfaces. If your network topology is different, then you may
need to adjust the commands that you would need to type.

+ The setup on that page is more complicated that what you need if you simply
want the OVS node to act as a switch. But it will do the job of getting
packets between eth1 and eth2.

> Also, before I move on to configuring I need to have a controller installed i
> guess??

The command lines on the web page are enough to configure OVS to send packets
between the two interfaces, eth1 and eth2.

A controller would talk to OVS to give further commands to OVS, to tell it how
to handle particular kinds of packets. You do don't *have* to have a
controller in order to run OVS, but you will certainly want one in order to do
something really interesting with OVS.

I'm sorry that you are having so much trouble setting up OVS-based experiments!

Best wishes ---

Sanghamitra De

unread,
Feb 16, 2015, 11:17:56 PM2/16/15
to emulab...@googlegroups.com
Thank You so much. I will do the setup and configure OVS and would inform.

Thank You once again.

Sanghamitra De

unread,
Feb 17, 2015, 12:36:04 PM2/17/15
to emulab...@googlegroups.com
when I'm trying to run the command for configuration i.e. sudo ovs-vsctl add-br OVSbr1 either at: 

root@node1:/users/peertest/#

or at:

root@node1:/users/peertest/openvswitch-2.3.0#


it says: ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)


The command is like.. the first thing to be done in configuring OVS where i log in and create 2 OVS bridges

OVS has already been installed from source and therefore installing packages separately again is not required.

I tried to address this issue by running:

#insmod datapath/linux/openvswitch.ko
#mkdir -p /usr/local/etc/openvswitch
#ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

(ALL the commands were run at:                     root@node1:/users/peertest/# )

and it gives an error saying=>  
ovsdb-tool: failed to read schema: "vswitchd/vswitch.ovsschema" could not be read as JSON (error opening "vswitchd/vswitch.ovsschema" : No such file or directory)

Now what to do??!!! Am I trying to run the commands inside the wrong directory?

Eric Eide

unread,
Feb 19, 2015, 4:27:27 PM2/19/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> when I'm trying to run the command for configuration i.e. sudo ovs-vsctl
> add-br OVSbr1 either at: [...]
>
> it says: ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database
> connection failed (No such file or directory)

It sounds like you didn't initialize the OVS configuration database. Or more
likely, you tried to initialize the database, and it didn't work:

> #ovsdb-tool create /usr/local/etc/openvswitch/conf.db \
> vswitchd/vswitch.ovsschema
>
> and it gives an error saying=>  
> ovsdb-tool: failed to read schema: "vswitchd/vswitch.ovsschema" could not be
> read as JSON (error opening "vswitchd/vswitch.ovsschema" : No such file or
> directory)

The "vswitchd/vswitch.ovsschema" file is found in the OVS source tree. So,
either issue the "ovsdb-tool" command from the root directory of your OVS
source tree, or name the file via an absolute filename.

Sanghamitra De

unread,
Feb 21, 2015, 2:23:05 PM2/21/15
to emulab...@googlegroups.com
Hi,
as the screenshot would show the command :


ovsschema.jpg

Sanghamitra De

unread,
Feb 21, 2015, 2:31:48 PM2/21/15
to emulab...@googlegroups.com
Hi,
as the screen shot would show the command:

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.0/vswitchd/vswitch.ovsschema 

executed fine.


however, the command:

sudo ovs-vsctl add-br OVSbr1


still gives the error:

ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)



i executed the command ovsdb-tool create .......


and then was on to executing commands as listed at:



was i proceeding in the right sequence?... i mean executing 


#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.0/vswitchd/vswitch.ovsschema 

and then moving on to:

sudo ovs-vsctl add-br OVSbr1
sudo ovs-vsctl add-br OVSbr2
sudo ifconfig eth1 0
sudo ifconfig eth2 0
sudo ovs-vsctl add-port OVSbr1 eth1
sudo ovs-vsctl add-port OVSbr2 eth2

etc..... seems fine right??? and they were being executed at: root@node1:/users/peertest/# )


then what was wrong??? why does it keep on giving:

ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

am i skipping some other command??

Thanks & Regards
Sanghamitra

PS: sorry .. the previous reply (incomplete) got send accidentally

Sanghamitra De

unread,
Feb 21, 2015, 2:32:59 PM2/21/15
to emulab...@googlegroups.com
the screenshot -- for a quick look. Thanks!!!!
ovsschema.jpg

Eric Eide

unread,
Feb 28, 2015, 6:40:29 PM2/28/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> #ovsdb-tool create /usr/local/etc/openvswitch/conf.db \
> /users/peertest/openvswitch-2.3.0/vswitchd/vswitch.ovsschema
>
> executed fine.
> however, the command:
>
> sudo ovs-vsctl add-br OVSbr1
>
> still gives the error:
>
> ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection
> failed (No such file or directory)

See these installation/startup instructions for OVS:

https://github.com/openvswitch/ovs/blob/master/INSTALL.md#startup

Briefly, before you can start setting up bridges and so on, you must first:

+ start the configuration database, called "ovsdb-server"
+ initialize the database, using "ovs-vsctl"
+ start the main OVS daemon, using "ovs-vswitchd"

Then you should be able to add bridges and so on.

Best wishes ---

Sanghamitra De

unread,
Mar 1, 2015, 1:02:09 PM3/1/15
to emulab...@googlegroups.com
Thank You. Will execute the commands and let know what happened. 

Thanks & Regards
Sanghamitra


Sanghamitra De

unread,
Mar 3, 2015, 12:17:23 PM3/3/15
to emulab...@googlegroups.com
Hi,
made a mistake as is evident from the attached jpg file:

% ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
                 --pidfile --detach
i.e. added the % sign before the command, but then corrected and i guess the commands executed fine. I gave the 1st command without the  --private-key, --certificate, and --bootstrap-ca-cert.
Then gave:
% ovs-vsctl --no-wait init
and  % ovs-vswitchd --pidfile --detach
these too went well. From: 
http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowOVS/DesignSetup
and http://docs.openstack.org/havana/install-guide/install/yum/content/install-neutron.install-plug-in.ovs.html
i gave:
# ovs-vsctl add-br br-int
  • sudo ifconfig eth2 0
  • sudo ifconfig eth3 0
leaving eth0 intact

this went well... Next comes the trouble:

#ovs-vsctl add-br br0 
or
#ovs-vsctl add-br br1

gives errors like:

ovs-vsctl: Error detected while setting up 'br0'. See ovs-vswitchd log for details

and

sudo ovs-vsctl list-ports br0

gives

ovs-vsctl: no bridge named br0


1) why is it not allowing to add bridges like br0, br1 etc?
2) the sequence of commands is ok?
3) From the screen shot attached it looks that after removing the % sign the commands executed fine. Am i right about that?
says the next step about pointing the switch to a controller (or as in my case pointing the switches - i.e switches for 3 lans where each of the 3 switches have ovs installed, pointing these switches to the controller), 
so that necessarily means that there needs to be a controller in place.. a controller could be located in the same physical node as that in which a switch resides.
And since i am thinking about working with pox, then i need to have a pox controller written and ready before i can execute that step-- right?


Thanks & Regards
Sanghamitra
pre_config.jpg

Eric Eide

unread,
Mar 8, 2015, 8:19:21 PM3/8/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> i gave:
> # ovs-vsctl add-br br-int
> * sudo ifconfig eth2 0
> * sudo ifconfig eth3 0
> leaving eth0 intact
> this went well... Next comes the trouble:
> #ovs-vsctl add-br br0
> or
> #ovs-vsctl add-br br1
> gives errors like:
> ovs-vsctl: Error detected while setting up 'br0'. See ovs-vswitchd log for
> details

I don't what the problem would be. What does the log file say?

In answering this email, I ran a quick little Emulab experiment in which I
installed OVS 2.3.0 from source, started it up according to the process
described at this web site (and mentioned in previous emails in this forum):

https://github.com/openvswitch/ovs/blob/master/INSTALL.md#startup

And then I was able to create multiple bridges without problems:

# ovs-vsctl add-br br-int
# ovs-vsctl add-br br0
# ovs-vsctl add-br br1
# ovs-vsctl list-br
br-int
br0
br1

I guess that you'll have to look at the ovs-swicthd log file to get more
information about why OVS doesn't want to set up multiple bridges for you.

> 4) one more thing: the link:
> http://groups.geni.net/geni/wiki/GENIExperimenter/Tutorials/OpenFlowOVS/DesignSetup
> says the next step about pointing the switch to a controller (or as in my
> case pointing the switches - i.e switches for 3 lans where each of the 3
> switches have ovs installed, pointing these switches to the controller), so
> that necessarily means that there needs to be a controller in place.. a
> controller could be located in the same physical node as that in which a
> switch resides. And since i am thinking about working with pox, then i need
> to have a pox controller written and ready before i can execute that step--
> right?

Yes.

Eric Eide

unread,
Mar 8, 2015, 8:23:55 PM3/8/15
to Emulab Users Mailing List
Eric Eide <ee...@cs.utah.edu> writes:

> I don't what the problem would be. What does the log file say?

Oops, that should say: "I don't *know* what the problem would be."
Sorry if that was confusing!

Sanghamitra De

unread,
Mar 9, 2015, 6:59:38 AM3/9/15
to emulab...@googlegroups.com
No that was not confusing. And Yes I'll re-run the commands and let You know about the log file results.
 
Thanks & Regards
Sanghamitra
 

 

Sanghamitra De

unread,
Mar 9, 2015, 3:32:37 PM3/9/15
to emulab...@googlegroups.com
Hi,
I ran the same set of commands:

1) Command Results:

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.0/vswitchd/vswitch.ovsschema

# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \

                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \

                 --private-key=db:Open_vSwitch,SSL,private_key \

                 --certificate=db:Open_vSwitch,SSL,certificate \

                 --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \

                 --pidfile --detach

  # ovs-vsctl --no-wait init

 # ovs-vswitchd --pidfile --detach

# ovs-vsctl add-br br-int
  • sudo ifconfig eth2 0
  • sudo ifconfig eth3 0

 # ovs-vsctl add-br br-int


        # ovs-vsctl add-br br0
        # ovs-vsctl add-br br1
        # ovs-vsctl list-br
        br-int
        br0
        br1


In, fact preconfig2.jpeg shows that # ovs-vsctl list-br gives: 

        br-int
        br0
        br1

But error messages such as:
#ovs-vsctl add-br br1

ovs-vsctl: Error detected while setting up 'br0'. See ovs-vswitchd log for details

keep continuing..


2) Log file:  ovs-vswitchd.log

Instead of ovs-vswitchd.log the Console Log file is attached.

Isn't the following command supposed to create a log file such as: /var/log/openvswitch/ovs-vswitchd.log

#ovs-switchd --log-file --pidfile --detach 



Couldn't find the log file in the location i.e.: /var/log/openvswitch/ovs-vswitchd.log.

am i giving the wrong command/searching in the wrong directory/both??

Thanks & Regards
Sanghamitra
Console log for pc316.docx
preconfig2.jpg

Eric Eide

unread,
Mar 15, 2015, 6:15:47 PM3/15/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> 1) Command Results:
> [...]
> # ovs-vswitchd --pidfile --detach

Don't forget the --log-file option!

> But error messages such as:
> #ovs-vsctl add-br br1
> ovs-vsctl: Error detected while setting up 'br0'. See ovs-vswitchd log for
> details
> keep continuing..

I don't know what would cause this; I'm sorry.

> 2) Log file: ovs-vswitchd.log
> Instead of ovs-vswitchd.log the Console Log file is attached.

I'm sorry, but the console log is not helpful for diagnosing this OVS
configuration problem.

> Isn't the following command supposed to create a log file such as:
> /var/log/openvswitch/ovs-vswitchd.log
>
> #ovs-switchd --log-file --pidfile --detach

Your log file might be: /usr/local/var/log/openvswitch/ovs-vswicthd.log

When I run the "ovs-switchd" command line above (for OVS built from source), I
see the following output (note the first line of output):

% sudo ovs-vswitchd --pidfile --detach --log-file
2015-03-15T22:00:31Z|00001|vlog|INFO|opened log file /usr/local/var/log/openvswitch/ovs-vswitchd.log
2015-03-15T22:00:31Z|00002|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock: connecting...
2015-03-15T22:00:31Z|00003|reconnect|INFO|unix:/usr/local/var/run/openvswitch/db.sock: connected

Best wishes ---

Eric.

Sanghamitra De

unread,
Mar 16, 2015, 4:09:14 AM3/16/15
to emulab...@googlegroups.com
Thank You. I would re-check with the log file option and follow up with the log file and the errors that would crop up there.
 
Please let me know if someone (friend/friend's friend/any fellow researcher) could get me started with 'pox controllers working in Emulab environment'. While POX commands are decipherable to some extent.. Im in a soup regarding how POX controllers would control the switches and manage the OVS commands in Emulab.
 
With that and the configuration of the OVS (ongoing), I would probably, finally, arrive at the activity of framing the start script for the entire experimental setup
 
And the website for CloudLab is a wonderful effort, providing a platform to all researchers to bring forth their ideas and work on results. Thank You Team Emulab.
 
Regards & Best Wishes
sanghamitra
 
 

 

Sanghamitra De

unread,
Mar 19, 2015, 11:28:22 AM3/19/15
to emulab...@googlegroups.com
On trying to open the /usr/local/var/log/openvswitch/ovs-vswicthd.log using:
vi /usr/local/var/log/openvswitch/ovs-vswicthd.log

gives result like the access_log.jpg attached.

& on giving the log file option as: sudo ovs-vswitchd --pidfile --detach --log-file

it does open a logfile and then aborts the process running the log file!!! (as can be seen from log.jpg)

but could not see the contents of the logfile as is evident from access_log.jpg


The following continues but without the log file..

 # ovs-vsctl add-br br-int
        # ovs-vsctl add-br br0


ovs-vsctl: Error detected while setting up 'br0'. See ovs-vswitchd log for details


        # ovs-vsctl add-br br1


ovs-vsctl: Error detected while setting up 'br1'. See ovs-vswitchd log for details


        # ovs-vsctl list-br
        br-int
        br0
        br1



How do i proceed?

Thanks & Regards
Sanghamitra




access_log.jpg
log.jpg

Sanghamitra De

unread,
Mar 26, 2015, 1:15:38 PM3/26/15
to emulab...@googlegroups.com
My bad for trying it with vi pathname filename !!! 


the log file screenshot is attached.

the errors continue on trying the following lines:



#ovs-vsctl add-br br-int
ovs-vsctl: Error detected while setting up 'br-int'. See ovs-vswitchd log for details

# ovs-vsctl add-br br0

ovs-vsctl: Error detected while setting up 'br0'. See ovs-vswitchd log for details


# ovs-vsctl add-br br1

ovs-vsctl: Error detected while setting up 'br1'. See ovs-vswitchd log for details



why is there problem while trying to create br-int or br0, br1 for that matter?



Thanks & Regards

Sanghamitra

log1.jpg
log2.jpg

Sanghamitra De

unread,
Mar 26, 2015, 1:32:58 PM3/26/15
to emulab...@googlegroups.com
Also, can anyone suggest a controller to me apart from pox. A controller with which i could get help from emulab members if i got stuck. i.e. Something which has been used in emulab environment.

Thanks & Regards
Sanghamitra

Anand

unread,
Mar 26, 2015, 1:47:59 PM3/26/15
to emulab...@googlegroups.com
Hi,
Could you please send email to openvswitch mailing
bu...@openvswitch.org ? Here is the link
http://openvswitch.org/mlists/. The reason I'm saying is most of your
questions are specific to Openvswitch.

Thanks,
Anand
> You received this message because you are subscribed to the Google Groups
> "emulab-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Sanghamitra De

unread,
Mar 27, 2015, 2:32:28 AM3/27/15
to emulab...@googlegroups.com
Yes I did send the questions to bu...@openvswitch.org
Thank You.

Eric Eide

unread,
Apr 4, 2015, 5:30:09 PM4/4/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> On trying to open the /usr/local/var/log/openvswitch/ovs-vswicthd.log using:
> vi /usr/local/var/log/openvswitch/ovs-vswicthd.log
> gives result like the access_log.jpg attached.

Since you followed-up to this message, I guess you found the reason for the
behavior you were seeing. Yep, vi tries to warn you when out open a single
file in more than one editor process at a time.

Eric.

PS --- Sorry for the lateness of this reply; I've been busy for the past while!

Eric Eide

unread,
Apr 4, 2015, 5:44:50 PM4/4/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> #ovs-vsctl add-br br-int
> ovs-vsctl: Error detected while setting up 'br-int'. See ovs-vswitchd log for
> details

From the logs you sent, my guess about the cause if the problem is this: the
Open vSwitch kernel module is probably not loaded.

In the "log1" screen shot that you sent, around the middle, the log says:

> ...|ERR|Generic Netlink family 'ovs_datapath' does not exist. The
> Open vSwitch kernel module is probably not loaded.

Try loading the kernel module before invoking any of the OVS command-line
programs. See this web page, under "Building the Sources," step #5:

https://github.com/openvswitch/ovs/blob/master/INSTALL.md#building-the-sources

Good luck! ---

Eric Eide

unread,
Apr 4, 2015, 5:49:34 PM4/4/15
to Emulab Users Mailing List
Sanghamitra De <sangham...@gmail.com> writes:

> Also, can anyone suggest a controller to me apart from pox. A controller with
> which i could get help from emulab members if i got stuck. i.e. Something
> which has been used in emulab environment.

Sorry, I don't have any advice to offer here.

Eric Eide

unread,
Apr 4, 2015, 5:54:21 PM4/4/15
to Emulab Users Mailing List
> Since you followed-up to this message, I guess you found the reason for the
> behavior you were seeing. Yep, vi tries to warn you when out open a single
> file in more than one editor process at a time.

Whoops, confusing typos, sorry.

I meant: "vi tries to warn you when *you* open a single file in more than one
editor..."

Eric Eide

unread,
Apr 4, 2015, 5:55:19 PM4/4/15
to Emulab Users Mailing List
Eric Eide <ee...@cs.utah.edu> writes:

>>From the logs you sent, my guess about the cause if the problem is this: the

Apparently I cannot type today :-).

I meant: "my guess about the cause *of* the problem is this..."

Sanghamitra De

unread,
Apr 5, 2015, 1:05:24 PM4/5/15
to emulab...@googlegroups.com
Thank You for the email. I am going to try it again this time keeping in mind step 5 of the link:


i hope it gets solved... I will let you know how this goes.


Meanwhile i came across Ryu. POX and Ryu are both python based. OpenDaylight is also a popular choice. But I'm just wondering which one would be a good option... keeping in mind that i'm going to use the controller with Emulab nodes and in case there are similar installation issues atleast someone who has worked with any one controller in emulab environment (i.e. familiar with any one of the controllers) can help with suggestions.



PS: No problem with the typos. Thank You once again.

Regards & Best Wishes
Sanghamitra

Sanghamitra De

unread,
Apr 5, 2015, 2:12:43 PM4/5/15
to emulab...@googlegroups.com
I tried the following:

wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz 
tar zxf openvswitch-2.3.0.tar.gz 
cd openvswitch-2.3.0 
./configure 
make 
sudo make install

make modules_install

sudo /sbin/modprobe openvswitch

 

 

/sbin/lsmod



/sbin/lsmod shows openvswitch was indeed installed. No errors were resulted by running:


sudo /sbin/modprobe openvswitch



BUT... 


make modules_install


gives something like:


Nothing to be done for 'modules-install'



As per step 5 of :  https://github.com/openvswitch/ovs/blob/master/INSTALL.md#building-the-sources


as per this link: If the modprobe operation fails, look at the last few kernel log messages (e.g. with dmesg | tail):


I checked kern.log and it said something about : module verification failed: signature &/or required key missing- tainting kernel

dmesg log gives:

init: failed to obtain startpar-bridge instance: Unknown parameter: INSTANCE


On trying to run:

/sbin/modinfo openvswitch.ko
modinfo: ERROR: Module openvswitch.ko not found
/sbin/rmmod bridge  gives:
Module bridge is not currently loaded
So something is wrong-- the modules dont get loaded/installed properly though the sequence of instructions are more or less the same. Does this mean that OVS does not support this configuration and that it was built for a different module than the one it is being tried on? How may i solve  this?
Thanks & Regards
Sanghamitra

Niky Riga

unread,
Apr 5, 2015, 2:40:25 PM4/5/15
to emulab...@googlegroups.com
Hi Sanghamitra, 

When I tried to build OVS 2.31 in Ubuntu 14.04 the one difference that I see is in the configure step 
You have to specify that you want to build the kernel modules:
./configure --with-linux=/lib/modules/`uname -r`/build
This might fix your problem. 

BTW, I don't know if there is a way to use an image available in the GENI-land through NS files,
 but the information of the image that I built is:
"urn": "urn:publicid:IDN+geni.it.cornell.edu+image+ch-geni-net:UBUNTU14OVS231noconf"   

Best, 
Niky

Niky Riga

unread,
Apr 5, 2015, 2:50:51 PM4/5/15
to emulab...@googlegroups.com
Most of the controller frameworks have their own support mailing lists. 
E.g. the one for pox is: 

It is true that pox is not actively developed, although there is still traffic
in the mailing list. 

Another python OF controller framework is Ryu: 
The mailing list seems to have a lot of traffic, which 
means that there is probably a lot of community support:

If you don't mind using Java then Floodlight is actively developed and supported
by the community: 
Mailing list: 

Best, 
Niky

Sanghamitra De

unread,
Apr 6, 2015, 11:34:54 AM4/6/15
to emulab...@googlegroups.com, nr...@bbn.com
Hi Niky,


the following did fix the problem

./configure --with-linux=/lib/modules/`uname -r`/build

the command sequence worked well uptill:

sudo mkdir /work 
cd /work 

## Download, configure, compile, and install Open vSwitch. 
wget 
http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz 


tar zxf openvswitch-2.3.0.tar.gz 
cd openvswitch-2.3.0 

./configure --with-linux=/lib/modules/`uname -r`/build

make modules_install

sudo /sbin/modprobe openvswitch

 

 /sbin/lsmod



## Clean up. 
cd / 
sudo rm -rf /work 


used Emulab web interface to make a disk image and loaded the same

apt-get install openvswitch-switch

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.0/vswitchd/vswitch.ovsschema

# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \

                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \

                 --pidfile --detach

ovs-vsctl --no-wait init
sudo ovs-vswitchd --pidfile --detach --log-file
sudo ovs-vsctl add-br OVSbr1
sudo ovs-vsctl add-br OVSbr2
sudo ifconfig eth1 0
sudo ifconfig eth2 0
sudo ovs-vsctl add-port OVSbr1 eth1
sudo ovs-vsctl add-port OVSbr2 eth2
sudo ovs-vsctl show


however the command sequence gave minor hiccups at 2 places as : (see screenshot err attached)

1st place:

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.0/vswitchd/vswitch.ovsschema

2nd place:

# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \

                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \

                 --pidfile --detach





I hope things have gone well because the remaining commands took well... but was wondering why the above two commands threw errors!!!


Kindly confirm that OVS-2.3.0 atlast got installed and that now configuration for creating bridges and stuff can be indeed proceeded with. See the till_done screenshot to see the next commands did ok.

Kindly confirm if indeed ovs got installed properly. Also why did those 2 commands throw error?!! 

Thank You once again.
Regards & Best Wishes
Sanghamitra

--
err.jpg
till_done.jpg

Niky Riga

unread,
Apr 6, 2015, 11:52:43 AM4/6/15
to Sanghamitra De, emulab...@googlegroups.com
Hi,

The problem is this step:

apt-get install openvswitch-switch

This will install OVS 2.02 and then on top of that you
are trying to install and enable OVS 2.3.0 that is why you
get the error since there is already an ovsdb-server running.

And if you see in the till_done screenshot  at the end it says
ovs_version 2.0.2. You just have to decide which OVS
version you want:
  * 2.0.2 you can directly install the package with apt-get
  * 2.3.0 you have to download the tar and compile it etc.

BTW you should probably use 2.3.1 instead of 2.3.0 since
it is the current Long term supported release.

Best,
Niky
April 6, 2015 at 11:34 AM
April 5, 2015 at 2:50 PM

Sanghamitra De

unread,
Apr 6, 2015, 12:41:14 PM4/6/15
to Niky Riga, emulab...@googlegroups.com
Hi,
Thanks!! So if i install version 2.3.1 and eliminate that step it would be ok? I think Im gonna do that and report back.

Thanks & Best Wishes
Sanghamitra

Sanghamitra De

unread,
Apr 6, 2015, 1:42:59 PM4/6/15
to Niky Riga, emulab...@googlegroups.com
Hi Niky,

I ran the following commands which went fine:

sudo mkdir /work 
cd /work 

wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz 
tar zxf openvswitch-2.3.1.tar.gz 
cd openvswitch-2.3.1 

./configure --with-linux=/lib/modules/`uname -r`/build

sudo make modules_install

sudo /sbin/modprobe openvswitch

 

/sbin/lsmod

cd / 
sudo rm -rf /work 


Then logged out and used Emulab web interface to make a disk image

but the following commands for configuring ovs throw error as per the attached screenshot. What to do?

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema

# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \

                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \

                 --pidfile --detach



Do i move straight over to execute the following sequence without executing the above 2 commands which give error:

ovs-vsctl --no-wait init
sudo ovs-vswitchd --pidfile --detach --log-file
sudo ovs-vsctl add-br OVSbr1
sudo ovs-vsctl add-br OVSbr2
sudo ifconfig eth2 0
sudo ifconfig eth3 0
sudo ovs-vsctl add-port OVSbr1 eth2
sudo ovs-vsctl add-port OVSbr2 eth3
sudo ovs-vsctl show


What to do?

And many many thanks for the suggestions-- i did move over to OVS-2.3.1 which overcomes the issues present with 2.3.0 version.


Regards & Best Wishes
Sanghamitra
error.jpg

Niky Riga

unread,
Apr 6, 2015, 2:03:10 PM4/6/15
to Sanghamitra De, emulab...@googlegroups.com
Hi Sunghamitra,

Someone with better knowledge of linux kernel modules should chime in here, but I believe that
when you load modules manually to the kernel, they do not survive reboots and most definitely they
do not survive image snapshots.

I am probably not the best person to give you advice on that, but I can probably give you some options:

   1. save the kernel modules in a place that will be included in the snapshot, e.g. /usr/local/etc/
       and then write an install script to load these modules and run any necessary commands
       when the node boots

    2. Make debian packages out of the source and install the packages, before you take a snapshot.
        This is what I did to create the image in the GENI land. Unfortunately my documentation is not great on this
        but I can tell you approximately what i did and if you look a the README file that comes with
        OVS, you might be able to figure it out:
        I ran these commands while under the openvswitch-2.3.1 directory  and without running
        the make install steps:
       
sudo apt-get -y install graphviz      
sudo apt-get install build-essential fakeroot
dpkg-checkbuilddeps
sudo apt-get install python-all python-qt4 python-zopeinterface python-twisted-conch
fakeroot debian/rules binary
dpkg-checkbuilddeps
make distclean
fakeroot debian/rules binary
      Then I reserved a new node with Ubuntu 14.04 and transferred the .deb packages to the new node.
This is where my notes are not great
     
      I think I installed all the dependencies first:
sudo apt-get install graphviz python-all python-qt4 python-zopeinterface python-twisted-conch
        and I believe that I installed these
packages in this order:
  • openvswitch-datapath-module-3.13.0-33-generic_2.3.1-1_amd64.deb
  • openvswitch-common_2.3.1-1_amd64.deb
  • openvswitch-switch_2.3.1-1_amd64.deb
        Note that the package names might be different depending on the kernel you are running.
        Here is where you probably want to check with the documentation that comes with OVS, to double check
        that the above packages are the right ones.
        To install one package you can do it with:
         sudo dpkg -i <pkg_name>

          Check that ovs-vsctl works, if it does you can take a snapshot no problem.

Good luck,
Niky
April 6, 2015 at 1:42 PM
April 6, 2015 at 12:41 PM
Hi,
Thanks!! So if i install version 2.3.1 and eliminate that step it would be ok? I think Im gonna do that and report back.

Thanks & Best Wishes
Sanghamitra


April 6, 2015 at 11:52 AM

Sanghamitra De

unread,
Apr 7, 2015, 11:26:22 AM4/7/15
to Niky Riga, emulab...@googlegroups.com
Hi Niky,
I went through the README file that comes with OVS-2.3.1. It says that the main components of this distribution are: ovs-vswitchd, ovsdb-server, ovs-dpctl and scripts and specs for building RPMs for Citrix XenServer & RHEL.

That should mean that these components get installed when i run the following command sequence:

sudo mkdir /work 
cd /work 

wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz 
tar zxf openvswitch-2.3.1.tar.gz 
cd openvswitch-2.3.1 

./configure --with-linux=/lib/modules/`uname -r`/build

sudo make modules_install

sudo /sbin/modprobe openvswitch

 

/sbin/lsmod

cd / 
sudo rm -rf /work 


After this i have used the Emulab web interface to make the disc image and load it in select nodes.


Niky, if the above command set is ok. then will You send me the command set which is required for configuring OVS-2.3.1 loaded on a node with preinstalled with Ubuntu 14.04 LTS 64 bit?


I have gone through the notes that You have sent...


save the kernel modules.... and then write an install script to load these modules.

Make debian packages out of the source and install the packages"--- these do not sound easy


I'm really sorry to ask but could you just (like you listed out command sequence about how you installed them in GENI) provide me the command sequence which need to be run after the above sequence (in blue) has been run? 


If the above sequence in blue is not what should be done then can you provide me both command sequences-- ie the sequence required before creating the disc image and the sequence after the disc image is created (i.e the one to configure OVS).


Its just that I've been struggling with this installation... for so long... this seems like a never ending struggle. I'm not even through with the installation and configuration.. i dont know if i'll be getting my experiments started any time soon....



Thank You

Sanghamitra



Niky Riga

unread,
Apr 7, 2015, 11:59:02 AM4/7/15
to Sanghamitra De, emulab...@googlegroups.com
Since I have not used the kernel modules to install but I have made the packages and install those.

However I see that you are missing some steps from the installation instructions:
https://github.com/openvswitch/ovs/blob/master/INSTALL.md

You are basically missing steps 1-4.

So maybe (but don't use this as a reference use the OVS installation
guide since it is bound to be more complete and correct)


sudo mkdir /work 
cd /work 

wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz 
tar zxf openvswitch-2.3.1.tar.gz 
cd openvswitch-2.3.1 

./configure --with-linux=/lib/modules/`uname -r`/build


sudo make
sudo make install

sudo make modules_install

sudo /sbin/modprobe openvswitch

/sbin/lsmod

 
sudo make
sudo make install

After that try to start the ovs service and see if that works. If it does try taking an image and use that. If that does not
work you might have to go down the package road.

I am sorry you are having troubles with installing OVS, it can be a tricky process that is why I suggested if you
could use the image made in the GENI side to make this easier.

Good luck,
Niky


April 7, 2015 at 11:26 AM
Hi Niky,
I went through the README file that comes with OVS-2.3.1. It says that the main components of this distribution are: ovs-vswitchd, ovsdb-server, ovs-dpctl and scripts and specs for building RPMs for Citrix XenServer & RHEL.

That should mean that these components get installed when i run the following command sequence:

sudo mkdir /work 
cd /work 

wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz 
tar zxf openvswitch-2.3.1.tar.gz 
cd openvswitch-2.3.1 

./configure --with-linux=/lib/modules/`uname -r`/build

sudo make modules_install

sudo /sbin/modprobe openvswitch

 

/sbin/lsmod

cd / 
sudo rm -rf /work 


After this i have used the Emulab web interface to make the disc image and load it in select nodes.


Niky, if the above command set is ok. then will You send me the command set which is required for configuring OVS-2.3.1 loaded on a node with preinstalled with Ubuntu 14.04 LTS 64 bit?


I have gone through the notes that You have sent...


save the kernel modules.... and then write an install script to load these modules.

Make debian packages out of the source and install the packages"--- these do not sound easy


I'm really sorry to ask but could you just (like you listed out command sequence about how you installed them in GENI) provide me the command sequence which need to be run after the above sequence (in blue) has been run? 


If the above sequence in blue is not what should be done then can you provide me both command sequences-- ie the sequence required before creating the disc image and the sequence after the disc image is created (i.e the one to configure OVS).


Its just that I've been struggling with this installation... for so long... this seems like a never ending struggle. I'm not even through with the installation and configuration.. i dont know if i'll be getting my experiments started any time soon....



Thank You

Sanghamitra





April 6, 2015 at 2:03 PM

Sanghamitra De

unread,
Apr 14, 2015, 2:02:20 PM4/14/15
to emulab...@googlegroups.com, Niky Riga
Hi,
I ran the command sequence as:

sudo mkdir /work 
cd /work 
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz 
tar zxf openvswitch-2.3.1.tar.gz 
cd openvswitch-2.3.1 
./configure --with-linux=/lib/modules/`uname -r`/build
make
make install
sudo make modules_install
sudo /sbin/modprobe openvswitch
 
/sbin/lsmod
cd / 
sudo rm -rf /work 
 
After that the disc image was used to load into other nodes.

and then from one of the nodes i was going to try the following sequence:

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema
# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ --pidfile --detach
 
ovs-vsctl --no-wait init
sudo ovs-vswitchd --pidfile --detach --log-file
sudo ovs-vsctl add-br OVSbr1
sudo ovs-vsctl add-br OVSbr2
sudo ifconfig eth2 0
sudo ifconfig eth3 0
sudo ovs-vsctl add-port OVSbr1 eth2
sudo ovs-vsctl add-port OVSbr2 eth3
sudo ovs-vsctl show


but on giving the very first command in the sequence it throws an error like the one showed in the screenshot attached.

It seems the file openvswitch-2.3.1 is not present inside /users/peertest/

this was not happening earlier..... 
 I added 'make' and 'make install' along with 'make modules_install'
as per suggestions received after i send querries to: bu...@openvswitch.org


anything else that i should have added?


Thanks & Regards
Sanghamitra
er1.jpg

Niky Riga

unread,
Apr 14, 2015, 3:06:10 PM4/14/15
to Sanghamitra De, emulab...@googlegroups.com
I am not sure about your setup but the instructions that come with OVS:
https://github.com/openvswitch/ovs/blob/master/INSTALL.md
Say to run:
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

Note that there is another command before that. I would suggest following the instructions
on the above file carefully. OVS comes with pretty good documentation.

Good luck,
Niky
April 14, 2015 at 2:02 PM
April 7, 2015 at 11:58 AM

Sanghamitra De

unread,
Apr 15, 2015, 4:45:11 AM4/15/15
to Niky Riga, emulab...@googlegroups.com

I tried the command along with the other command immediately before it:

% mkdir -p /usr/local/etc/openvswitch
% ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

and it gives an error saying=>  
ovsdb-tool: failed to read schema: "vswitchd/vswitch.ovsschema" could not be
read as JSON (error opening "vswitchd/vswitch.ovsschema" : No such file or
directory)

I recalled that  the "vswitchd/vswitch.ovsschema" file is found in the OVS source tree.  So, either i need to issue the "ovsdb-tool" command from the root directory of my  OVS source tree, or name the file via an absolute filename.

So i tried it with:

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema

but that too didin't work... Isn't the source tree or the absolute pathname supposed to be : /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema 

Also, when i did sudo rm -rf /work i guess i removed the source package along with /work

what to do now?


Niky Riga

unread,
Apr 15, 2015, 8:31:41 AM4/15/15
to Sanghamitra De, emulab...@googlegroups.com
Unfortunately I don't know what is wrong with your setup. I just reserved an Ubuntu 14 node and went
through the steps and it just worked for me. I also paste here the history of the commands I ran.

Cheers,
niky

     sudo apt-get update

     sudo apt-get -y install graphviz
     wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
     tar xvfz openvswitch-2.3.1.tar.gz
      cd openvswitch-2.3.1/
      ./boot.sh
      ./configure --with-linux=/lib/modules/`uname -r`/build
      make
      sudo make install
      sudo make modules_install
     sudo /sbin/modprobe openvswitch
     /sbin/lsmod
     sudo mkdir -p /usr/local/etc/openvswitch
     sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
     sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock                  --remote=db:Open_vSwitch,Open_vSwitch,manager_options                  --private-key=db:Open_vSwitch,SSL,private_key                  --certificate=db:Open_vSwitch,SSL,certificate                  --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert                  --pidfile --detach
     sudo ovs-vsctl --no-wait init
     sudo ovs-vswitchd --pidfile --detach
     sudo ovs-vsctl add-br br0
  


April 15, 2015 at 4:45 AM

I tried the command along with the other command immediately before it:

% mkdir -p /usr/local/etc/openvswitch
% ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

and it gives an error saying=>  
ovsdb-tool: failed to read schema: "vswitchd/vswitch.ovsschema" could not be
read as JSON (error opening "vswitchd/vswitch.ovsschema" : No such file or
directory)

I recalled that  the "vswitchd/vswitch.ovsschema" file is found in the OVS source tree.  So, either i need to issue the "ovsdb-tool" command from the root directory of my  OVS source tree, or name the file via an absolute filename.

So i tried it with:

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema

but that too didin't work... Isn't the source tree or the absolute pathname supposed to be : /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema 

Also, when i did sudo rm -rf /work i guess i removed the source package along with /work

what to do now?




April 14, 2015 at 3:06 PM
I am not sure about your setup but the instructions that come with OVS:
https://github.com/openvswitch/ovs/blob/master/INSTALL.md
Say to run:
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

Note that there is another command before that. I would suggest following the instructions
on the above file carefully. OVS comes with pretty good documentation.

Good luck,
Niky
--
You received this message because you are subscribed to a topic in the Google Groups "emulab-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emulab-users/xU2m6C9LaKE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emulab-users...@googlegroups.com.
To post to this group, send email to emulab...@googlegroups.com.
Visit this group at http://groups.google.com/group/emulab-users.
For more options, visit https://groups.google.com/d/optout.

Sanghamitra De

unread,
Apr 15, 2015, 2:40:58 PM4/15/15
to Niky Riga, emulab...@googlegroups.com
Hi,
I tried the commands as send by you:

     sudo apt-get update
     sudo apt-get -y install graphviz
     wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
     tar xvfz openvswitch-2.3.1.tar.gz 
      cd openvswitch-2.3.1/
      ./boot.sh
      ./configure --with-linux=/lib/modules/`uname -r`/build
      make
      sudo make install
      sudo make modules_install
     sudo /sbin/modprobe openvswitch
     /sbin/lsmod
     sudo mkdir -p /usr/local/etc/openvswitch
     sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
     sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock                  --remote=db:Open_vSwitch,Open_vSwitch,manager_options                  --private-key=db:Open_vSwitch,SSL,private_key                  --certificate=db:Open_vSwitch,SSL,certificate                  --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert                  --pidfile --detach
     sudo ovs-vsctl --no-wait init
     sudo ovs-vswitchd --pidfile --detach
     sudo ovs-vsctl add-br br0




2 changes made only: 

had to give: 

#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema

else it was giving error. The above command ran ok.


2nd change:

gave the partial command only:

# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \

                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \

                 --pidfile --detach

This also ran fine

sudo ovs-vsctl add-br br0
 command gives error as per the attached screenshot of logfile.


Is it a must to give the full command (the one for which i didnt give the pvt key & ssl certificate options)-- else there's a p[roblem with the data path?

I still cant seem to figure out what the issue is-- i ran the commands as above


Thanks
Sanghamitra
er3.jpg

Niky Riga

unread,
Apr 15, 2015, 2:49:41 PM4/15/15
to Sanghamitra De, emulab...@googlegroups.com
if instead of a screenshot you said a copy of all the commands you run in that terminal since you logged in
in  a text file, that would be more useful.

I do not know what are the side effects of not running the command as listed in the
INSTALL file ovs-discuss is probably a better forum for this question.

Best,
Niky

April 15, 2015 at 2:40 PM
April 15, 2015 at 8:31 AM
Unfortunately I don't know what is wrong with your setup. I just reserved an Ubuntu 14 node and went
through the steps and it just worked for me. I also paste here the history of the commands I ran.

Cheers,
niky

     sudo apt-get update
     sudo apt-get -y install graphviz
     wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
     tar xvfz openvswitch-2.3.1.tar.gz
      cd openvswitch-2.3.1/
      ./boot.sh
      ./configure --with-linux=/lib/modules/`uname -r`/build
      make
      sudo make install
      sudo make modules_install
     sudo /sbin/modprobe openvswitch
     /sbin/lsmod
     sudo mkdir -p /usr/local/etc/openvswitch
     sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
     sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock                  --remote=db:Open_vSwitch,Open_vSwitch,manager_options                  --private-key=db:Open_vSwitch,SSL,private_key                  --certificate=db:Open_vSwitch,SSL,certificate                  --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert                  --pidfile --detach
     sudo ovs-vsctl --no-wait init
     sudo ovs-vswitchd --pidfile --detach
     sudo ovs-vsctl add-br br0
  


Niky Riga

unread,
Apr 16, 2015, 8:00:08 AM4/16/15
to Sanghamitra De, emulab...@googlegroups.com
Hi,

If you are still having problems installing OVS 2.3.1, then maybe you want to use the OVS image
that is already built for Ubuntu 14.04:
https://www.emulab.net/showimageid.php3?imageid=4620

--niky

April 15, 2015 at 2:40 PM
April 15, 2015 at 8:31 AM
Unfortunately I don't know what is wrong with your setup. I just reserved an Ubuntu 14 node and went
through the steps and it just worked for me. I also paste here the history of the commands I ran.

Cheers,
niky

     sudo apt-get update
     sudo apt-get -y install graphviz
     wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
     tar xvfz openvswitch-2.3.1.tar.gz
      cd openvswitch-2.3.1/
      ./boot.sh
      ./configure --with-linux=/lib/modules/`uname -r`/build
      make
      sudo make install
      sudo make modules_install
     sudo /sbin/modprobe openvswitch
     /sbin/lsmod
     sudo mkdir -p /usr/local/etc/openvswitch
     sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
     sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock                  --remote=db:Open_vSwitch,Open_vSwitch,manager_options                  --private-key=db:Open_vSwitch,SSL,private_key                  --certificate=db:Open_vSwitch,SSL,certificate                  --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert                  --pidfile --detach
     sudo ovs-vsctl --no-wait init
     sudo ovs-vswitchd --pidfile --detach
     sudo ovs-vsctl add-br br0
  


Sanghamitra De

unread,
Apr 16, 2015, 11:50:17 AM4/16/15
to Niky Riga, emulab...@googlegroups.com
Hi,
Thank You for the image id. I will certainly use it. Very kind of You.

But its unfortunate i couldnt make an installation.....


The commands i had run are as follows:

I log into a node say node1. In this the following commands are run:
  sudo apt-get update
     sudo apt-get -y install graphviz
     wget 
http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
     tar xvfz openvswitch-2.3.1.tar.gz 
      cd openvswitch-2.3.1/
      ./boot.sh
      ./configure --with-linux=/lib/modules/`uname -r`/build
      make
      sudo make install
      sudo make modules_install
     sudo /sbin/modprobe openvswitch
     /sbin/lsmod
Then I create a disk image using Emulab web interface of node 1. 
The following image is created: https://www.emulab.net/showimageid.php3?imageid=4643
Then the .ns file for the expt. is modified, so that some of the nodes are loaded with this image. After that login to node 1 and run the following commands:

     sudo mkdir -p /usr/local/etc/openvswitch
     sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
the last command gives:
ovsdb-tool: failed to read schema: “vswitchd/vswitch.ovsschema” could not be read as JSON (error opening “vswitchd/vswitch.ovsschema”: No such file or directory)
So I make a little change and instead give the command:
#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /users/peertest/openvswitch-2.3.1/vswitchd/vswitch.ovsschema
This executed fine. Then the following commands are given:

# ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \

                 --remote=db:Open_vSwitch,Open_vSwitch,manager_options \

                 --pidfile --detach

     sudo ovs-vsctl --no-wait init

     sudo ovs-vswitchd --pidfile --detach
     sudo ovs-vsctl add-br br0
last line gives following error:
ovs-vsctl: Error detected while setting up ‘br0’. See ovs-vswitchd log for details
Then following commands are issued:
sudo ovs-vswitchd --pidfile --detach --log-file
cat /usr/local/var/log/openvswitch/ovs-vswitchd.log
     sudo ovs-vsctl add-br br0
ovs-vsctl: cannot create a bridge named br0 because a bridge named br0 already exists.
sudo ovs-vsctl show
gives :
f2cac22c-1ea1-4f04-921b-522097ccae1c
    Bridge “br0”
            Port “br0”
                   Interface “br0”
                           type: internal


I still cant figure out if i managed to get OVS-2.3.1  installed or not.... check out the different responses:


ovs-vsctl: Error detected while setting up ‘br0’. See ovs-vswitchd log for details
& later
ovs-vsctl: cannot create a bridge named br0 because a bridge named br0 already exists.

I wonder what is going wrong...


Thank You once again.
Sanghamitra

Reply all
Reply to author
Forward
0 new messages