Where pve-network-interface-pinning store it's configuration?

Hi...

I am using pve-network-interface-pinning to pin enp1s0, for instance, to eth0, eth1... and so on.
I have 9 nic each server.
But I need to change the hardware and after that, all nic turns back to previously name, like enp1s0, when I use ip a command.
If I try to change it back up eth0, I got this error:
Code:
pve-network-interface-pinning generate --interface  enp7s0  --target-name eth1
This will generate name pinning configuration for the interface 'enp7s0' - continue (y/N)?
y
could not resolve 52:54:00:9d:5d:1e to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:4b:ae:f5 to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:94:3a:9f to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:29:26:c5 to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:ee:b3:68 to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:af:22:2f to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:f3:81:08 to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:4b:c1:2b to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
could not resolve 52:54:00:31:c5:1f to an existing interface at /usr/share/perl5/PVE/CLI/pve_network_interface_pinning.pm line 343, <STDIN> line 1.
target-name already exists as link or pin!

So I need to understand where pve-network-interface-pinning store it's configuration.
Is there anyway to recreate the network interface pinning?

Thanks
 
Sorry!
It was right there in my face! Shame on me...

This will generate name pinning configuration for the interface 'enp1s0' - continue (y/N)?
y
Name for link 'enp1s0' (enx525400d99ca2) will change to 'eth0'
Generating link files
Successfully generated .link files in '/usr/local/lib/systemd/network/'
Updating /etc/pve/nodes/proxmox03/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
 
  • Like
Reactions: Sunilkumar
Iirc, one reason was to prevent clashes with potentially pre-existing configuration files in /etc. We could maybe implement specifiying the base path for the generated files to circumvent that and enable generation of the link files in /etc?
 
Iirc, one reason was to prevent clashes with potentially pre-existing configuration files in /etc. We could maybe implement specifiying the base path for the generated files to circumvent that and enable generation of the link files in /etc?
No real opinion for me, as long as all config files are under /etc somewhere for grepability, backupability, etc. And this file is generated by the installer so there shouldn't be any preexisting files?
 
AFAIK
Code:
/etc/systemd/network/
is a good place for .link files - /etc/ really is the first place i would look for them.
(We've had it there since 7.x and still in 9.2; we pin manually with more insightful names than the pinning tool nowadays generates).


But the path the pinning tool currently uses is also expected according to the docs: https://manpages.debian.org/unstable/manpages-de/systemd.link.5.de.html
Die .link-Dateien werden aus den Dateien gelesen, die sich im Systemnetzwerkverzeichnis /usr/lib/systemd/network und /usr/local/lib/systemd/network [1], dem flüchtigen Laufzeitnetzwerkverzeichnis /run/systemd/network und dem lokalen Administrationsnetzwerkverzeichnis /etc/systemd/network befinden.
 
  • Like
Reactions: Colin 't Hart
I came here to ask the question about whether there is a good reason that I shouldn't move my .link files to /etc/systemd/network (which is where the man pages seem to suggest they should be anyway) so I was pleased to find this thread at the top of the forum when I arrived.

I can now revert to only having to backup /etc (previously /usr/local/lib/systemd/network was the only dir outside of /etc that I needed to backup) so that's wonderful.

+1 to the suggestion of making this the default location or giving the user the option.
 
Last edited:
  • Like
Reactions: Colin 't Hart
  • Like
Reactions: stv.Bundesadmin
I came here to ask the question about whether there is a good reason that I shouldn't move my .link files to /etc/systemd/network (which is where the man pages seem to suggest they should be anyway) so I was pleased to find this thread at the top of the forum when I arrived.

I can now revert to only having to backup /etc (previously /usr/local/lib/systemd/network was the only dir outside of /etc that I needed to backup) so that's wonderful.

+1 to the suggestion of making this the default location or giving the user the option.
And I came here after I installed PBS on top of an existing old-many-times-upgraded Debian install. The network interface wasn't initialised as it should. It turned out to be a different issue, but when I compared it to my new PBS install, I noticed that the ethernet device names were different. Grepping for "nic0" in /etc didn't find anything and I was very confused -- having seen the option to pin the network interface name during the install, which I accepted because I liked to keep my machines as default as possible to maximise their upgradability.

I should probably do a new install of Proxmox VE 9.2 into a VM and compare it to the default configuration on my many-times-upgraded PVE servers.