ifupdown hook is missing in upstart script

Bug #1314887 reported by Hiroaki Kawai
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
openvswitch (Ubuntu)
Fix Released
High
Unassigned
Trusty
Fix Released
Medium
Unassigned

Bug Description

[Impact]

The documentation included in both upstream Open vSwitch (ovs) 2.0.2 and the version distributed by Ubuntu states that it supports configuring ovs using /etc/network/interfaces (see /usr/share/doc/openvswitch-switch/README.Debian). Moreover, /etc/init.d/openvswitch-switch contains the necessary logic to support parsing /etc/network/interfaces but that logic is completely missing in the Upstart /etc/init/openvswitch-switch.conf script.

The result of this issue is a user can properly configure their network in /etc/network/interfaces, test it with ifup/ifdown, reboot, and have no network configured with the machine comes back up. If the user is unaware that Upstart is being used and not classic init.d scripts, a manual call using /etc/init.d/openvswitch-switch works as expected. Without boot integration, users can't easily use Open vSwitch to configure their "main" interface and have a system work on boot.

The fix in this thread basically adds support for using the normal config files (/etc/network/interfaces and /etc/network/interfaces.d/*) to configure the network on boot.

[Test Case]

After running `apt-get install -y openvswitch-switch`, add a stanza to /etc/network/interfaces like the following:

allow-ovs br0
iface br0 inet static
    ovs_type OVSBridge
    address 172.16.0.1
    network 255.255.255.0

Try `ifup br0` and `ifdown br0` and notice how the interface is correctly controlled. Try `/etc/init.d/openvswitch-switch restart` and note how the interface comes up. Reboot the machine and note how br0 is not correctly configured.

[Regression Potential]

This problem is recognized by the user community (see http://www.opencloudblog.com/?p=240, http://blog.scottlowe.org/2012/08/17/installing-kvm-and-open-vswitch-on-ubuntu/, etc) and people have been manually patching their systems for years to get the desired capability. It's conceivable people's odd ways of fixing this problem could conflict with the potential patch. Double ifup'ing or ifdown'ing an interface shouldn't break any systems but error messages may be emitted.

The other unlikely issue is that users have interfaces correctly configured in /etc/network/interfaces and are deliberately depending on the interfaces *not* coming up on boot. This patch would cause these boot-dormant interfaces to come up unexpectedly but, again, I think this problem unlikely.

[Other Info]

This patch aligns the boot behavior both with what's expected and what the documentation states.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openvswitch (Ubuntu):
status: New → Confirmed
James Page (james-page)
Changed in openvswitch (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Brian Turek (brian-turek) wrote :

I can confirm this is still present in a fully patched 14.04.2 install and the proposed fix does work.

Revision history for this message
Brian Turek (brian-turek) wrote :

Following up on my previous comment, the propose fix actually causes the upstart script to fail to start if there are no OVS interfaces present (the ifup errors which I believe causes the pre-start script section to "error" which then causes upstart to kill the process). I submitted a bit longer fix at https://code.launchpad.net/~brian-turek/ubuntu/trusty/openvswitch/fix-for-1314887/+merge/261912

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

While vivid and wily are using systemd by default, upstart is still an option there. So this bug should first be fixed for wily before we can SRU to trusty.

I'm going to test the attached trivially ported debdiff and intend to push it if it doesn't seem to break anything. An extra set of eyes would be appreciated.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

It looks fine, but is there a particular reason why you run awk over /etc/network/interfaces by hand instead of using ifquery the way the sysvinit job does?

Revision history for this message
Brian Turek (brian-turek) wrote :

I realize it's a poor reason but I mimicked the network_interfaces function /etc/init.d/openvswitch-switch. Want me to switch it over to use ifquery?

Revision history for this message
Brian Turek (brian-turek) wrote :

Went ahead and created a new (and simpler) patch that uses ifquery. See attached

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "amended-fix-for-1314887.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openvswitch - 2.4.0-0ubuntu3

---------------
openvswitch (2.4.0-0ubuntu3) wily; urgency=medium

  [ Brian Turek ]
  * Add ifupdown hooks for upstart script. (LP: #1314887)

 -- Chris J Arges <email address hidden> Wed, 14 Oct 2015 13:51:13 -0500

Changed in openvswitch (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Arata Notsu (arata776) wrote :

If $BRIDGES is empty,

  [ $BRIDGES ] && ifup --allow ovs $BRIDGES

will result in rc=1 and it causes openvswitch-switch to fail to start.

Revision history for this message
Emilien Macchi (emilienm) wrote :

I confirm Arata's comment, OVS fails to start:

http://logs.openstack.org/82/235482/1/check/gate-puppet-openstack-integration-scenario002-dsvm-trusty/bd79764/logs/syslog.txt.gz#_Oct_15_16_48_29

2.4.0-0ubuntu3 looks like a broken release to us.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openvswitch (Ubuntu Trusty):
status: New → Confirmed
Revision history for this message
Arata Notsu (arata776) wrote :

This is a patch works for me

Revision history for this message
Chris J Arges (arges) wrote :

Uploaded this latest regression fix. Should be in 2.4.0-0ubuntu4.

James Page (james-page)
Changed in openvswitch (Ubuntu):
status: Fix Released → In Progress
importance: Medium → High
Changed in openvswitch (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openvswitch - 2.4.0-0ubuntu4

---------------
openvswitch (2.4.0-0ubuntu4) wily; urgency=medium

  [ Arata Notsu ]
  * Fix ifupdown hooks in cases where BRIDGE is not defined. (LP: #1314887)

 -- Chris J Arges <email address hidden> Thu, 15 Oct 2015 15:03:34 -0500

Changed in openvswitch (Ubuntu):
status: In Progress → Fix Released
Mathew Hodson (mhodson)
tags: added: trusty
Revision history for this message
Mathew Hodson (mhodson) wrote :

In order for this to be SRUed, it needs to be made compliant with https://wiki.ubuntu.com/StableReleaseUpdates (Please add a rational, test case, and regression potential to the description of this bug.)

Revision history for this message
Brian Turek (brian-turek) wrote :

[Impact]

The documentation included in both upstream Open vSwitch (ovs) 2.0.2 and the version distributed by Ubuntu states that it supports configuring ovs using /etc/network/interfaces (see /usr/share/doc/openvswitch-switch/README.Debian). Moreover, /etc/init.d/openvswitch-switch contains the necessary logic to support parsing /etc/network/interfaces but that logic is completely missing in the Upstart /etc/init/openvswitch-switch.conf script.

The result of this issue is a user can properly configure their network in /etc/network/interfaces, test it with ifup/ifdown, reboot, and have no network configured with the machine comes back up. If the user is unaware that Upstart is being used and not classic init.d scripts, a manual call using /etc/init.d/openvswitch-switch works as expected. Without boot integration, users can't easily use Open vSwitch to configure their "main" interface and have a system work on boot.

The fix in this thread basically adds support for using the normal config files (/etc/network/interfaces and /etc/network/interfaces.d/*) to configure the network on boot.

[Test Case]

After running `apt-get install -y openvswitch-switch`, add a stanza to /etc/network/interfaces like the following:

allow-ovs br0
iface br0 inet static
    ovs_type OVSBridge
    address 172.16.0.1
    network 255.255.255.0

Try `ifup br0` and `ifdown br0` and notice how the interface is correctly controlled. Try `/etc/init.d/openvswitch-switch restart` and note how the interface comes up. Reboot the machine and note how br0 is not correctly configured.

[Regression Potential]

This problem is recognized by the user community (see http://www.opencloudblog.com/?p=240, http://blog.scottlowe.org/2012/08/17/installing-kvm-and-open-vswitch-on-ubuntu/, etc) and people have been manually patching their systems for years to get the desired capability. It's conceivable people's odd ways of fixing this problem could conflict with the potential patch. Double ifup'ing or ifdown'ing an interface shouldn't break any systems but error messages may be emitted.

The other unlikely issue is that users have interfaces correctly configured in /etc/network/interfaces and are deliberately depending on the interfaces *not* coming up on boot. This patch would cause these boot-dormant interfaces to come up unexpectedly but, again, I think this problem unlikely.

[Other Info]

This patch aligns the boot behavior both with what's expected and what the documentation states.

Revision history for this message
Iain Lane (laney) wrote :

I merged the two wily uploads for this bug into the trusty package and uploaded them.

Thanks!

Changed in openvswitch (Ubuntu Trusty):
status: Confirmed → In Progress
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Hiroaki, or anyone else affected,

Accepted openvswitch into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/openvswitch/2.0.2-0ubuntu0.14.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in openvswitch (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Mathew Hodson (mhodson)
description: updated
Revision history for this message
Brian Turek (brian-turek) wrote :

I can confirm that openvswitch-switch 2.0.2-ubuntu0.14.04.3 fixes the problem on a fully patched Trusty box.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openvswitch - 2.0.2-0ubuntu0.14.04.3

---------------
openvswitch (2.0.2-0ubuntu0.14.04.3) trusty; urgency=medium

  [ Brian Turek ]
  * Add ifupdown hooks for upstart script. (LP: #1314887)

  [ Arata Notsu ]
  * Fix ifupdown hooks in cases where BRIDGE is not defined. (LP: #1314887)

 -- Iain Lane <email address hidden> Mon, 07 Dec 2015 11:41:51 +0000

Changed in openvswitch (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for openvswitch has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.