Custom Cloud Init Snippet - Not working

Daxcor

Active Member
Oct 31, 2021
51
2
28
58
Hello,

I have spent hours googling and AI with no luck. I am trying to create a custom cloud init for my debian 13 genericcloud image. I created two files, the user and the network. It looks like the user one is working, well as much as I can tell. The networking file just wont bring up the dhcp network. So what I did was use the default proxmox cloud init and then dumped their network config. Here is what we get:

Code:
root@pve0:~# qm cloudinit dump 101 network
version: 1
config:
    - type: physical
      name: eth0
      mac_address: 'bc:24:11:de:4f:11'
      subnets:
      - type: dhcp4
    - type: nameserver
      address:
      - '192.168.0.1'
      - '1.1.1.1'
      search:
      - 'vm.local'

Looks pretty straight forward, so I thought I would copy t his format. However, proxmox injects the mac address that it assigns. But I can't do that as I don't know it. So I am not sure what to do here? Do I just remove the name and mac address entries and then just let it create its own interface name? If any one has examples of working snippets I would be eternally grateful.

TY
 
So I am not sure what to do here? Do I just remove the name and mac address entries and then just let it create its own interface name?

Here is the documentation:
https://cloudinit.readthedocs.io/en...config-format-v1.html#mac-address-mac-address

This may be the answer you are looking for: Specifying a MAC Address is optional.

Code:
 At least one of these entries is required for external network connectivity. Type physical requires only one key: name.

Most likely your VM boots with a device named differently than eth0. You can find a lot of the helpful troubleshooting information by:
- looking at the console terminal during boot: qm start xxx && qm terminal xxx
- logging in via console and examining the CI log files located in /var

Cheers


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
From the testing I did, it seems always be ens18, I hate hard coded values in a generic init script. I guess I have no choice. Thanks for the info
 
You can program the cloudinit file to write and execute a script that would detect the interface name and create correct network file in place, instead of relying on CI for that part of the config.
You can create/modify your template to not generate ens name.

There are options.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox