Skip to content

Instantly share code, notes, and snippets.

@anjannath
Created December 12, 2018 06:20
Show Gist options
  • Save anjannath/083c09b5f84555c53b047591e740c1d2 to your computer and use it in GitHub Desktop.
Save anjannath/083c09b5f84555c53b047591e740c1d2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
vol_list=$(sudo virsh vol-list --pool default | grep test1 | awk '{print $1}')
for vol in $vol_list
do
sudo virsh vol-delete $vol --pool default
done
sudo virsh net-destroy test1
sudo virsh net-undefine test1
dom_list=$(sudo virsh list --all | grep test1 | awk '{print $2}')
for dom in $dom_list
do
sudo virsh destroy $dom
sudo virsh undefine $dom
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment