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

Bug #1784699 reported by Andres Rodriguez
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
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):
neplan config written to netplan (/etc/netplan/50-cloud-init.cfg):

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

ip addr sh:

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:
e/n/i config:
ip addr sh:

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
  - id: enp2s0
    mac_address: 00:e0:81:d1:b1:48
    mtu: 1500
    name: enp2s0
    - type: manual
    type: physical
  - id: enp3s0
    mac_address: 00:e0:81:d1:b1:47
    mtu: 1500
    name: enp3s0
    - type: manual
    type: physical
  - bond_interfaces:
    - enp2s0
    - enp3s0
    id: bond0
    mac_address: 00:e0:81:d1:b1:47
    mtu: 1500
    name: bond0
      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
    - address:
      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

    version: 2
                macaddress: 00:e0:81:d1:b1:48
            mtu: 1500
            set-name: enp2s0
                macaddress: 00:e0:81:d1:b1:47
            mtu: 1500
            set-name: enp3s0
            - enp2s0
            - enp3s0
            mtu: 1500
                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:

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.