Page MenuHomeVyOS Platform

Resolve unexpected interface name reordering
In progress, HighPublic

Description

It is a recurring problem that on certain platforms ethernet interfaces will have changed associations: interface name <-> hw-id, after a reboot or upgrade. There has been active discussion regarding the problem recently, and consensus on a preliminary design to resolve the issue. This task will serve as meta-task for investigation and resolution.

An incomplete collection of related tasks:

https://phabricator.vyos.net/T291
https://phabricator.vyos.net/T577
https://phabricator.vyos.net/T1499
https://phabricator.vyos.net/T1671
https://phabricator.vyos.net/T2838

Details

Difficulty level
Unknown (require assessment)
Version
vyos-1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

syncer changed the task status from Open to In progress.Feb 2 2023, 7:38 PM
syncer triaged this task as High priority.

The approach in commit ee02ca93 of vyos-1x was considered a reasonable workaround for all but a few corner cases. However, the issue pointed out in

https://phabricator.vyos.net/T4966

and PR:

https://github.com/vyos/vyos-build/pull/302

re-raises the question.

Before adopting the approach mentioned above, there was development of an alternative using pyudev within an 'interface-monitor' daemon; the following branches contain (a version of) the rebased code. It would need a few hours of attention to check the logic and add the is_persistent check from vyos-interface-rescan.py; it could use some refactoring as well.

https://github.com/vyos/vyos-1x/compare/current...jestabro:vyos-1x:interface-monitor
https://github.com/vyos/vyatta-cfg/compare/current...jestabro:vyatta-cfg:interface-monitor
https://github.com/vyos/vyos-build/compare/current...jestabro:vyos-build:interface-monitor

Before adopting the approach mentioned above, there was development of an alternative using pyudev within an 'interface-monitor' daemon; the following branches contain (a version of) the rebased code. It would need a few hours of attention to check the logic and add the is_persistent check from vyos-interface-rescan.py; it could use some refactoring as well.

https://github.com/vyos/vyos-1x/compare/current...jestabro:vyos-1x:interface-monitor
https://github.com/vyos/vyatta-cfg/compare/current...jestabro:vyatta-cfg:interface-monitor
https://github.com/vyos/vyos-build/compare/current...jestabro:vyos-build:interface-monitor

I think your interface-monitordaemon looks like a good long term solution to this.

The above repos are suitable for testing: basic tests in vm's and a Protecli device look fine. Note that the vyos-1x repo artificially disables the potential config mode reordering in order to confirm tests of vyos-interface-monitor.:
https://github.com/vyos/vyos-1x/commit/02d874e65262cbd53b413b3eef659b8e7d78bf31

It remains an open question whether the wrapper around libudev (pyudev) will satisfy all our use cases, but it a reasonable approach for testing.

Debugging info is logged if the system is booted with parameter 'vyos-interface-debug'.

The tools are in place to support hot-plugged devices, though that will be a separate round of implementation/testing, as there will again be interactions with conf_mode ifconfig/interface.py on initialization, which will need to be reconciled.