Cloud image creation
wget https://cloud-images.ubuntu.com/bionic/current/noble-server-cloudimg-amd64.img
qm create 9000 --memory 4096 --core 2 --name ubuntu-cloud --net0 virtio,bridge=vmbr0
qm importdisk 9000 noble-server-cloudimg-amd64.img sata
qm set 9000 --scsihw virtio-scsi-pci --scsi0 sata:vm-9000-disk-0
qm set 9000 --ide2 sata:cloudinit
qm set 9000 --boot c --bootdisk scsi0
qm set 9000 --serial0 socket --vga serial0
Run this commands one by one. It is recomended to use higher VM ID to distinguish templates. It will create VM with attached image and cloud init file. This VM then should be converted to template. All other VMs can be cloned from this template. Parameters of VM such as CPU cores, RAM, username, password, SSH keys and IPs can be set in cloud-init part of template, but better option is to set this later for each specific VM.
Also virtual disk should be resized, as it will have very limited size in begining (cca 3.5G).