add bond primary parameter

Bug #1709135 reported by Ryan Harper on 2017-08-07
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nplan (Ubuntu)
Status tracked in Artful
Xenial
High
Mathieu Trudel-Lapierre
Zesty
High
Mathieu Trudel-Lapierre
Artful
High
Mathieu Trudel-Lapierre
systemd (Ubuntu)
Status tracked in Artful
Xenial
Undecided
Dimitri John Ledkov
Zesty
Undecided
Unassigned
Artful
Undecided
Unassigned

Bug Description

[Impact]
Some complex bond configurations require setting a "primary" interface for the bond, or setting this greatly improves performance on the network bond.

[Test case]
See below for a configuration example.
1) Apply configuration on a system with netplan.
2) Run 'netplan apply'
3) Validate that netplan apply does not return with an error
4) Validate that netplan properly sets the "primary_slave" value on the bond. This can be verified by looking at /sys/class/net/<bond interface>/bonding/primary_slave.
5) Validate that there are no parsing errors from systemd-networkd in the journalctl

[Regression potential]
If existing configuration fails to be parsed, or lack of primary interface breaks configuration for existing bonds, this would be a regression caused by this update.

---

ifenslave/eni support a bond parameter: bond-primary which accepts an interface name that can be used to tell the kernel bonding driver which interface it should preferred in active-backup (and other modes). This config option is missing in netplan.

 % cat bond-primary.yaml
network:
  version: 2
  ethernets:
    eth0:
      match:
        driver: virtio
    ens4:
      match:
        driver: e1000
  bonds:
    bond0:
      parameters:
        mode: active-backup
        mii-monitor-interval: 100
        primary: e1000
      dhcp4: true

% ./generate -r `pwd`/target
Error in network definition /home/rharper/work/git/netplan/target//etc/netplan/bond-primary.yaml line 12 column 8: unknown key primary

Ryan Harper (raharper) wrote :

This maps to networkd Bond config parameter: PrimarySlave=

Steve Langasek (vorlon) on 2017-08-07
Changed in nplan (Ubuntu):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
importance: Undecided → High
milestone: none → ubuntu-17.08
status: New → Triaged

Sounds like we'd need to add a key under parameters: for the bond device, as per the original description (but the device needs to be listed in 'interfaces', and exist in the list of interfaces defined in netplan:

ethernets:
  version: 2
  ethernets:
    eth0:
      match:
        driver: virtio
    ens4:
      match:
        driver: e1000
  bonds:
    bond0:
      interfaces: [ eth0, ens4 ]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100
        primary: ens4
      dhcp4: true

This will require backporting the feature from systemd to the releases where we need this (to xenial).

Changed in systemd (Ubuntu Xenial):
status: New → Fix Released
status: Fix Released → New
Changed in systemd (Ubuntu Zesty):
status: New → Fix Released
Changed in systemd (Ubuntu Artful):
status: New → Fix Released
Changed in systemd (Ubuntu Xenial):
assignee: nobody → Dimitri John Ledkov (xnox)
Changed in nplan (Ubuntu Xenial):
status: New → Triaged
Changed in nplan (Ubuntu Zesty):
status: New → Triaged
importance: Undecided → High
Changed in nplan (Ubuntu Xenial):
importance: Undecided → High
Changed in nplan (Ubuntu Zesty):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in nplan (Ubuntu Xenial):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nplan - 0.26

