From 5ef9d3138711eda903d62a43c3675e7cf358b1d7 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 1 Mar 2024 23:22:13 +0800 Subject: [PATCH] Add jammy --- virt-install-all.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/virt-install-all.sh b/virt-install-all.sh index b71da01..c0739ee 100755 --- a/virt-install-all.sh +++ b/virt-install-all.sh @@ -104,6 +104,32 @@ focal() rm -f "$xml" /var/lib/libvirt/ephemeral/focal_libvirt_"${hostname}_${id}".{iso,qcow2} } +jammy() +{ + id="$1" + qemu-img create -b /var/lib/libvirt/backingstore/jammy.qcow2 \ + -f qcow2 -F qcow2 \ + /var/lib/libvirt/ephemeral/jammy_libvirt_"${hostname}_${id}".qcow2 + cloud-localds /var/lib/libvirt/ephemeral/jammy_libvirt_"${hostname}_${id}".iso \ + /var/lib/libvirt/backingstore/jammy.user + + virsh undefine jammy_libvirt_"${hostname}_${id}" + + xml=$(mktemp) + + virt-install -r "$mempercore" --vcpus=2,maxvcpus=2,sockets=1,cores=1,threads=2 \ + -n jammy_libvirt_"${hostname}_${id}" -w network=default --nographics \ + --disk path=/var/lib/libvirt/ephemeral/jammy_libvirt_"${hostname}_${id}".qcow2 \ + --disk path=/var/lib/libvirt/ephemeral/jammy_libvirt_"${hostname}_${id}".iso,device=cdrom \ + --import --noautoconsole \ + --print-xml --dry-run --check disk_size=off,path_in_use=off \ + --boot=hd --os-type=Linux --os-variant ubuntu18.04 > "$xml" + + virsh define "$xml" + + rm -f "$xml" /var/lib/libvirt/ephemeral/jammy_libvirt_"${hostname}_${id}".{iso,qcow2} +} + elcapitan() { local id @@ -163,4 +189,7 @@ wait for i in $(seq "$cores"); do focal "$i" & done +for i in $(seq "$cores"); do + jammy "$i" & +done wait