# Get the image
wget http://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img
 
# Create a VM
qm create 10000 --memory 2048 --name ubuntu-cloud --net0 virtio,bridge=vmbr0
 
# Attach cloud init disk to VM
qm importdisk 10000 ubuntu-22.04-server-cloudimg-amd64.img storage1tb
 
# Create a SCSI drive
qm set 10000 --scsihw virtio-scsi-pci --scsi0 storage1tb:vm-10000-disk-0
 
# Create logical volume
qm set 10000 --ide2 storage1tb:cloudinit
 
# Set boot disk to cloudinit
qm set 10000 --boot c --bootdisk scsi0
 
# Set video output to see in webVNC
qm set 10000 --serial0 socket --vga serial0