From d678828a0c560c8c72ad506d16a40e6345623ce0 Mon Sep 17 00:00:00 2001 From: Stephen Bates Date: Thu, 21 Nov 2024 15:42:29 -0700 Subject: [PATCH] virt-install-ubuntu: Make vcpus and memory configurable. Fixes #18. --- libvirt/virt-install-ubuntu | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libvirt/virt-install-ubuntu b/libvirt/virt-install-ubuntu index 56977ac..4ab7a83 100755 --- a/libvirt/virt-install-ubuntu +++ b/libvirt/virt-install-ubuntu @@ -83,6 +83,8 @@ PASS=${PASS:-password} PACKAGES=${PACKAGES:-../packages.d/packages-default} FILESYSTEM=${FILESYSTEM:-none} BRIDGE=${BRIDGE:-none} +MEMORY=${MEMORY:-8192} +VCPUS=${VCPUS:-4} if [ $RELEASE == "bionic" ]; then @@ -100,8 +102,8 @@ if [ $RELEASE == "bionic" ]; then virt-install \ --connect qemu:///system \ --name ${NAME} \ - --memory 1024 \ - --vcpus 1 \ + --memory ${MEMORY} \ + --vcpus ${VCPUS} \ --virt-type kvm \ --disk size=${SIZE} \ --graphics none \ @@ -256,7 +258,8 @@ virt-install \ --name ${NAME} \ --osinfo ${OSINFO} \ --cloud-init user-data=cloud-config-${NAME},network-config=network-config-${NAME} \ - --memory 1024 \ + --vcpus ${VCPUS} \ + --memory ${MEMORY} \ --disk vol=default/${NAME}.qcow2,device=disk \ ${FILESYSTEM} \ --virt-type kvm \