Comment 2 for bug 1775566

Revision history for this message
Christian Ehrhardt  (paelzer) wrote : Re: networkd not applying config written by netplan on boot in q35 (PCIe) KVM guests

Even "netplan apply" with NO yaml file fixes it.
So running in the static networkd config (with the files I copied formerly created by netplan as outlied above).

Then with debug enabled it does:
$ networkctl list
IDX LINK TYPE OPERATIONAL SETUP
  1 lo loopback carrier unmanaged
  2 enp0s3 ether off unmanaged

$ sudo netplan --debug apply
DEBUG:no netplan generated networkd configuration exists
DEBUG:no netplan generated NM configuration exists
DEBUG:replug enp0s3: unbinding virtio0 from /sys/bus/virtio/drivers/virtio_net
DEBUG:replug enp0s3: rebinding virtio0 to /sys/bus/virtio/drivers/virtio_net

$ networkctl list
IDX LINK TYPE OPERATIONAL SETUP
  1 lo loopback carrier unmanaged
  8 enp3 ether routable configured

So I did after a reboot:
echo virtio0 | sudo tee /sys/bus/virtio/drivers/virtio_net/virtio0/driver/unbind
echo virtio0 | sudo tee /sys/bus/virtio/drivers/virtio_net/bind

$ networkctl list
IDX LINK TYPE OPERATIONAL SETUP
  6 enp3 ether routable configured

So it is working after the replug - adn this replug was the magic done by "netplan apply".
Now why this fails with just a static networkd config - I don't know.
But I'd say it is a networkd bug right?

The former event existed on boot
[ 0.726055] virtio_net virtio0 enp0s3: renamed from eth0
This is the one networkd should have picked up.
[ 481.972268] virtio_net virtio0 enp3: renamed from eth0
[ 481.983710] IPv6: ADDRCONF(NETDEV_UP): enp3: link is not ready
[ 482.976135] IPv6: ADDRCONF(NETDEV_CHANGE): enp3: link becomes ready

I don't know where/how to adress this further, but I hope the repro and debug helps to fix this.