cloud-init and cicustom

mwdeez

New Member
Oct 13, 2019
3
0
1
39
Hey everyone, I'm hoping someone more experience than myself at cloud-init and proxmox can help me out, here. I've got 3 hosts running PVE 6.0 in a cluster with shared NFS storage mounted as "nfs-pve" which supports all storage type (image, iso, snippet, backup, etc).

I'm working on automating my infrastructure with Salt and I'm at a stage where I'd like to simplify the new VM builds. I've created a base install of Debian 9 and installed cloud-init. I tested cloud-init by adding a cloud-init drive through the PVE GUI and the settings were modified as I expected. I then exported those YAML files (qm cloudinit dump {network, meta, user}) and moved them to the 'snippets' folder on nfs-pve.

From there I added the "cicustom" to the config with qm set 9000 --cicustom "user=nfs-pve:snippets/test_u.yaml,network=nfs-pve:snippets/test_n.yaml,meta=nfs-pve:snippets/test_m.yaml". After that I removed the cloud-init drive added through the GUI and started the VM. This caused it to hang at boot and for cloud-init to fail to find any config.

It looks like those snippets are not even being loaded and I'm not sure how to troubleshoot. Is there a way to verify that they were loaded and parsed in some logs somewhere? Or is there something else I've missed as, again, this is my first time working with cloud-init.
 
After that I removed the cloud-init drive
you should not remove the cloud-init drive, otherwise we have not place to put the generated iso ...
just leave the cloud init drive in
 
you should not remove the cloud-init drive, otherwise we have not place to put the generated iso ...
just leave the cloud init drive in

Thanks for the reply! I've added the cloud-init drive back to the VM and now it starts, but ignores the custom YAML files, again. Here's my 112.conf file for the VM if this helps:
agent: 1
bootdisk: virtio0
cicustom: user=nfs-pve:snippets/test_u.yaml,network=nfs-pve:snippets/test_n.yaml,meta=nfs-pve:snippets/test_m.yaml
cores: 2
cpu: host
ide2: nfs-pve:112/vm-112-cloudinit.qcow2,media=cdrom
memory: 2048
name: restytest
net0: virtio=6E:FD:CF:51:C3:C2,bridge=vmbr0,firewall=1,tag=101
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=c15350b8-dc2f-40a6-8003-fdc341ff0dcb
sockets: 1
virtio0: ssd:112/vm-112-disk-0.qcow2,size=16G
vmgenid: 280ff8cc-76b3-43b4-af3c-4156af17f257

Does anything in the above look wrong? I've verified multiple times that those files exist in the folder as described in the "cicustom" config. I have an IP and hostname set to test cloud-init and neither are getting used when the VM boots. I've also tried regenerating the cloud-init image after adding the cicustom line to no success.

Thanks for the help so far!
 
I don't know what happened but I created another VM following the wiki, turned it into a template, cloned and everything worked as expected. Thanks for the help!