Cloud Init and Snippets how?

Daxcor

Member
Oct 31, 2021
43
2
13
57
Hello,

I am starting my journey in using a custom cloud-init via a snippet. I am creating the vms using the proxmox API interface. Reading the api docs I get this:

cicustom: [meta=<volume>] [,network=<volume>] [,user=<volume>] [,vendor=<volume>]
cipassword: Password
citype:: configdrive2 | nocloud | opennebula
ciupgrade: 1
ciuser: Username

Do I have to create the four separate files ?
Where do I put my cli commands, is this in the vendor file ?
In the gui create network snippet I noticed that it had the mac address. If create my own network snippet I just leave the mac address empty?
If I use cicustom, then I don't use the remaining ci options correct?

Any helpfull videos, tutorials etc would be awesome.

Thanks
Brad
 
Custom Cloud init overwrites any built-in CI PVE values.

Cloud Init file can be in many formats, most common is YAML.

Cloud Init is industry standard package customization method, i.e. not PVE specific. You can find all of the information here:
https://cloud-init.io/

You can also find many CI templates online. The CI docs will tell you which value goes into User, Network or Vendor files.

Here is an example of using less common CI format (bash) : https://kb.blockbridge.com/technote/proxmox-cirros/

You don't need all 4 files. You can use any combination of the 4 to achieve your goals. For example, you can specify Network file, and can still be able to rely on built-in ciuser and cipassword.
The CLI commands usually go into User section, as long as it is formatted properly.

PS
note that "cloudinit dump" command in PVE only shows PVE native CI. If you have custom CI configured - it will not be shown but it will overwrite the built-in CI.

Cheers


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