cloud-init: pass VM's mac address to cloud-init

marpe7

New Member
Aug 25, 2023
2
0
1
Hi,

how to make cloud-init network configuration (with a static IP) to dynamically use the VMs mac address (as in VMs Hardware) without needing to explicitly specify the mac address again in the network.yaml config (via `cicustom`)?

When i don't specify any mac address in the cloud-init network config (v1), it will not generate a valid netplan config (missing mac match rule).

I am using PVE 8, latest Ubuntu jammy cloud-init image.

Thanks.
Marpe
 
If there is no way to achieve this with the custom-config files, is there maybe a scripting solution to obtain the VM's mac address and pass it to cloud-init?

Technically it is already possible if not using custom-config files ('cicustom') if using the settings in the PVE's UI VM menu 'cloud-init' section: the VM's MAC is automatically applied in the VM's resulting cloud-init network config. I'm looking for a way using config files (preferably) or scripting.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!