---------------
nplan (0.26) artful; urgency=medium

  * Bonding:
    - Add support for specifying a primary slave. (LP: #1709135)
  * Rebind:
    - Fix brcmfmac harder. Treat any 'brcmfmac' driver as not supporting
      rebind. (LP: #1712224)
  * Autopkgtests:
    - Add allow-stderr. Systemd now bleats about a the networkd socket still
      being around and enabled when we restart the service; but we don't need
      to care since we're /restarting/ the service to load the new config.
    - Fix the autostart package to be more sensible: we don't really care if
      networkd autostarts or not, but we need to make sure that our generator
      will run at boot, so instead check the state, but only assert it once
      we've added a config file and before checking the state of our dummy
      device.
    - Do a bit more to make sure "mix" tests which stack virtual devices are
      as reliable as possible; by setting saner defaults.

 -- Mathieu Trudel-Lapierre <email address hidden> Wed, 23 Aug 2017 19:32:33 -0400

Changed in nplan (Ubuntu Artful):
status: Triaged → Fix Released
description: updated
Dimitri John Ledkov (xnox) wrote :
Changed in systemd (Ubuntu Zesty):
status: Fix Released → Triaged
Changed in systemd (Ubuntu Xenial):
status: New → Confirmed
Changed in systemd (Ubuntu Zesty):
status: Triaged → In Progress
description: updated

Hello Ryan, or anyone else affected,

Accepted systemd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/229-4ubuntu20 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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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 systemd (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-xenial
tags: added: id-5988c3a877d5e440aecf0c3a
tags: added: id-5988c348d036b6f6acb1e389
description: updated
Dimitri John Ledkov (xnox) wrote :

Installed nplan 0.29 from artful to get it process the test-case yaml, to then test networkd portion is working right.

Using:
# cat /etc/netplan/bond-primary.yaml
network:
  version: 2
  ethernets:
    eth0:
      match:
        name: eth0
    dummy0:
      match:
        driver: dummy
  bonds:
    bond0:
      interfaces: [eth0, dummy0]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100
        primary: eth0
      dhcp4: true

229-4ubuntu19
Oct 02 15:37:21 test-upgrade systemd-networkd[1773]: [/run/systemd/network/10-netplan-eth0.network:8] Unknown lvalue 'PrimarySlave' in section 'Network'
Oct 02 15:37:21 test-upgrade systemd-networkd[1773]: bond0: IPv6 enabled for interface: Success

229-4ubuntu20
Oct 02 15:39:22 test-upgrade systemd[1]: Starting Network Service...
Oct 02 15:39:22 test-upgrade systemd-networkd[3821]: bond0: IPv6 enabled for interface: Success
Oct 02 15:39:22 test-upgrade systemd-networkd[3821]: bond0: netdev ready
Oct 02 15:39:22 test-upgrade systemd-networkd[3821]: eth0: Gained IPv6LL
Oct 02 15:39:22 test-upgrade systemd-networkd[3821]: Enumeration completed
Oct 02 15:39:22 test-upgrade systemd[1]: Started Network Service.

All is good.

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Dimitri John Ledkov (xnox) wrote :

verification is done for the systemd portion of the bug.

Dimitri John Ledkov (xnox) wrote :

note that one cannot really use bond0 as it will be auto created and networkd may loose the race to configure it. it is safer to use bond1 until a bugfix is SRUed to set max_bond to zero by default.

pre-tested with artful's netplan on zesty with a backrported systemd.

Brian Murray (brian-murray) wrote :

Hello Ryan, or anyone else affected,

Accepted systemd into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/232-21ubuntu7 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 on 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-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. 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 systemd (Ubuntu Zesty):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-zesty
removed: verification-done
Brian Murray (brian-murray) wrote :

Hello Ryan, or anyone else affected,

Accepted nplan into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nplan/0.29~17.04.1 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 on 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-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. 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 nplan (Ubuntu Zesty):
status: Triaged → Fix Committed
Brian Murray (brian-murray) wrote :

Hello Ryan, or anyone else affected,

Accepted nplan into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nplan/0.29~16.04.1 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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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 nplan (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed-xenial
removed: verification-done-xenial
Dimitri John Ledkov (xnox) wrote :

# dpkg-query -W systemd nplan
nplan 0.23~16.04.1
systemd 229-4ubuntu19

# netplan generate
Error in network definition //etc/netplan/bond-primary.yaml line 13 column 8: unknown key primary

Enabled proposed, retweaked netplan to have correct interface names

# dpkg-query -W systemd nplan
nplan 0.29~16.04.1
systemd 229-4ubuntu20

root@srux:~# netplan generate
root@srux:~# echo $?
0

My current netplan is
$ cat /etc/netplan/bond.yaml
network:
  version: 2
  ethernets:
    ens7:
      match:
        name: ens7
    ens8:
      match:
        name: ens8
  bonds:
    bond1:
      interfaces: [ ens7, ens8 ]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100
        primary: ens8
      dhcp4: true

Active slave is ens8. Changing netplan primary to ens7, and re-running apply changes the active slave.

tags: added: verification-done-xenial
removed: verification-needed-xenial
Dimitri John Ledkov (xnox) wrote :

$ sudo netplan apply
Error in network definition //etc/netplan/bond.yaml line 13 column 8: unknown key primary

$ dpkg-query -W nplan systemd
nplan 0.23~17.04.1
systemd 232-21ubuntu5

$ sudo netplan apply
$ echo $?
0

$ dpkg-query -W systemd nplan
nplan 0.29~17.04.1
systemd 232-21ubuntu7

Bond is up, changing primary setting in netplan and executing apply, changes the active_slave.

tags: added: verification-done verification-done-zesty
removed: verification-needed verification-needed-zesty
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers