From 3d60a515037056dba26ad8cdbb3436b01257206f Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Sun, 19 Nov 2023 18:27:46 +0000 Subject: [PATCH] Undefine VMs upon destroy; Define VMs upon create --- command | 2 +- create | 2 ++ generate-all | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 generate-all diff --git a/command b/command index 97997a2..9816d7e 100755 --- a/command +++ b/command @@ -35,7 +35,7 @@ for VM in $VMS; do ;; destroy) echo "[$VM] Destroying VM" - ssh root@$HVN "/usr/bin/virsh list --all | grep $VM.*running >/dev/null && virsh destroy $VM" + ssh root@$HVN "/usr/bin/virsh list --all | grep $VM.*running >/dev/null && virsh destroy $VM && virsh undefine $VM" echo "[$VM] Destroying ZFS image" ssh root@$HVN "zfs destroy -r vol0/$VM" ;; diff --git a/create b/create index 6e4577d..e72620b 100755 --- a/create +++ b/create @@ -44,4 +44,6 @@ for VM in $VMS; do ssh root@$HVN "umount $STAGING/$VM; zfs snapshot vol0/${VM}@pristine" echo "[$VM] Copying libvirt config" scp -q build/${BUILD}/${HVN}/${VM}/root/libvirt.xml root@$HVN:${LABDIR}/${VM}.xml + echo "[$VM] Defining libvirt config" + ssh root@$HVN "virsh define ${LABDIR}/${VM}.xml" done diff --git a/generate-all b/generate-all new file mode 100755 index 0000000..badbf94 --- /dev/null +++ b/generate-all @@ -0,0 +1,8 @@ +#!/bin/sh + +for o in frr bird; do + for i in `seq 0 3`; do + ./generate --host hvn$i.lab.ipng.ch --overlay $o + done +done +