summaryrefslogtreecommitdiffstats
path: root/bifrost
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-03-28 19:20:37 +0200
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-08-11 12:56:12 -0700
commit8ff8b4a87588b7f72632e30bc7c46745214af3ec (patch)
tree22d153620c79c46c1ebef83199e3494146d74207 /bifrost
parentb241c405dada2146d742d3b8fe8c5ede69fe5d24 (diff)
xci: Destroy/undefine only the VMs we created
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>
Diffstat (limited to 'bifrost')
-rwxr-xr-xbifrost/scripts/destroy-env.sh8
1 files changed, 2 insertions, 6 deletions
diff --git a/bifrost/scripts/destroy-env.sh b/bifrost/scripts/destroy-env.sh
index 7d3db90b..ce9d5353 100755
--- a/bifrost/scripts/destroy-env.sh
+++ b/bifrost/scripts/destroy-env.sh
@@ -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