How to set network device names for in cloud-init configuration for VMs?

Mitchell Monahan

New Member
Jun 3, 2018
4
0
1
25
Creating a cloud-init based VM to try and make it easier to manage, but noticed that proxmox generates a cloud-init network-config file like this:
Code:
version: 1
config:
  - type: physical
    name: eth1
    (rest of network info for that interface)
  - type: nameserver
    address:
    - 8.8.8.8
    - 8.8.4.4

The issue i'm having with that configuration is that it hardcodes the network interface name into the configuration, assuming the VM uses the non-predictable network interface naming system that most distros use nowdays. In my case, the VM's network interface is ens18, but proxmox (and thus cloud-init) is using eth0. How do I tell proxmox the names of my interfaces I'm putting on the VM?
 
Also, maybe add a feature for adding custom stuff to the cloud-config configuration so people can use it to, say, run a script? That would make it pretty easy to have Juju deploy to Proxmox VE.
 
The issue i'm having with that configuration is that it hardcodes the network interface name into the configuration, assuming the VM uses the non-predictable network interface naming system

No, we assume that cloud-init handles the assignment correctly.