xci: Destroy/undefine only the VMs we created 77/32077/2
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Tue, 28 Mar 2017 17:20:37 +0000 (19:20 +0200)
committerMarkos Chandras <mchandras@suse.de>
Wed, 29 Mar 2017 09:49:57 +0000 (09:49 +0000)
Destroying/undefining all the VMs on host might cause issues for the
users. This change tries to reduce the possibility of it by removing
VMs listed by vbmc.

Change-Id: I5134043309722632df68a0800c6403e6f39a8d16
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
prototypes/bifrost/scripts/destroy-env.sh

index 7d3db90..ce9d535 100755 (executable)
@@ -14,14 +14,10 @@ if [[ $(whoami) != "root" ]]; then
     exit 1
 fi
 
-# Delete all VMs on the slave since proposed patchsets
-# may leave undesired VM leftovers
-for vm in $(virsh list --all --name); do
+# Delete all libvirt VMs and hosts from vbmc (look for a port number)
+for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
     virsh destroy $vm || true
     virsh undefine $vm || true
-done
-# Delete all hosts from vbmc (look for a port number)
-for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
     vbmc delete $vm
 done