Even with the workaround it seems something seems racy, I got a correct run with:
"""
snap set system system.network.netplan.network.bridges.br54.dhcp4=true
ip link | MATCH br54
netplan get | MATCH br54
snap unset system system.network.netplan.network.bridges.br54
snap get -d system system.network.netplan | NOMATCH br54
ip link | NOMATCH br54
"""
but the next run failed with:
"""
+ snap unset system system.network.netplan.network.bridges.br54
+ NOMATCH br54
+ snap get -d system system.network.netplan
+ NOMATCH br54
+ ip link
NOMATCH pattern='br54' found in:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
3: br54: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether ae:7d:de:3b:89:05 brd ff:ff:ff:ff:ff:ff
"""
and manual running apply with debug yield no change:
"""
qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg# netplan get
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
[notice that br54 is gone here]
qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg# netplan --debug apply
** (generate:3926): DEBUG: 20:40:46.434: Processing input file /etc/netplan/00-snapd-config.yaml..
** (generate:3926): DEBUG: 20:40:46.435: starting new processing pass
** (generate:3926): DEBUG: 20:40:46.436: We have some netdefs, pass them through a final round of validation
** (generate:3926): DEBUG: 20:40:46.436: all-en: setting default backend to 1
** (generate:3926): DEBUG: 20:40:46.436: Configuration is valid
** (generate:3926): DEBUG: 20:40:46.436: all-eth: setting default backend to 1
** (generate:3926): DEBUG: 20:40:46.436: Configuration is valid
** (generate:3926): DEBUG: 20:40:46.437: Generating output files..
** (generate:3926): DEBUG: 20:40:46.437: openvswitch: definition all-en is not for us (backend 1)
** (generate:3926): DEBUG: 20:40:46.437: NetworkManager: definition all-en is not for us (backend 1)
** (generate:3926): DEBUG: 20:40:46.437: openvswitch: definition all-eth is not for us (backend 1)
** (generate:3926): DEBUG: 20:40:46.437: NetworkManager: definition all-eth is not for us (backend 1)
(generate:3926): GLib-DEBUG: 20:40:46.438: posix_spawn avoided (fd close requested)
(generate:3926): GLib-DEBUG: 20:40:46.441: posix_spawn avoided (fd close requested)
DEBUG:netplan generated networkd configuration changed, restarting networkd
DEBUG:all-en not found in {}
DEBUG:all-eth not found in {'all-en': {'dhcp4': True, 'match': {'name': 'en*'}}}
DEBUG:Merged config:
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
DEBUG:no netplan generated NM configuration exists
DEBUG:all-en not found in {}
DEBUG:all-eth not found in {'all-en': {'dhcp4': True, 'match': {'name': 'en*'}}}
DEBUG:Merged config:
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
DEBUG:Link changes: {}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for ens3
DEBUG:netplan triggering .link rules for br54
DEBUG:all-en not found in {}
DEBUG:all-eth not found in {'all-en': {'dhcp4': True, 'match': {'name': 'en*'}}}
DEBUG:Merged config:
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg#
qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg# ip link|grep br54
3: br54: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
"""
Even with the workaround it seems something seems racy, I got a correct run with: network. netplan. network. bridges. br54.dhcp4= true
"""
snap set system system.
ip link | MATCH br54
netplan get | MATCH br54
snap unset system system. network. netplan. network. bridges. br54 network. netplan | NOMATCH br54
snap get -d system system.
ip link | NOMATCH br54
"""
but the next run failed with:
""" network. netplan. network. bridges. br54 network. netplan UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
+ snap unset system system.
+ NOMATCH br54
+ snap get -d system system.
+ NOMATCH br54
+ ip link
NOMATCH pattern='br54' found in:
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens3: <BROADCAST,
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
3: br54: <BROADCAST,
link/ether ae:7d:de:3b:89:05 brd ff:ff:ff:ff:ff:ff
"""
and manual running apply with debug yield no change: core-20- 64 .../tests/ core/netplan- cfg# netplan get core-20- 64 .../tests/ core/netplan- cfg# netplan --debug apply 00-snapd- config. yaml..
"""
qemu:ubuntu-
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
[notice that br54 is gone here]
qemu:ubuntu-
** (generate:3926): DEBUG: 20:40:46.434: Processing input file /etc/netplan/
** (generate:3926): DEBUG: 20:40:46.435: starting new processing pass
** (generate:3926): DEBUG: 20:40:46.436: We have some netdefs, pass them through a final round of validation
** (generate:3926): DEBUG: 20:40:46.436: all-en: setting default backend to 1
** (generate:3926): DEBUG: 20:40:46.436: Configuration is valid
** (generate:3926): DEBUG: 20:40:46.436: all-eth: setting default backend to 1
** (generate:3926): DEBUG: 20:40:46.436: Configuration is valid
** (generate:3926): DEBUG: 20:40:46.437: Generating output files..
** (generate:3926): DEBUG: 20:40:46.437: openvswitch: definition all-en is not for us (backend 1)
** (generate:3926): DEBUG: 20:40:46.437: NetworkManager: definition all-en is not for us (backend 1)
** (generate:3926): DEBUG: 20:40:46.437: openvswitch: definition all-eth is not for us (backend 1)
** (generate:3926): DEBUG: 20:40:46.437: NetworkManager: definition all-eth is not for us (backend 1)
(generate:3926): GLib-DEBUG: 20:40:46.438: posix_spawn avoided (fd close requested)
(generate:3926): GLib-DEBUG: 20:40:46.441: posix_spawn avoided (fd close requested)
DEBUG:netplan generated networkd configuration changed, restarting networkd
DEBUG:all-en not found in {}
DEBUG:all-eth not found in {'all-en': {'dhcp4': True, 'match': {'name': 'en*'}}}
DEBUG:Merged config:
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
DEBUG:no netplan generated NM configuration exists
DEBUG:all-en not found in {}
DEBUG:all-eth not found in {'all-en': {'dhcp4': True, 'match': {'name': 'en*'}}}
DEBUG:Merged config:
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
DEBUG:Link changes: {}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for ens3
DEBUG:netplan triggering .link rules for br54
DEBUG:all-en not found in {}
DEBUG:all-eth not found in {'all-en': {'dhcp4': True, 'match': {'name': 'en*'}}}
DEBUG:Merged config:
network:
ethernets:
all-en:
dhcp4: true
match:
name: en*
all-eth:
dhcp4: true
match:
name: eth*
version: 2
qemu:ubuntu- core-20- 64 .../tests/ core/netplan- cfg# core-20- 64 .../tests/ core/netplan- cfg# ip link|grep br54 MULTICAST, UP,LOWER_ UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
qemu:ubuntu-
3: br54: <BROADCAST,
"""