[SOLVED] Cloud-init snippet user data

Zombie

Well-Known Member
Feb 12, 2018
39
3
48
42
Question to see if this will work or if works only one way.

Right now if I want to use the user data in in snippets I set it with qm set 900 --cicustom "user=proxmoxnfs-iso:snippets/user.yaml" after I clone a template and it works fine.

BUT

Want I have been trying to do and it does not seem to work or I am doing it wrong, so maybe some insight if anyone has any. What I want to happen is for the snippets to work on a new cloud image I download. What I mean is that I like to download daily cloud images of ubuntu and and then set it up from the proxmox cloud support page https://pve.proxmox.com/wiki/Cloud-Init_Support.

Now it works fine and all that, but now I am adding
qm set 900 --cicustom "user=proxmoxnfs-iso:snippets/user.yaml"
to the commands to try and get my userdata in there, but does not appear to work when you create the VM.

So I guess is it only possible to use the user config file --cicustom on a clone and not on a new VM being created from a cloud image?

Thanks for any insight.

Frank
 
UPDATE (SOLVED)

So if you have snippets enabled for whatever storage it will work when you clone a template and then qm set --cicustom "user=STORAGENAME:snippets/user.yaml" it works.

But it doesn't work if you are just run through the cloud-init creation of a cloud image. Then instead of Datacenter -> Storage -> editing one of my storage's to allow snippets I decided to just add a directory under Datacenter -> Storage -> and only allowed snippets. It still is on my NFS share, but now works for either a clone or just creating a VM off of a cloud image from the cloud-init FAQ.

I just hated having to set vm's to templates then clone them to use custom snippets, but this appears to be a workaround.
 

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!