c12s-kubespray/tests/scripts/vagrant_clean.sh
2020-09-17 08:04:45 -07:00

19 lines
No EOL
361 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
# Cleanup vagrant VMs to avoid name conflicts
apt-get install -y libvirt-clients
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
done