I am very sorry I was not signed up on the dev mailing-list, just following it from the archives so I couldn't reply to the previous email I was referencing the patch I attached at the end of this email. There was an on list discussion about how it was not working on Ubuntu, if you replace the allow-ovs stanza with auto it will work fine, I think that this is an issue with ubuntu's customization to network-manager, it will ignore interfaces that are defined as auto. > What is "the failsafe boot delay"? > > > Upstart wants to know the pid of the daemons so running ovs-ctl will > > be a challenge without getting deep into the code. > > The pids are available in the .pid files.diff --git a/debian/ifupdown.sh > b/debian/ifupdown.sh
The limitation is upstart, it can only track one or two additional forks deep and it wants to own the pid tracking. If you have your hosts interface on a ovs interface the init script will not start soon enough, in the script /etc/init/failsafe.conf they call /bin/plymouth --ping. If that fails they call sleep for about 120 seconds, by using upstart and bringing ovs up earlier it prevents this. legacy init scripts are called after "(filesystem and static-network-up) or failsafe-boot" so the /bin/plymouth --ping command in failsafe-boot will always fail. new file mode 100755 index 0000000..ea36a0d --- /dev/null +++ b/debian/ifupdown.sh @@ -0,0 +1,87 @@ +#! /bin/sh +# Copyright (c) 2012 Nicira, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Have a look at /usr/share/doc/openvswitch-switch/README.Debian +# for more information about configuring the /etc/network/interfaces. + +if [ -z "${IF_OVS_TYPE}" ]; then + exit 0 +fi + +ovs_vsctl() { + ovs-vsctl --no-wait --timeout=5 "$@" +} + +if (ovs_vsctl --version) > /dev/null 2>&1; then :; else + exit 0 +fi + +if [ "${MODE}" = "start" ]; then + eval OVS_EXTRA=\"${IF_OVS_EXTRA}\" + + case "${IF_OVS_TYPE}" in + OVSBridge) + ovs_vsctl -- --may-exist add-br "${IFACE}" ${IF_OVS_OPTIONS}\ + ${OVS_EXTRA+-- $OVS_EXTRA} + + if [ ! -z "${IF_OVS_PORTS}" ]; then + ifup --allow="${IFACE}" ${IF_OVS_PORTS} + fi + ;; + OVSPort) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} \ + ${OVS_EXTRA+-- $OVS_EXTRA} + + ifconfig "${IFACE}" up + ;; + OVSIntPort) + ovs_vsctl -- --may-exist add-port "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_OPTIONS} -- set Interface "${IFACE}"\ + type=internal ${OVS_EXTRA+-- $OVS_EXTRA} + + ifconfig "${IFACE}" up + ;; + OVSBond) + ovs_vsctl -- --fake-iface add-bond "${IF_OVS_BRIDGE}"\ + "${IFACE}" ${IF_OVS_BONDS} ${IF_OVS_OPTIONS} \ + ${OVS_EXTRA+-- $OVS_EXTRA} + + ifconfig "${IFACE}" up + ;; + *) + exit 0 + ;; + esac +elif [ "${MODE}" = "stop" ]; then + case "${IF_OVS_TYPE}" in + OVSBridge) + if [ ! -z "${IF_OVS_PORTS}" ]; then + ifdown --allow="${IFACE}" ${IF_OVS_PORTS} + fi + + ovs_vsctl -- --if-exists del-br "${IFACE}" + ;; + OVSPort|OVSIntPort|OVSBond) + ovs_vsctl -- --if-exists del-port "${IF_OVS_BRIDGE}" "${IFACE}" + ;; + *) + exit 0 + ;; + esac +fi + +exit 0 diff --git a/debian/openvswitch-switch.README.Debian b/debian/openvswitch-switch.README.Debian index ef92d3e..8580451 100644 --- a/debian/openvswitch-switch.README.Debian +++ b/debian/openvswitch-switch.README.Debian @@ -14,3 +14,120 @@ README.Debian for openvswitch-switch switch implementation. -- Ben Pfaff , Mon, 30 Aug 2010 09:51:19 -0700 + +Debian network scripts integration +---------------------------------- +This package lets a user to optionally configure Open vSwitch bridges +and ports from /etc/network/interfaces. Please refer to the interfaces(5) +manpage for more details regarding /etc/network/interfaces. + +The stanzas that configure the OVS bridges should begin with "allow-ovs" +followed by name of the bridge. Here is an example. +allow-ovs br0 + +The stanzas that configure the OVS ports should begin with +"allow-${bridge-name}" followed by name of the port. Here is an example. +allow-br0 eth0 + +The following OVS specific "command" options are supported: + + - ovs_type: This can either be OVSBridge, OVSPort, OVSIntPort or OVSBond + depending on whether you configure a bridge, port, an internal port or + a bond. This is a required option. + + - ovs_ports: This option specifies all the ports that belong to a bridge. + + - ovs_bridge: This options specifies a bridge to which a port belongs. + This is a required option for a port. + + - ovs_bonds: This option specifies the list of physical interfaces to be + bonded together. + + - ovs_options: This option lets you add extra arguments to a ovs-vsctl + command. See examples. + + - ovs_extra: This option lets you run additional ovs-vsctl commands, + separated by "--" (double dash). Variables can be part of the "ovs_extra" + option. You can provide all the standard environmental variables + described in the interfaces(5) man page. You can also pass shell + commands. + +More implementation specific details can be seen in the examples. + +Examples: +-------- +ex 1: A standalone bridge. + +allow-ovs br0 +iface br0 inet static + address 192.168.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + +ex 2: A bridge with one port. + +allow-ovs br0 +iface br0 inet dhcp + ovs_type OVSBridge + ovs_ports eth0 + +allow-br0 eth0 +iface eth0 inet manual + ovs_bridge br0 + ovs_type OVSPort + +ex 3: A bridge with multiple physical ports. + +allow-ovs br0 +iface br0 inet dhcp + ovs_type OVSBridge + ovs_ports eth0 eth1 + +allow-br0 eth0 +iface eth0 inet manual + ovs_bridge br0 + ovs_type OVSPort + +allow-br0 eth1 +iface eth1 inet manual + ovs_bridge br0 + ovs_type OVSPort + +ex 4: A bridge with an OVS internal port. + +allow-ovs br1 +iface br1 inet static + address 192.168.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + ovs_ports vlan100 + +allow-br1 vlan100 +iface vlan100 inet manual + ovs_bridge br1 + ovs_type OVSIntPort + ovs_options tag=100 + ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s) + +ex 5: Bonding. + +allow-ovs br2 +iface br2 inet static + address 192.170.1.1 + netmask 255.255.255.0 + ovs_type OVSBridge + ovs_ports bond0 + +allow-br2 bond0 +iface bond0 inet manual + ovs_bridge br2 + ovs_type OVSBond + ovs_bonds eth2 eth3 + ovs_options bond_mode=balance-tcp lacp=active + +ex 6: Create and destroy bridges. + +ifup --allow=ovs $list_of_bridges +ifdown --allow=ovs $list_of_bridges + +-- Gurucharan Shetty , Fri, 04 May 2012 12:58:19 -0700 diff --git a/debian/openvswitch-switch.install b/debian/openvswitch-switch.install index 557429b..4d7a15b 100644 --- a/debian/openvswitch-switch.install +++ b/debian/openvswitch-switch.install @@ -11,3 +11,4 @@ usr/share/openvswitch/scripts/ovs-ctl usr/share/openvswitch/scripts/ovs-lib usr/share/openvswitch/scripts/ovs-save usr/share/openvswitch/vswitch.ovsschema +debian/ifupdown.sh usr/share/openvswitch/scripts diff --git a/debian/openvswitch-switch.postinst b/debian/openvswitch-switch.postinst index 7b9d7bc..22ce434 100755 --- a/debian/openvswitch-switch.postinst +++ b/debian/openvswitch-switch.postinst @@ -33,6 +33,11 @@ case "$1" in fi done fi + + ln -s /usr/share/openvswitch/scripts/ifupdown.sh \ + /etc/network/if-pre-up.d/openvswitch || true + ln -s /usr/share/openvswitch/scripts/ifupdown.sh \ + /etc/network/if-post-down.d/openvswitch || true ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/openvswitch-switch.postrm b/debian/openvswitch-switch.postrm index baf37c8..ab963e2 100755 --- a/debian/openvswitch-switch.postrm +++ b/debian/openvswitch-switch.postrm @@ -26,6 +26,8 @@ case "$1" in rm -f /etc/default/openvswitch-switch rm -f /var/log/openvswitch/ovs-vswitchd.log* || true rm -f /var/log/openvswitch/ovsdb-server.log* || true + rm -f /etc/network/if-pre-up.d/openvswitch || true + rm -f /etc/network/if-post-down.d/openvswitch || true ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) -- 1.7.2.5 > Date: Mon, 7 May 2012 09:14:26 -0700 > From: [email protected] > To: [email protected] > CC: [email protected] > Subject: Re: [ovs-dev] [PATCH] debian: Add network integration scripts. > > On Sun, May 06, 2012 at 12:08:43AM -0700, Greg Dahlman wrote: > > I wrote a really quick and dirty upstart script to test this out on > > Ubuntu 12.04, it works very well but you need to use auto vs > > allow-ovs in the network file.I will work on getting this into the > > git repo after I test a bit and break out the functions but this > > script will get you going and help you avoid the failsafe boot > > delay. > > Is your message in reply to some other message? I don't understand > the context. > > What do you mean by "auto vs allow-ovs in the network file"? > > What is "the failsafe boot delay"? > > > Upstart wants to know the pid of the daemons so running ovs-ctl will > > be a challenge without getting deep into the code. > > The pids are available in the .pid files. _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
