From 5b0410aa4f51e50df6b171cf8592a7bfaa6de796 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 26 Jul 2017 11:25:22 +0100 Subject: 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 --- bifrost/scripts/destroy-env.sh | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit 1.2.3-korg