I have made some templates for my environment:
CPU, RAM, disk size as well as regional settings, disable IPv6 in my VMs etc set. Made all updates and then converted it to a template for further cloning.
Did this for a headless and two GUI based machines.
But your script is a nice starter for using the VMs initially.
I also am working at a LXC DietPi container. I generate them with a script from a VM.
Great, but your script is still missing the qm set commands:
qm set $ID --net0 “virtio,bridge=vmbr0”
qm set $ID --scsi0 “$STORAGE:vm-$ID-disk-0”
qm set $ID --boot order=‘scsi0’
qm set $ID --scsihw virtio-scsi-pci
you need to add
qm set $ID --cores “$CORES”
qm set $ID --memory “$RAM”