How to reproduce
- Boot the system in a VM with multiple interfaces (originally the bug was triggered in Google Cloud with a mix of Virtio/eth0 and gvNIC/eth1 interfaces). Key part: a test interface should not be initialized in the config:
vyos@vyos:~$ show configuration
interfaces {
ethernet eth0 {
address dhcp
hw-id 42:01:0a:00:01:1c
mtu 1460
}
loopback lo {
}
}
vyos@vyos:~$ ip l
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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1460 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 42:01:0a:00:01:1c brd ff:ff:ff:ff:ff:ff
altname enp0s5
altname ens5
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 42:01:0a:8e:00:2d brd ff:ff:ff:ff:ff:ff
altname enp0s4
altname ens4
4: pim6reg@NONE: <NOARP,UP,LOWER_UP> mtu 1452 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/pimreg- Try to add eth1 to VPP:
set system option kernel cpu disable-nmi-watchdog set system option kernel cpu isolate-cpus '2-3' set system option kernel cpu nohz-full '2-3' set system option kernel cpu rcu-no-cbs '2-3' set system option kernel disable-hpet set system option kernel disable-mce set system option kernel disable-mitigations set system option kernel disable-softlockup set system option kernel memory hugepage-size 2M hugepage-count '1024' commit+reboot
set vpp settings resource-allocation memory main-heap-size 1G set vpp settings interface eth1 commit
There will be an error:
Traceback (most recent call last):
File "/usr/libexec/vyos/services/vyos-configd", line 145, in run_script
c = script.get_config(config)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/libexec/vyos/conf_mode/vpp.py", line 361, in get_config
iface_filter_eth(conf, iface)
File "/usr/lib/python3/dist-packages/vyos/vpp/config_filter.py", line 46, in iface_filter_eth
iface_nodes = config._session_config.list_nodes(['interfaces', 'ethernet', iface])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/vyos/configtree.py", line 406, in list_nodes
raise ConfigTreeError("Path [{}] doesn't exist".format(path_str))
vyos.configtree.ConfigTreeError: Path [b'interfaces ethernet eth1'] doesn't exist
[[vpp]] failed
Commit failed- Within the same config session, without discarding changes, add eth1 to the config and try again:
set interfaces ethernet eth1 commit
The config will be accepted and applied properly.