Removed fuel from Genesis master since fuel has moved to repo fuel.
[genesis.git] / compass / deploy / func.sh
1 function tear_down_machines() {
2     virtmachines=$(sudo virsh list --name |grep pxe)
3     for virtmachine in $virtmachines; do
4         echo "destroy $virtmachine"
5         sudo virsh destroy $virtmachine
6         if [[ "$?" != "0" ]]; then
7             echo "destroy instance $virtmachine failed"
8             exit 1
9         fi
10     done
11
12     sudo virsh  list --all|grep shut|awk '{print $2}'|xargs -n 1 sudo virsh undefine
13
14     vol_names=$(sudo virsh vol-list default |grep .img | awk '{print $1}')
15     for vol_name in $vol_names; do
16         echo "virsh vol-delete $vol_name"
17         sudo virsh vol-delete  $vol_name  --pool default
18         if [[ "$?" != "0" ]]; then
19             echo "vol-delete $vol_name failed!"
20             exit 1
21         fi
22     done
23 }