cloud-init not setting mac address for bond or bridge in bionic
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/
neplan config written to netplan (/etc/netplan/
The result is that each interface have a different MAC address from those told in the configuration:
ip addr sh: http://
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://
e/n/i config: http://
ip addr sh: http://
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
- Scott Moser: Approve
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 799 lines (+496/-39)14 files modifiedbash_completion/cloud-init (+5/-2)
cloudinit/cmd/devel/net_convert.py (+23/-12)
cloudinit/cmd/devel/parser.py (+13/-7)
cloudinit/net/eni.py (+9/-2)
cloudinit/net/netplan.py (+4/-0)
cloudinit/sources/DataSourceOpenNebula.py (+1/-1)
config/cloud.cfg.tmpl (+0/-2)
debian/changelog (+14/-0)
doc/rtd/topics/debugging.rst (+1/-1)
tests/unittests/test_cli.py (+1/-2)
tests/unittests/test_datasource/test_opennebula.py (+406/-2)
tests/unittests/test_net.py (+6/-0)
tools/Z99-cloud-locale-test.sh (+8/-5)
tools/Z99-cloudinit-warnings.sh (+5/-3)
- Ryan Harper: Approve
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 96 lines (+19/-2)3 files modifiedcloudinit/net/eni.py (+9/-2)
cloudinit/net/netplan.py (+4/-0)
tests/unittests/test_net.py (+6/-0)
description: | updated |
Changed in cloud-init: | |
assignee: | nobody → Scott Moser (smoser) |
status: | New → In Progress |
importance: | Undecided → Medium |
Trivially reproducible with the example below.
$ cat mybond.yaml downdelay: 0 num-grat- arp: 1 xmit-hash- policy: layer2
# 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-
bond-miimon: 100
bond-mode: active-backup
bond-
bond-updelay: 0
bond-
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:
macaddress: 00:e0:81:d1:b1:48
set- name: enp2s0
macaddress: 00:e0:81:d1:b1:47
set- name: enp3s0
addresses:
gateway4: 10.245.136.1
interfaces :
parameters :
down- delay: 0
gratuitious- arp: 1
mii-monitor- interval: 100
mode: active-backup
transmit- hash-policy: layer2
up-delay: 0
version: 2
ethernets:
enp2s0:
match:
mtu: 1500
enp3s0:
match:
mtu: 1500
bonds:
bond0:
- 10.245.143.229/21
- enp2s0
- enp3s0
mtu: 1500