2020-04-24 16:30:07 +08:00
|
|
|
#!/bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
# Cleanup vagrant VMs to avoid name conflicts
|
|
|
|
|
2020-04-29 22:14:24 +08:00
|
|
|
apt-get install -y libvirt-clients
|
|
|
|
|
2020-04-24 16:30:07 +08:00
|
|
|
for i in $(virsh list --name)
|
|
|
|
do
|
|
|
|
virsh destroy "$i"
|
|
|
|
virsh undefine "$i"
|
2020-09-17 23:04:45 +08:00
|
|
|
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
|
2020-04-24 16:30:07 +08:00
|
|
|
done
|