PVE 9.0 Beta and proxmox-network-interface-pinning

Mar 14, 2024
5
0
1
Texas
I'm testing PVE 9.0 Beta and would like to know if there's a quick way to select the new link name that the interface is mapped to or rename/update an existing link name? Currently, when I run a command like:

Bash:
proxmox-network-interface-pinning generate --interface ens18

The interface will automatically be named nic0, etc, if it's the first interface.

Here's the example of renaming all interfaces, but what if I want to update the "link" name in the future etc?

Bash:
root@vl3-pve1:~# proxmox-network-interface-pinning generate
This will generate name pinning configuration for all interfaces - continue (y/N)?
y
Name for link 'enp0s18' will change to 'nic0'
Name for link 'enp0s19' will change to 'nic1'
Name for link 'enp0s20' will change to 'nic2'
Name for link 'enp0s21' will change to 'nic3'
Name for link 'enp0s22' will change to 'nic4'
Name for link 'ens18' will change to 'nic0'
Name for link 'ens19' will change to 'nic1'
Name for link 'ens20' will change to 'nic2'
Name for link 'ens21' will change to 'nic3'
Name for link 'ens22' will change to 'nic4'
Name for link 'enxbc2411c1a1a1' will change to 'nic0'
Name for link 'enxbc2411c1a1a2' will change to 'nic1'
Name for link 'enxbc2411c1a1a3' will change to 'nic2'
Name for link 'enxbc2411c1a1a4' will change to 'nic3'
Name for link 'enxbc2411c1a1a5' will change to 'nic4'
Generating link files
Successfully generated .link files in '/usr/local/lib/systemd/network/'
Updating /etc/pve/nodes/vl3-pve1/host.fw.new
Updating /etc/network/interfaces.new
Updating /etc/pve/sdn/controllers.cfg
Updating /etc/pve/sdn/fabrics.cfg
Successfully updated Proxmox VE configuration files.

Please reboot to apply the changes to your configuration
 
I'm testing PVE 9.0 Beta and would like to know if there's a quick way to select the new link name that the interface is mapped to or rename/update an existing link name? Currently, when I run a command like:

It currently only implements pinning, but we're working hard on adding the additional features like renaming / unpinning.
 
  • Like
Reactions: SteveITS
You can see in the output the files it edits:

Updating /etc/pve/nodes/vl3-pve1/host.fw.new
Updating /etc/network/interfaces.new
Updating /etc/pve/sdn/controllers.cfg
Updating /etc/pve/sdn/fabrics.cfg

So, to manually revert you can check if any of those files reference the newly generated NIC (e.g, by grep) and replace them manually, then delete the respective generated link file in /usr/local/lib/systemd/network
 
Hi Stefan! I also tried this on my Minisforum MS-A2 Machines and this happened:


