Page MenuHomeVyOS Platform

Resolve unexpected interface name reordering
Needs testing, NormalPublicBUG

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

Version
vyos-1.4
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects

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.

syncer changed the subtype of this task from "Task" to "Bug".Jun 14 2023, 10:43 AM

When will this bug be fixed? I am having a lot of issues with this.

@stingalleman As mentioned above (and confirmed in discussions earlier this week), we've had few if any reports of issues with the udev approach, so we would be very interested to hear details of your case.

@stingalleman As mentioned above (and confirmed in discussions earlier this week), we've had few if any reports of issues with the udev approach, so we would be very interested to hear details of your case.

Hi,

I was doing something stupid - whoops:)

It's working like expecting.

Thanks!

jestabro lowered the priority of this task from High to Normal.Jan 10 2024, 3:31 PM

Lowering priority to normal to proceed with adding the interface-monitor daemon development, mentioned above, for 1.5.

Viacheslav changed the task status from In progress to Needs testing.Jan 19 2024, 10:06 PM
vyosbot added a subscriber: Viacheslav.

I took some time to re-test this on recent rolling releases and it seemed mostly positive.

I have a SuperMicro A2SDi-TP8F (Intel C3858) system that has 8 built-in NICs plus a PCIe expansion card I added provided one additional NIC. For some reason, the native kernel ordering decided to put the expansion card NIC in the middle of the built-in NICs e.g. eth0 (built-in), eth1 (expansion card), eth2 (built-in), ...

On 1.3 I was able to rename the interfaces to follow a more logical order. I don't remember exactly how I set it up but I'm pretty sure I did so using normal configuration commands.

On the current 1.5 rolling, I didn't have much luck renaming... "edit interfaces; rename ethernet eth8 to ethernet eth9"; commit;" would fail with an error about interface eth9 not existing.
However, if I manually patched config.boot in a text editor and rebooted the system it did respect the hw-ids and place the interfaces in my desired order during boot.
Is the ability to re-name an interface after boot something that we are intending to support?

Still overall an improvement from the early 1.4 builds which definitely didn't respect anything defined in the config file (boot time or otherwise).