Skip to main content

Cloud-init

Download the image from https://cloud-images.ubuntu.com/ (tested on https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img)

Create and configure a new VM via CLI on the host

qm create 9999 --memory 8192 --core 2 --name ubuntu-cloud --net0 virtio,bridge=vmbr0
cd /var/lib/vz/template/iso/ # or to the location where the image was downloaded
qm importdisk 9999 <IMAGE NAME> <YOUR STORAGE HERE>
qm set 9999 --scsihw virtio-scsi-pci --scsi0 <YOUR STORAGE HERE>:9999/vm-9999-disk-0.raw
qm set 9999 --ide2 <YOUR STORAGE HERE>:cloudinit
qm set 9999 --boot c --bootdisk scsi0
qm set 9999 --serial0 socket --vga serial0
qm disk resize 9999 scsi0 64G

Go to the UI, and set User, Password, SSH public key, IP Config = DHCP

Convert the VM to template

Deploy new VMs by cloning the template (full clone) or using Terraform