Code:
root@training5:~# proxmox-network-interface-pinning generate
This will generate name pinning configuration for all interfaces - continue (y/N)?
y
Name for link 'enp3s0' will change to 'nic0'
Name for link 'enp4s0' will change to 'nic1'
Name for link 'enp5s0f0np0' will change to 'nic2'
Name for link 'enp5s0f1np1' will change to 'nic3'
Name for link 'enx5847ca7eba21' will change to 'nic0'
Name for link 'enx5847ca7eba22' will change to 'nic1'
Name for link 'enx5847ca7eba23' will change to 'nic2'
Name for link 'enx5847ca7eba24' will change to 'nic3'
Name for link 'wlp6s0' will change to 'nic4'
Name for link 'wlx14ea635c1761' will change to 'nic4'
Generating link files
Successfully generated .link files in '/usr/local/lib/systemd/network/'
Updating /etc/pve/nodes/training5/host.fw.new
Updating /etc/network/interfaces.new
Use of uninitialized value $iface_name in pattern match (m//) at /usr/share/perl5/PVE/CLI/proxmox_network_interface_pinning.pm line 281.
Use of uninitialized value $iface_name in hash element at /usr/share/perl5/PVE/CLI/proxmox_network_interface_pinning.pm line 288.
Updating /etc/pve/sdn/controllers.cfg
Updating /etc/pve/sdn/fabrics.cfg
Successfully updated Proxmox VE configuration files.

Please reboot to apply the changes to your configuration

After rebooting the "enp" names are all gone (not existent anymore) and only the prev. Alternative-Names are now used as Alternative-Names again. On other setups the prev. main-names got used for the new alt-names?

Do you know the reason why? Its not that big of a deal, it works but the enx-names are really cryptic, I would prefer the enp-ones.
 
Last edited:
@jsterr Could you post the output of the following commands (replace the name of <nic> with the 'real' name of one nic where this occurs)?

Code:
udevadm test-builtin net_id /sys/class/net/<nic>
udevadm test-builtin net_setup_link /sys/class/net/<nic>
 
  • Like
Reactions: jsterr
@jsterr Could you post the output of the following commands (replace the name of <nic> with the 'real' name of one nic where this occurs)?

Code:
udevadm test-builtin net_id /sys/class/net/<nic>
udevadm test-builtin net_setup_link /sys/class/net/<nic>

The "real" name does not exist anymore. pvea bis pveq are sdn-simple-zones just in case your wondering about these.
Code:
root@training4:~# udevadm test-builtin net_id /sys/class/net/
/sys/class/net/bond0   /sys/class/net/nic3    /sys/class/net/pvee    /sys/class/net/pvej    /sys/class/net/pveo    /sys/class/net/wlp6s0
/sys/class/net/lo      /sys/class/net/pvea    /sys/class/net/pvef    /sys/class/net/pvek    /sys/class/net/pvep   
/sys/class/net/nic0    /sys/class/net/pveb    /sys/class/net/pveg    /sys/class/net/pvel    /sys/class/net/pveq   
/sys/class/net/nic1    /sys/class/net/pvec    /sys/class/net/pveh    /sys/class/net/pvem    /sys/class/net/vmbr0   
/sys/class/net/nic2    /sys/class/net/pved    /sys/class/net/pvei    /sys/class/net/pven    /sys/class/net/vmbr1

If I check the "nic0" which was enp3s0 before, this is the output:

Code:
root@training4:~# udevadm test-builtin net_id /sys/class/net/nic0
Trying to open "/etc/systemd/hwdb/hwdb.bin"...
Trying to open "/etc/udev/hwdb.bin"...
Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/usr/lib/udev/hwdb.bin"...
=== trie on-disk ===
tool version:          257
file size:        13018428 bytes
header size             80 bytes
strings            2728588 bytes
nodes             10289760 bytes
Loading kernel module index.
Loaded 'libkmod.so.2' via dlopen()
Found container virtualization none.
Using default interface naming scheme 'v257'.
Parsed configuration file "/usr/lib/systemd/network/99-default.link"
Parsed configuration file "/usr/lib/systemd/network/80-vm-vt.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-vz.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-ve.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-vb.link"
Parsed configuration file "/usr/lib/systemd/network/80-6rd-tunnel.link"
Parsed configuration file "/usr/lib/systemd/network/73-usb-net-by-mac.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic4.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic3.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic2.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic1.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic0.link"
Created link configuration context.
ID_NET_NAMING_SCHEME=v257
ID_NET_NAME_MAC=enx5847ca7eb9e9
nic0: MAC address identifier: hw_addr=58:47:ca:7e:b9:e9 → x5847ca7eb9e9
ID_OUI_FROM_DATABASE=Shenzhen Meigao Electronic Equipment Co.,Ltd
sd-device: Failed to chase symlinks in "/sys/devices/pci0000:00/0000:00:03.1/0000:03:00.0/net/nic0/of_node".
nic0: Failed to get device of_node, ignoring: No such device
sd-device: Failed to chase symlinks in "/sys/devices/pci0000:00/0000:00:03.1/0000:03:00.0/of_node".
0000:03:00.0: Failed to get device of_node: No such device
sd-device: Failed to chase symlinks in "/sys/devices/pci0000:00/0000:00:03.1/0000:03:00.0/physfn".
0000:03:00.0: Failed to get PCI onboard label: No such file or directory
0000:03:00.0: Could not obtain onboard index: No such file or directory
ID_NET_NAME_PATH=enp3s0
nic0: PCI path identifier: domain=n/a bus_and_slot=p3s0 func=n/a port=n/a → enp3s0
0000:03:00.0: Failed to read firmware_node/sun, ignoring: No such file or directory
0000:00:03.1: Device is a PCI bridge.
0000:03:00.0: Not using slot information because the parent PCI slot is a bridge and the PCI device is not multifunction.
sd-device: Failed to chase symlinks in "/sys/class/pci".
sd-device: Failed to chase symlinks in "/sys/bus/subsystem/devices/pci".
sd-device: Failed to chase symlinks in "/sys/class/subsystem/pci".
sd-device: Failed to chase symlinks in "/sys/firmware/subsystem/pci".
nic0: Could not find USB parent device: No such file or directory
nic0: Could not get BCMA parent device: No such file or directory
Unload kernel module index.
Unloaded link configuration context.

and

Code:
root@training4:~# udevadm test-builtin net_setup_link /sys/class/net/nic0
Trying to open "/etc/systemd/hwdb/hwdb.bin"...
Trying to open "/etc/udev/hwdb.bin"...
Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/usr/lib/udev/hwdb.bin"...
=== trie on-disk ===
tool version:          257
file size:        13018428 bytes
header size             80 bytes
strings            2728588 bytes
nodes             10289760 bytes
Loading kernel module index.
Loaded 'libkmod.so.2' via dlopen()
Found container virtualization none.
Using default interface naming scheme 'v257'.
Parsed configuration file "/usr/lib/systemd/network/99-default.link"
Parsed configuration file "/usr/lib/systemd/network/80-vm-vt.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-vz.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-ve.link"
Parsed configuration file "/usr/lib/systemd/network/80-container-vb.link"
Parsed configuration file "/usr/lib/systemd/network/80-6rd-tunnel.link"
Parsed configuration file "/usr/lib/systemd/network/73-usb-net-by-mac.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic4.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic3.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic2.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic1.link"
Parsed configuration file "/usr/local/lib/systemd/network/50-pve-nic0.link"
Created link configuration context.
nic0: Device has name_assign_type=4
nic0: Device has addr_assign_type=0
nic0: Config file /usr/local/lib/systemd/network/50-pve-nic0.link is applied
nic0: Running in test mode, skipping application of ethtool settings.
nic0: Running in test mode, skipping application of rtnl settings.
nic0: Policies didn't yield a name, using specified Name=nic0.
nic0: Running in test mode, skipping application of SR-IOV settings.
nic0: Running in test mode, skipping application of RPS setting.
ID_NET_LINK_FILE=/usr/local/lib/systemd/network/50-pve-nic0.link
ID_NET_LINK_FILE_DROPINS=
ID_NET_NAME=nic0
Unload kernel module index.
Unloaded link configuration context.
 
The "real" name does not exist anymore. pvea bis pveq are sdn-simple-zones just in case your wondering about these.
Sorry I was unclear - I meant the current name of the interface, but the output is correct nevertheless :)

It seems like udev is able to generate the path based name as evidenced by the ID_NET_NAME_PATH=enp3s0 line in your output, but it refuses to use the name. I suspect this to be the cause for the issue:

Code:
0000:03:00.0: Not using slot information because the parent PCI slot is a bridge and the PCI device is not multifunction.

The only further documentation for this I can find is in the code itself [1], but imo the reasoning makes sense that they don't want to rely on the slot name in this case, since theoretically there's the possibility of multiple interfaces getting the same identifier.

[1] https://github.com/systemd/systemd/blob/main/src/udev/udev-builtin-net_id.c#L501