cloud-init v2 yaml doesn't preserve bond/bridge parameters when rendering

Bug #1709180 reported by Ryan Harper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned

Bug Description

cloud-init/master:

% cat bonding.yaml
network:
  version: 2
  ethernets:
    eth0:
      match:
        macaddress: 52:54:00:12:34:00
        driver: virtio
      set-name: eth0
    ens4:
      match:
        macaddress: 52:54:00:12:34:02
        driver: e1000
      set-name: ens4
  bonds:
    bond0:
      interfaces: [eth0, ens4]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100
      dhcp4: true

Should result in a netplan yaml of:

network:
    version: 2
    ethernets:
        ens4:
            match:
                macaddress: '52:54:00:12:34:02'
            set-name: ens4
        eth0:
            match:
                macaddress: '52:54:00:12:34:00'
            set-name: eth0
    bonds:
        bond0:
            dhcp4: true
            interfaces:
            - ens4
            - eth0
            parameters:
                mii-monitor-interval: 100
                mode: active-backup

Multiple issues:

1) the common bond/bridge handler needs to call the right _handle function depending on the command type (bond or bridge)

2) network_state needs to translate v2 'parameters' key to v1 since we utilize the v1 type handlers

3) the v2 handle_ethernets fails to set the v1 'mac_address' property which prevents v2 match/set-name from getting rendered

Related branches

Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 17.1

This bug is believed to be fixed in cloud-init in 17.1. 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: New → Fix Released
Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Medium
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.