You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
361 B

  1. #!/bin/bash
  2. set -euxo pipefail
  3. # Cleanup vagrant VMs to avoid name conflicts
  4. apt-get install -y libvirt-clients
  5. for i in $(virsh list --name)
  6. do
  7. virsh destroy "$i"
  8. virsh undefine "$i"
  9. done
  10. # Cleanup domain volumes
  11. for i in $(virsh vol-list default|grep \.img |grep -v VAGRANTSLASH | cut -f 2 -d ' ')
  12. do
  13. virsh vol-delete "$i" --pool default
  14. done