qemu_template.sh: Allow parameters for VM image and memory

When testing multiple images one always has to copy them to the
expected file name, and when trying to run two VMs this means one needs
to either use separate directories or modify the qemu script. One also
needs to modify the qemu script to bump the memory for K8s or for LUKS.

Support parameters for the VM image name and the VM memory.
This commit is contained in:
Kai Lueke 2024-04-03 20:03:02 +09:00
parent 83fbd6dc31
commit 4d5e46432a

View File

@ -26,6 +26,8 @@ Options:
-c FILE Config drive as an iso or fat filesystem image.
-a FILE SSH public keys for login access. [~/.ssh/id_{dsa,rsa}.pub]
-p PORT The port on localhost to map to the VM's sshd. [2222]
-I FILE Set a custom image file.
-M MB Set VM memory in MBs.
-s Safe settings: single simple cpu and no KVM.
-h this ;-)
@ -76,6 +78,12 @@ while [ $# -ge 1 ]; do
-s|-safe)
SAFE_ARGS=1
shift ;;
-I|-image-file)
VM_IMAGE="$2"
shift 2 ;;
-M|-memory)
VM_MEMORY="$2"
shift 2 ;;
-v|-verbose)
set -x
shift ;;