Cloud-init: change default network interface name from eth0 to ens18 #847
-
How do I change the network interface name from |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @everythings-gonna-be-alright!
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
I don't have any context about "another provider", so can't comment on that.
Sorry, don't quite understand the problem. Wouldn't |
Beta Was this translation helpful? Give feedback.
-
My bad. I thought generating
@bpg, thanks for your time. |
Beta Was this translation helpful? Give feedback.
-
Just sharing another possible solution. in our case using Instead, we had to rename an interface from Thanks to @everythings-gonna-be-alright and @bpg for sharing the information! |
Beta Was this translation helpful? Give feedback.
My bad. I thought generating
network-config
cloud-init template happens on the terraform provider side.But actually, this provider sets the IP address and Gateway into
network-config
through Proxmox API.Moreover, Proxmox API doesn't provide the ability to set custom interface names to cloud-init network templates.
The best way to resolve this issue is to generate a custom configuration and override the Proxmox cloud-init network configuration (
network_data_file_id
).It is also necessary to manually generate mac_address and put it into the
network-config
template ( if you want to set a custom interface name )Or
Just keep the default OS interface name. This way is a little bit dirty, b…