kubespray/tests/scripts/vagrant_clean.sh

18 lines
326 B
Bash
Raw Normal View History

#!/bin/bash
set -euxo pipefail
# Cleanup vagrant VMs to avoid name conflicts
for i in $(virsh list --name)
do
virsh destroy "$i"
virsh undefine "$i"
done
# Cleanup domain volumes
for i in $(virsh vol-list default|grep \.img |grep -v VAGRANTSLASH | cut -f 2 -d ' ')
do
virsh vol-delete "$i" --pool default
2023-02-06 17:35:16 +08:00
done