Cloud-init NIC name override

Tux432

New Member
May 11, 2025
1
0
1
When importing an Ubuntu cloudimage VM from VMware I noticed that the networkinterface name has changed, and potentially happens again in the future. So I want to make it static inside the VM. Context is that the VM originally is configured by VMWare's Cloud-init approach ( 50-cloud-init.yaml.BeforeVMwareCustomization & 99-netcfg-vmware.yaml). When re-adding the Cloud-init disk in Proxmox and configuring it, the VM is reachable again by the same IP. Now 99-netcfg-vmware.yaml, 50-cloud-init.yaml & 50-cloud-init.yaml.BeforeVMwareCustomization exist. 50-cloud-init.yaml is in the lead, except for the interface name.

/etc/netplan/50-cloud-init.yaml
YAML:
network:
  version: 2
  ethernets:
    <nicname>:
...
      set-name: <nicname>


netplan apply, works perfectly... until you reboot with Cloud-init disk attached. Cloud-init resets the interface to eth0, while netplan still contains the `<nicname>`.

Following the Proxmox documentation doesn't work at all with Cloud-init, because Cloud-init resets the networkinterface name to eth0 at boot.
Removing the Cloud-init disk keeps netplan applied, but this isn't a solution of course.

How to instruct Cloud-init, at Proxmox host level (not a separate Cloud-init config file, since not needing it is wonderful), to use a specific networkinterface name?
Or/And has Proxmox applied a robust solution that the networkinterfaces name are not changing in the future?