Comment 0 for bug 1949893

Revision history for this message
Michael Vogt (mvo) wrote : new interface does not show up after config apply

While working on the integration tests for netplan on ubuntu core I ran into the following issue:
1. the config system.network.netplan.network.bridges.br54.dhcp4=true is set
2. a subsequent "ip link" does not show this network interface

"""
...
+ echo 'Check that setting adding a br54 interface via netplan works'
Check that setting adding a br54 interface via netplan works
+ snap set system system.network.netplan.network.bridges.br54.dhcp4=true
+ echo 'Check that the interface is really there'
Check that the interface is really there
+ MATCH br54
+ ip link
grep error: pattern not found, got:
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
"""

but on this machine:
"""
qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg# netplan get
network:
  bridges:
    br54:
      dhcp4: true
  ethernets:
    all-en:
      dhcp4: true
      match:
        name: en*
    all-eth:
      dhcp4: true
      match:
        name: eth*
  version: 2
"""

What the go code is doing internally (using dbus) is:
1. clear config
2. set new config
3. call io.netplan.Netplan.Config.Try with a 30s timeout
4. check if store is still reachable
5. run io.netplan.Netplan.Config.Apply

Log:
"""
Nov 04 18:35:56 ubuntu snapd[2864]: daemon.go:216: DEBUG: pid=3308;uid=0;socket=/run/snapd.socket; GET /v2/snaps/system/conf?keys=system.network.netplan.network.version 188.318703ms 200
Nov 04 18:35:56 ubuntu snapd[2864]: netplan.go:122: DEBUG: using netplan config /io/netplan/Netplan/config/WCELC1
Nov 04 18:35:57 ubuntu snapd[2864]: daemon.go:216: DEBUG: pid=3321;uid=0;socket=/run/snapd.socket; GET /v2/snaps/system/conf?keys=system.network.netplan 250.060706ms 200
Nov 04 18:35:57 ubuntu snapd[2864]: daemon.go:216: DEBUG: pid=3348;uid=0;socket=/run/snapd.socket; PUT /v2/snaps/system/conf 5.846868ms 202
Nov 04 18:35:57 ubuntu snapd[2864]: taskrunner.go:439: DEBUG: Running task 149 on Do: Run configure hook of "core" snap
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:122: DEBUG: using netplan config /io/netplan/Netplan/config/MYV8B1
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:122: DEBUG: using netplan config /io/netplan/Netplan/config/V1VAC1
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:181: DEBUG: calling netplan.Set: network=null
Nov 04 18:35:57 ubuntu snapd[2864]: netplan.go:181: DEBUG: calling netplan.Set: network={"bridges":{"br54":{"dhcp4":true}},"ethernets":{"all-en":{"dhcp4":true,"match":{"name":"en*"}},"all-eth":{"dhcp4":true,"match":{"name":"eth*"}}},"version":2}
...
Nov 04 18:35:58 ubuntu snapd[2864]: netplan.go:229: DEBUG: netplan config applied correctly
"""
The originHint for all of these is "00-snapd-config.yaml"

But the interface does not appear.

But a subsequent:
""
qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg# netplan apply --debug
[notice that there is no output here?]

qemu:ubuntu-core-20-64 .../tests/core/netplan-cfg# ip link
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 32:b4:1e:6a:73:ba brd ff:ff:ff:ff:ff:ff
"""

and the interface appears. Any hints welcome, this is netplan "0.103-0ubuntu5~20.04.2" - I think this code was working before (well, it would cause crashes later but this bit iirc worked).

Any hints welcome :)