If cloud-init is a volume, why does it stop working when the files are taken away?

Carr0t

New Member
May 16, 2025
3
0
1
I'm trying to configure cloud-init with custom data, both for user-data and meta-data. I'm aware that I can set custom data with

Code:
qm set <ID> --cicustom ...

If I do that, and then try and look at what's set using

Code:
qm cloudinit dump

my custom settings don't show up.

_But_ if I mount the cloud init volume (which Proxmox wants to only allow me to do read-only) and examine the files within, I can see my custom user config within /mount-path/user-data (for example). And booting an instance from that cloud-init disk does seem to do what I want and run my custom user config.

But _then_, if I delete the source file from local:snippets/..., or if I migrate the VM to another instance (the cloud-init volume itself is on Ceph), it stops working.

That would suggest that all that actually ends up in the volume is some kind of reference to the snippet file, but if that were the case I'd expect to see a symlink or similar in the mounted drive, instead of the actual file content.

So how is all of this set up? Is there any way I can generate a cloud-init volume with custom content and not have to retain the files that make that volume up to be able to continue to use it? Also, can I generate my own volume to use as the cloud-init volume and point qemu at it, or do I have to use the one Proxmox creates for me?
 
If I do that, and then try and look at what's set using

qm cloudinit dump
my custom settings don't show up.
The DUMP command line option always shows only internal CloudInit configuration, regardless of whether it is in use. The command looks at the VM configuration and does not source/examine external files.

But _then_, if I delete the source file from local:snippets/..., or if I migrate the VM to another instance (the cloud-init volume itself is on Ceph), it stops working.
The generated "volume" is an ISO file that is mounted as a CDrom. You can see it both in the Hardware overview of the VM, and inside the VM.

The ISO is regenerated on VM start. So if you moved the files away - they can no longer be found/included, hence the error.

So how is all of this set up? Is there any way I can generate a cloud-init volume with custom content and not have to retain the files that make that volume up to be able to continue to use it?
May be if you avoid any operation that might trigger ISO regeneration. But since those are not clearly documented - it will be a challenge. Why not just keep the files?

Also, can I generate my own volume to use as the cloud-init volume and point qemu at it, or do I have to use the one Proxmox creates for me?
Of course, just create an ISO and mount it as a CD, or use any other supported datasource method: https://cloudinit.readthedocs.io/en/latest/reference/datasources.html


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