From 69061efa216c53eb457bedd8cfc545d750ef3c36 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 22 Mar 2018 09:49:33 +0000 Subject: xci: files: xci-destroy-env.sh: Remove VMs from all flavors If we switch from one flavor to another then some VMs may left behind so we need to cleanup the VMs from all flavors. Change-Id: I8b5d400b6d543b32b9cdaff73c3d173984357012 Signed-off-by: Markos Chandras --- xci/files/xci-destroy-env.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xci/files/xci-destroy-env.sh b/xci/files/xci-destroy-env.sh index 9d53dc15..8b811d0f 100755 --- a/xci/files/xci-destroy-env.sh +++ b/xci/files/xci-destroy-env.sh @@ -14,6 +14,8 @@ if [[ $(whoami) != "root" ]]; then exit 1 fi +flavors=(aio mini noha ha) + # Start fresh rm -rf /opt/stack # HOME is normally set by sudo -H @@ -33,14 +35,16 @@ if which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && sourc which vbmc &>/dev/null || { [[ -e /opt/stack/bifrost/bin/activate ]] && deactivate; } fi -# Destroy all XCI VMs if the previous operation failed -[[ -n ${XCI_FLAVOR} ]] && \ +# Destroy all XCI VMs on all flavors +for varfile in ${flavors[@]}; do + source ${XCI_PATH}/xci/config/${varfile}-vars for vm in ${TEST_VM_NODE_NAMES}; do if which virsh &>/dev/null; then virsh destroy $vm || true virsh undefine $vm || true fi done +done service ironic-conductor stop || true @@ -76,3 +80,5 @@ service libvirtd restart service ironic-api restart || true service ironic-conductor start || true service ironic-inspector restart || true + +# vim: set ts=4 sw=4 expandtab: -- cgit 1.2.3-korg