5 echo " Cleanup Started ..."
7 #use the below commands if you needs to delete the virtual machine
8 # also along with envuronment destroy.
11 vm_list=$(sudo virsh list --all)
13 for vm in node1-control node2-compute node3-control node4-control \
14 node5-compute bootstrap
16 echo "$vm_list" | grep -q " $vm " || continue
17 sudo virsh destroy $vm
18 sudo virsh undefine $vm
19 sudo rm -f /var/lib/libvirt/images/${vm}.qcow2
22 echo " Cleanup Finished ..."