Cloud-Init not working when a is CDROM drive is installed on an image

mike-s-opc

Renowned Member
Jul 8, 2013
2
1
68
Using Ubuntu 22.04 LTS cloud image, Cloud-Init, Terraform and Ansible to automate the creation of Ubuntu server VMs on Proxmox 8.0.4. These servers need to have Virtual CD Drives.
I downloaded the Ubuntu 22.04 LTS cloud image and converted it to a VM template without a CD Drive on the image. I cloned the image from the Proxmox UI and it worked without any issues issue. I then created VMs from Terraform and no issues.
I then added the CD Drive during the image creation with “qm set 9000 --cdrom none” and via the Proxmox UI and then first created the via Terraform. The creation got stuck in the Cloud-Init and went on for 5 min at that point I manually stopped the process in Terraform. I attempted the same thing this time using Proxmox UI to create the CD Drive in the templet and used Terraform to create a VM with the same results.
To check if the issue was with Terraform I created a VM clone of the image with the Proxmox UI and it got stuck performing the Cloud-Init of the build.
The issue is definitely in the running of the Cloud-Init portion of the processes.

Any ideas on how to work around this?

Thanks.
 
Hi, according to the API docs, the -cdrom option is an alias for -ide2 [1]. I'd suspect that the CloudInit drive was located at ide2, and qm set 9000 -cdrom none replaced it with a CD/DVD drive. If there is no CloudInit drive, this could explain why the creation gets stuck. One solution would be to use a different device than ide2 for the CD/DVD drive, e.g. qm set 9000 -ide0 none.

If this doesn't help, could you please share the VM configs of the templates without and with the CD drive? This would be the output of qm config VMID.

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/config
 
Thanks, that was right on target. Yes -ide2 was set for both the cloud-init and the CD Drive. I should have noticed that in the script to create the temple. I tested with:
Code:
qm set 9000 --ide0 none
qm set 9000 –-ide1 none
qm set 9000 –-ide4 none
All worked without issue when cloning from the Proxmox UI and using Terriform.

Thank you.
 
  • Like
Reactions: fweber

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!