Comment 1 for bug 1784699

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