Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

bonding netdev options not respected #298

Closed
popsikle opened this issue Mar 5, 2015 · 5 comments
Closed

bonding netdev options not respected #298

popsikle opened this issue Mar 5, 2015 · 5 comments

Comments

@popsikle
Copy link

popsikle commented Mar 5, 2015

When setting LACP via a bond unit the bonding module is loaded with the default mode (round-robin) and not the mode specified in the unit file.

unit file:

    - name: 30-bond0.netdev
      content: |
        [NetDev]
        Name=bond0
        Kind=bond

        [Bond]
        Mode=802.3ad
        LACPTransmitRate=fast
        MIIMonitorSec=1s
        UpDelaySec=3s
        DownDelaySec=9s
    - name: 31-eno3.network
      content: |
        [Match]
        Name=eno3

        [Network]
        Bond=bond0
        DHCP=none
    - name: 32-eno4.network
      content: |
        [Match]
        Name=eno4

        [Network]
        Bond=bond0
        DHCP=none

Bond status:

wp-cos-001 ~ # cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eno4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 0c:c4:7a:0b:9f:b9
Slave queue ID: 0

Slave Interface: eno3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 0c:c4:7a:0b:9f:b8
Slave queue ID: 0

Setting the module options via write-files does however enable me to use lacp:

write_files:
  - path: /etc/modprobe.d/bonding.conf
    permissions: 0644
    owner: root
    content: |
      options bonding miimon=100 mode=4 lacp_rate=1
  - path: /etc/modules-load.d/bonding.conf
    permissions: 0644
    owner: root
    content: |
      bonding
wp-cos-001 ~ # cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: fast
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
    Aggregator ID: 1
    Number of ports: 2
    Actor Key: 17
    Partner Key: 1
    Partner Mac Address: 84:b5:9c:8f:97:80

Slave Interface: eno4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 0c:c4:7a:0b:9f:b9
Aggregator ID: 1
Slave queue ID: 0

Slave Interface: eno3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 0c:c4:7a:0b:9f:b8
Aggregator ID: 1
Slave queue ID: 0
@popsikle
Copy link
Author

Also, bug #36 affects this setup as well, you need a reboot after the unit files are dropped in for the bond to start.

@crawford
Copy link
Contributor

This is a limitation of our current initialization setup. In order to do this with coreos-cloudinit you'll need to apply the config, stop networkd, take down all interfaces, and then start networkd. It's a pain. We are working on a much better solution.

@ibukanov
Copy link

If the configs comes from a local filesystem, then https://github.com/coreos/coreos-cloudinit/issues/343 should address this.

@jumanjiman
Copy link

When setting LACP via a bond unit the bonding module is loaded with the default mode (round-robin) and not the mode specified in the unit file.

this is because you're configuring bond0, and...

  • kernel automatically creates bond0 with default options as soon as the bonding module is loaded
  • systemd refuses to alter options of existing bond0 netdev

We just resolved a similar issue by adding to our cloud-config:

#cloud-config

write_files:
  - path: /etc/modprobe.d/bonding.conf
    content: |
      # systemd-networkd won't change bond options (such as mode) if the bond already exists [1].
      # This is confusing if we want to configure a bond0 since the kernel
      # automatically creates a bond0 netdev as soon as the bonding module is loaded.
      # This means systemd-networkd won't apply our preferred config.
      #
      # Therefore prevent the kernel from automatically creating a bond0 interface [2].
      # This allows systemd-networkd to create the bond0 with appropriate options.
      #
      # [1] https://bugzilla.redhat.com/show_bug.cgi?id=1119347
      # [2] http://lists.freedesktop.org/archives/systemd-devel/2015-March/029041.html
      #
      options bonding max_bonds=0

hth!

@crawford
Copy link
Contributor

Can this be closed? It looks like you have a solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants