This commit is contained in:
Stephen Simpson
2025-11-26 08:15:00 -06:00
parent 3cbd4525a0
commit bb829c9b63
18 changed files with 2440 additions and 349 deletions

14
scripts/cleanup-all.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
PATTERN="${1:-.*}"
echo "Cleaning up VMs matching: $PATTERN"
for vm in $(virsh -c qemu:///system list --all --name | grep -E "$PATTERN"); do
echo "Destroying $vm"
virsh -c qemu:///system destroy "$vm" 2>/dev/null || true
virsh -c qemu:///system undefine "$vm" 2>/dev/null || true
rm -f "/var/lib/libvirt/images/${vm}.qcow2" 2>/dev/null || true
done
echo "Cleanup complete"