brctl is obsolete use ip

Bug #1801919 reported by Attila Fazekas
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned
devstack
Fix Released
Undecided
Nate Johnston
neutron
Fix Released
Medium
Brian Haley
os-vif
Fix Committed
High
sean mooney

Bug Description

bridge-utils (brctl) is obsolete, no modern software should depend on it.
Used in: neutron/agent/linux/bridge_lib.py

http://man7.org/linux/man-pages/man8/brctl.8.html

Please use `ip` for basic bridge operations,
than we can drop one obsolete dependency..

Revision history for this message
Brian Haley (brian-haley) wrote :

We should just skip right over using 'ip' and use pyroute2 so this can all be done in privsep, it seems to have the support for it.

tags: added: linuxbridge
Changed in neutron:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Attila Fazekas (afazekas) wrote :

Adding nova, nova also using brctl for example in the NeutronLinuxBridgeInterfaceDriver ,

yes, pyroute2 might be an alternative to the ip commands as well, however the
bridge create/enslave is not most documented part.

Revision history for this message
Matt Riedemann (mriedem) wrote :

I don't see where NeutronLinuxBridgeInterfaceDriver is used in nova anymore...

Revision history for this message
Matt Riedemann (mriedem) wrote :

LinuxBridgeInterfaceDriver is still using brctl but that's only used for nova-network which is itself deprecated, so I don't think we probably need to worry about removing that specifically since all of that code will be dropped when we drop nova-network, which should hopefully be in the Train release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/616995

Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/617354

Changed in devstack:
assignee: nobody → Nate Johnston (nate-johnston)
status: New → In Progress
Revision history for this message
Brian Haley (brian-haley) wrote :

Seeing the Fedora 28 and other releases don't seem to be supporting this I've bumped the priority so we get to this sooner.

Changed in neutron:
importance: Wishlist → Low
importance: Low → Medium
assignee: nobody → Brian Haley (brian-haley)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/617836

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/617836
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2572c158f5290ddc3bc2e4f06ecbd4768c82eee4
Submitter: Zuul
Branch: master

commit 2572c158f5290ddc3bc2e4f06ecbd4768c82eee4
Author: Brian Haley <email address hidden>
Date: Tue Nov 13 15:54:29 2018 -0500

    Change to use iproute2 instead of brctl

    brctl is being deprecated in some Linux distros, so
    change neutron to start using iproute2 commands or
    the pyroute2 library where possible.

    Added create() to IpLinkCommand class to allow usage
    of pyroute2 for bridge creation.

    Change-Id: If679e79fa3242ee1cd8610b5525deca35b41c87e
    Closes-bug: #1801919

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/616995
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e92ecd3a428f7ac6ab2ecf613f796e22fa3f6199
Submitter: Zuul
Branch: master

commit e92ecd3a428f7ac6ab2ecf613f796e22fa3f6199
Author: Matt Riedemann <email address hidden>
Date: Fri Nov 9 11:52:21 2018 -0500

    Delete NeutronLinuxBridgeInterfaceDriver

    This is a really old carryover from when neutron was
    quantum and the virt drivers would plug/unplug using
    the driver defined by the linuxnet_interface_driver
    config option, which is deprecated and only used for
    nova-network now. We use os-vif now for plugging and
    unplugging bridge VIFs with neutron so this old
    unused driver code can be removed. It wasn't even
    tested.

    Change-Id: I07f25685e4fb650c22838bc3afab2bb40809e438
    Related-Bug: #1801919

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.0.0.0b1 development milestone.

Changed in os-vif:
status: New → Confirmed
assignee: nobody → sean mooney (sean-k-mooney)
importance: Undecided → High
Revision history for this message
sean mooney (sean-k-mooney) wrote :

os-vif uses brctl in both its linuxbridge plugin and in the ovs plugin when hybrid_plug=true e.g. when the ip tables security group driver is used.

i have triaged it as high due to the non-client lib freeze

tags: added: ovs
Revision history for this message
Matt Riedemann (mriedem) wrote :

Feb 28 is the non-client library freeze for the Stein release so yeah you're going to need to work on this pretty fast if you want to get it in and also have some buffer time for any regressions to get fixed.

Revision history for this message
sean mooney (sean-k-mooney) wrote :

quick update.

looking at the usage more closely i belive i only need to replace 3 fuctions in os-vif

ensure_bridge which has 2 parallel implementations across the ovs and linux bridge plugin
in the ovs plugin i also need to replace delete_bridge and add_bridge_port.

