cloud-init not setting mac address for bond or bridge in bionic

Bug #1784699 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Scott Moser

Bug Description

When deploying bionic, cloud-init doesn't set the mac address for the bond or bridge interface, which causes issues when there's expectations between MAC/IP mappings.

For example, in Bionic:

curtin config sent (/etc/cloud/cloud.cfg.d/50-curtin-networking.cfg): http://paste.ubuntu.com/p/25GnQXQVhn/
neplan config written to netplan (/etc/netplan/50-cloud-init.cfg): http://paste.ubuntu.com/p/XGQRzjGTDm/

The result is that each interface have a different MAC address from those told in the configuration:

ip addr sh: http://paste.ubuntu.com/p/25GnQXQVhn/

This results in inconsistency which was configured and intended by the user, vs what it was actually written.

For example, in Xenial, the issue above doesn't exist and the result is as expected:

curtin config: http://paste.ubuntu.com/p/DmFvryXdwm/
e/n/i config: http://paste.ubuntu.com/p/fsXYpmMzCb/
ip addr sh: http://paste.ubuntu.com/p/wXXSTNfwHK/

Also note that in my configuration, I kept the same mac addresses for bridges/bond as the physical interfaces, but if I were to randomize those or choose other ones, the behavior is the same.

Related branches

description: updated
Chad Smith (chad.smith)
Changed in cloud-init:
assignee: nobody → Scott Moser (smoser)
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

Trivially reproducible with the example below.

$ cat mybond.yaml
# LP: #1784699
network:
  config:
  - id: enp2s0
    mac_address: 00:e0:81:d1:b1:48
    mtu: 1500
    name: enp2s0
    subnets:
    - type: manual
    type: physical
  - id: enp3s0
    mac_address: 00:e0:81:d1:b1:47
    mtu: 1500
    name: enp3s0
    subnets:
    - type: manual
    type: physical
  - bond_interfaces:
    - enp2s0
    - enp3s0
    id: bond0
    mac_address: 00:e0:81:d1:b1:47
    mtu: 1500
    name: bond0
    params:
      bond-downdelay: 0
      bond-miimon: 100
      bond-mode: active-backup
      bond-num-grat-arp: 1
      bond-updelay: 0
      bond-xmit-hash-policy: layer2
    type: bond
    subnets:
    - address: 10.245.143.229/21
      gateway: 10.245.136.1
      type: static
  version: 1

$ python3 -m cloudinit.cmd.devel.net_convert --output-kind=netplan --directory=out.d --network-data=mybond.yaml --kind=yaml
Read input format 'yaml' from 'mybond.yaml'.
Wrote output format 'netplan' to 'out.d/'

$ cat out.d/etc/netplan/50-cloud-init.yaml

network:
    version: 2
    ethernets:
        enp2s0:
            match:
                macaddress: 00:e0:81:d1:b1:48
            mtu: 1500
            set-name: enp2s0
        enp3s0:
            match:
                macaddress: 00:e0:81:d1:b1:47
            mtu: 1500
            set-name: enp3s0
    bonds:
        bond0:
            addresses:
            - 10.245.143.229/21
            gateway4: 10.245.136.1
            interfaces:
            - enp2s0
            - enp3s0
            mtu: 1500
            parameters:
                down-delay: 0
                gratuitious-arp: 1
                mii-monitor-interval: 100
                mode: active-backup
                transmit-hash-policy: layer2
                up-delay: 0

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit 41f508da to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=41f508da

Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in cloud-init version 18.4.

This bug is believed to be fixed in cloud-init in version 18.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.