[ovs-discuss] Open-vswitch network configuration on Debian

Ben Pfaff blp at nicira.com
Mon Oct 24 18:20:52 UTC 2011


On Sat, Oct 22, 2011 at 10:50:11PM +0200, Hans van Kranenburg wrote:
> On 10/22/2011 01:54 AM, Ben Pfaff wrote:
> >On Thu, Oct 20, 2011 at 01:08:57PM +0200, Frank wrote:
> >>Is there a good way to with some kind of hook to add ip addresses to
> >>interfaces defined via ovs-vsctl and set interfaces links up?
> >
> >One way to do it would be to add a init script to run after
> >openvswitch-switch.
> >
> >udev is another way.
> >
> >I'm sure that there are still other ways, too.
> 
> I see openvswitch does not store/remember ip addressing, (default)
> route and interface administrative link states (up/down) in it's
> conf.db. This is by design, I suppose. When configuring a physical
> switch, you generally assign an ip address and default route to the
> management vlan on the switch for administrative access. Why doesn't
> ovs support this? Or am I missing something obvious?

I'm not entirely against doing something like this, but there are some
reasons why it isn't implemented.

First, we haven't yet internally had a use case for it.

Second, I'm concerned about synchronization issues.  For most
configuration in its database, OVS carefully applies that
configuration at startup, and then reapplies it whenever the database
changes.  That would cause any manual administrator changes (with
e.g. "ifconfig") to be wiped out.  That sounds like a huge problem to
me, because I don't think administrators really want to have to do all
their network configuration through ovs-vsctl or risk having it lost.

Third, it's easy enough to configure link states and IP addresses, but
the Linux network stack has tons of other state.  I don't really want
to get in a situation where OVS has to understand how to configure
every bit of that state.  It might easily be a slippery slope.

OVS actually comes with a script that you can use to save and restore
interface configuration, BTW.  It's not documented because it's
currently intended for internal use only by the "force-reload-kmod"
init script command, but it might solve your problem.  It's called
"ovs-save" and you can find it in the utilities/ directory in the
source distribution or usually in /usr/share/openvswitch/scripts in
an installation.  Here's what ovs-save --help prints:

    ovs-save: saves the kernel configuration of network interfaces
    usage: ../utilities/ovs-save NETDEV...

    Outputs a shell script on stdout that will restore the current
    kernel configuration of the specified network interfaces, as
    well as the system iptables configuration.

    This script is meant as a helper for the Open vSwitch init
    script "force-reload-kmod" command.

I hope that this goes some way toward answering your questions, even
if it isn't a direct answer.  Let's try to continue the
discussion--I'm willing to continue working toward getting OVS doing
what you expect, since your expectations on the face of them seem
reasonable.



More information about the discuss mailing list