netplan needs bridge port-priority support
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
nplan (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Artful |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
Users of netplan configuring any bridge. Port priority is a very common setting to change when setting up bridge devices that might have multiple interfaces.
[Test case]
1) Write a netplan configuration:
network:
version: 2
ethernets:
eth0:
match:
bridges:
br0:
- 192.168.14.2/24
- eth0
2) Run 'sudo netplan apply'
3) Validate that the config generated by netplan is correct:
In /run/systemd/
[...]
[Bridge]
[...]
Priority=14
4) Validate that the port-priority value for the bridge has been correctly set:
$ cat /sys/class/
[Regression potential]
This might impact STP behavior, such that while the port priority for a bridge changes, the general network topology might change -- this may lead to loss of connectivity on the bridge itself or on other devices on the network, invalid packet traffic (packets showing up where they should not), etc.
---
Now that systemd supports port-priority for bridges (LP: #1668347)
netplan should handle port-priority like it does path-cost.
1) % lsb_release -rd
Description: Ubuntu 16.04.3 LTS
Release: 16.04
1) # lsb_release -rd
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04
2) # apt-cache policy nplan
nplan:
Installed: 0.30
Candidate: 0.32
Version table:
0.32 500
500 http://
*** 0.30 100
100 /var/lib/
3) netplan generate renders a networkd .network file which has [Bridge] section including Priority value set on each of the bridge ports specified
4) netplan fails to parse the input yaml with
Sample config that should parse:
% cat br-pp.yaml
network:
version: 2
ethernets:
eth0:
match:
bridges:
br0:
- 192.168.14.2/24
- eth0
% netplan generate
Error in network definition br-pp.yaml line 13 column 16: unknown key port-priority
If fixed, then I would expect a /run/systemd/
[Match]
MACAddress=
Name=eth0
[Network]
Bridge=br0
LinkLocalAddres
IPv6AcceptRA=no
[Bridge]
Cost=50
Priority=14
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1738 lines (+1203/-66)27 files modifiedcloudinit/config/cc_puppet.py (+4/-4)
cloudinit/config/cc_snap.py (+273/-0)
cloudinit/config/cc_snap_config.py (+7/-0)
cloudinit/config/cc_snappy.py (+8/-0)
cloudinit/config/tests/test_snap.py (+535/-0)
cloudinit/net/cmdline.py (+22/-2)
cloudinit/net/netplan.py (+5/-5)
cloudinit/net/network_state.py (+1/-1)
cloudinit/tests/helpers.py (+13/-8)
cloudinit/util.py (+12/-1)
config/cloud.cfg.tmpl (+3/-2)
debian/changelog (+14/-0)
doc/rtd/conf.py (+1/-0)
doc/rtd/topics/modules.rst (+1/-0)
tests/cloud_tests/releases.yaml (+3/-0)
tests/cloud_tests/testcases.yaml (+3/-0)
tests/cloud_tests/testcases/__init__.py (+3/-0)
tests/cloud_tests/testcases/base.py (+168/-5)
tests/cloud_tests/testcases/main/command_output_simple.py (+2/-15)
tests/cloud_tests/testcases/modules/snap.py (+16/-0)
tests/cloud_tests/testcases/modules/snap.yaml (+18/-0)
tests/cloud_tests/testcases/modules/snappy.py (+2/-0)
tests/cloud_tests/verify.py (+7/-4)
tests/unittests/test_handler/test_handler_apt_source_v1.py (+2/-1)
tests/unittests/test_handler/test_schema.py (+1/-0)
tests/unittests/test_net.py (+46/-18)
tests/unittests/test_util.py (+33/-0)
- Scott Moser: Needs Fixing
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 49 lines (+9/-6)3 files modifiedcloudinit/net/netplan.py (+5/-5)
cloudinit/net/network_state.py (+1/-1)
tests/unittests/test_net.py (+3/-0)
description: | updated |
Changed in nplan (Ubuntu): | |
importance: | Undecided → Medium |
Changed in nplan (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in nplan (Ubuntu Artful): | |
importance: | Undecided → Medium |
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
Changed in nplan (Ubuntu): | |
assignee: | nobody → MOHAMMED FAHAD MUSHAHID (89mfahad) |
Changed in nplan (Ubuntu): | |
assignee: | MOHAMMED FAHAD MUSHAHID (89mfahad) → nobody |
Partial patch; implements networkd side, needs NetworkManager portion and additional unit and integration tests.