summaryrefslogtreecommitdiffstats
path: root/bifrost
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-07-26 11:25:22 +0100
committerMarkos Chandras <mchandras@suse.de>2017-08-17 13:48:06 +0000
commit5b0410aa4f51e50df6b171cf8592a7bfaa6de796 (patch)
treef132c92dd4feab8ee2152e2461e76b95abb24563 /bifrost
parentc7ceaa77fba0d3dbe0ca802d0b4c159f38b6cbf9 (diff)
prototypes: bifrost: destroy-env: Always destroy XCI VMs
It's possible that a previous run failed before registering the VMs to the vbmc. As such, consulting the vbmc to retrieve the VM names will return nothing and no VM will be deleted. As such, it's best to get the VMs from the currently XCI profile and make sure they are really gone. Change-Id: If11265655f42c8a1c7627c9139ac0cbfc002b1fe Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'bifrost')
-rwxr-xr-xbifrost/scripts/destroy-env.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/bifrost/scripts/destroy-env.sh b/bifrost/scripts/destroy-env.sh
index c75e814b..87f792a5 100755
--- a/bifrost/scripts/destroy-env.sh
+++ b/bifrost/scripts/destroy-env.sh
@@ -25,6 +25,12 @@ for vm in $(vbmc list | awk '/[0-9]/{{ print $2 }}'); do
virsh undefine $vm || true
vbmc delete $vm
done
+# Destroy all XCI VMs if the previous operation failed
+[[ -n ${XCI_FLAVOR} ]] && \
+ for vm in ${TEST_VM_NODE_NAMES}; do
+ virsh destroy $vm || true
+ virsh undefine $vm || true
+ done
service ironic-conductor stop || true