bpg / terraform-provider-proxmox

Terraform Provider for Proxmox
https://registry.terraform.io/providers/bpg/proxmox
Mozilla Public License 2.0
809 stars 134 forks source link

Cloud-init: change default network interface name from eth0 to ens18 #833

Closed everythings-gonna-be-alright closed 9 months ago

everythings-gonna-be-alright commented 9 months ago
# ls -lh
total 2.0K
-rw-r--r-- 1 root root  54 Dec 23 23:24 meta-data
-rw-r--r-- 1 root root 313 Dec 23 23:24 network-config
-rw-r--r-- 1 root root 217 Dec 23 23:24 user-data
-rw-r--r-- 1 root root 276 Dec 23 23:24 vendor-data

# cat network-config | grep 'name:'
      name: eth0

How do I change the network interface name from eth0 to ens18? I migrated infrastructure from another provider, which used ens18 name as default. I run Kubernetes on VMs, and for the CNI plugin, having the same interface name on each compute node is vital.

bpg commented 9 months ago

Hi @everythings-gonna-be-alright!

How do I change the network interface name from eth0 to ens18?

The provider doesn't do anything with regards to interface names, and honestly I don't have much ideas where the name is coming from. This behaviour could be specific for a distro you're using, or something that Proxmox is adding on top of its auto-generate cloud-init configuration, which could also be specific to PVE version.

In theory, any customization can be done via a custom cloud-init config that you can provide via network_data_file_id attribute.

I migrated infrastructure from another provider, which used ens18 name as default.

I don't have any context about "another provider", so can't comment on that.

I run Kubernetes on VMs, and for the CNI plugin, having the same interface name on each compute node is vital.

Sorry, don't quite understand the problem. Wouldn't eth0 name be same on all the nodes?