From 7c701a524ad278cd0eb672e51b6deb2615d40d32 Mon Sep 17 00:00:00 2001 From: Bala Raman <1273137+srbala@users.noreply.github.com> Date: Tue, 25 Oct 2022 22:37:00 -0400 Subject: [PATCH] Create create_vm --- utils/create_vm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils/create_vm diff --git a/utils/create_vm b/utils/create_vm new file mode 100644 index 0000000..c76734e --- /dev/null +++ b/utils/create_vm @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Author: @LHKN +# Desc: Handy util to create VMs for testing +vm_name=$1 +iso=$2 +disk_size=$3 + + +sudo virt-install \ + --connect qemu:///system \ + --name "$vm_name" \ + --memory 16384 \ + --vcpus "4" \ + --cdrom "$iso" \ + --os-variant almalinux8 \ + --disk size="$disk_size",format=qcow2 \ + --network network=default,model=virtio \ + --video model=virtio \ + --graphics vnc,listen=0.0.0.0 --noautoconsole \ + --virt-type kvm