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”
Of course I had typed the correct storage name. With empty or incorrect storage name I got other errors.
Maybe that the underlaying filesystem makes a difference. I’m using BTRFS-Raid-0 for performance reasons on my SSD’s. I would prefer ZFS over BTRFS. But it is very very slow on my hardware. So I decided to use ZFS-Raid with HDD’s only.
I get what you’re saying now, I will see if I can add BTRFS. Maybe by asking the user which filesystem type to store as the storage variable. Apologies for the confusion and thanks for letting me know I’ll get on it as soon as possible.
I have added an option to use BTRFS, please could you switch to the testing branch on github and try that version and let me know how it goes as I cannot test BTRFS filesystem right now.
Does anyone know whether this naming scheme is the same for mdadm RAIDs? And in case of Btrfs it is probably only when using its RAID/volume features but not when just formatting a single drive with a single Btrfs partition, is it?