i will refactor these into a shared implementation in os-vif internal ip_lib module
an replace the brctl usage with pyroute2 versions. the windows version of these
fuctions will be a noop.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-vif (master)

Fix proposed to branch: master
Review: https://review.openstack.org/636821

Changed in os-vif:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/636822

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-vif (master)

Reviewed: https://review.openstack.org/636821
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=5027ce833c6fccaa80b5ddc8544d262c0bf99dbd
Submitter: Zuul
Branch: master

commit 5027ce833c6fccaa80b5ddc8544d262c0bf99dbd
Author: Sean Mooney <email address hidden>
Date: Thu Feb 14 03:08:53 2019 +0000

    remove brctl from vif_plug_ovs

    - This change extends the ip_command interface set function
      to accept a master as a parent device for a given interface.
    - This change extends the impl_pyroute2 add function to
      support creating linux bridges.
    - This change replaces calls to brctl with calls to the ip_command api.
    - This change removes the use of tee to disable ipv6 in the ovs plugin.

    Change-Id: I8308e8840e20b0a72d00880c1a7996b4c73f6a83
    Partial-Bug: #1801919

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/636822
Committed: https://git.openstack.org/cgit/openstack/os-vif/commit/?id=1f6fed6a69e9fd386e421f3cacae97c11cdd7c75
Submitter: Zuul
Branch: master

commit 1f6fed6a69e9fd386e421f3cacae97c11cdd7c75
Author: Sean Mooney <email address hidden>
Date: Thu Feb 14 03:59:50 2019 +0000

    remove use of brctl from vif_plug_linux_bridge

    - This change replaces calls to brctl with calls
      to the ip_command interface.
    - This change adds a release note for the brctl
      removal.
    - This change removes the use of tee to disable
      ipv6 in the linux bridge plugin.

    Change-Id: Id03be72e22302a0954f3e47c116f389cb4304c03
    Closes-Bug: #1801919

Changed in os-vif:
status: In Progress → Fix Released
Revision history for this message
sean mooney (sean-k-mooney) wrote :

its not released yet but ill be releaseing os-vif today.
it looks like teh rule for setting fix released are wrong.
it sould only be set when we release that commit in a tagged release on pypi/
tarballs.openstack.org.

Changed in os-vif:
status: Fix Released → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-vif 1.15.0

This issue was fixed in the openstack/os-vif 1.15.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.openstack.org/617354
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=56946cfc5f88d8df3b4b9a1a2530ce2cc9a68cde
Submitter: Zuul
Branch: master

commit 56946cfc5f88d8df3b4b9a1a2530ce2cc9a68cde
Author: Nate Johnston <email address hidden>
Date: Mon Nov 12 11:17:07 2018 -0500

    Replace deprecated brctl with ip commands

    The bridge-utils package has been deprecated for some time now [1] and
    'brctl' does not exist on some more recent distros like Fedora 28.
    Replace references to brctl with the proper ip commands.

    Calls to "brctl show" are not being replaced with calls to "bridge link"
    because the output format is very different and in testing some bridges
    were not listed. So the simpler method of consulting /sys/class/net is
    used.

    In worlddump.py we try running both because failures are handled
    gracefully by _dump_cmd(), as well as "ip link show type bridge" for
    additional info.

    [1] https://lwn.net/Articles/703776/ for example

    Change-Id: Ie4c8ad6ce4a09c38023c9e4ec7834c249403145f
    Partial-Bug: #1801919

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to os-ken (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/703234

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to os-ken (master)

Reviewed: https://review.opendev.org/703234
Committed: https://git.openstack.org/cgit/openstack/os-ken/commit/?id=1f751b2d7d385a75d4255934694177d6fd6f012f
Submitter: Zuul
Branch: master

commit 1f751b2d7d385a75d4255934694177d6fd6f012f
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Sat Jan 18 12:17:35 2020 +0000

    Replace deprecated brctl with ip commands

    The bridge-utils package has been deprecated for some time now [1] and
    'brctl' does not exist on some more recent distros like Fedora 28.
    Replace references to brctl with the proper ip commands.

    Calls to "brctl show" are not being replaced with calls to "bridge link"
    because the output format is very different and in testing some bridges
    were not listed. So the simpler method of consulting /sys/class/net is
    used.

    [1] https://lwn.net/Articles/703776/ for example

    Change-Id: I8a4891bb7ed44dc25ba3f79d2ace6927313c17b3
    Related-Bug: #1801919

Revision history for this message
Martin Kopec (mkopec) wrote :

Marking this as fixed for devstack as "grep -r brctl" on master branch didn't return any results.

Changed in devstack:
status: In Progress → Fix Released
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.