summaryrefslogtreecommitdiffstats
path: root/mcp/scripts
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-08 15:19:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-08 15:19:21 +0000
commite53acf41e4659140e3f78794765bb87f1dc59136 (patch)
tree6d73f79a2b77ab13e615266c8b499e2349c32399 /mcp/scripts
parent32b75cc293bf0402302ee674a0a0064456d219c7 (diff)
parent3e45721b819ec16e8cf164a42725bc1d30614581 (diff)
Merge "lib.sh: Remove all storage on undefine"
Diffstat (limited to 'mcp/scripts')
-rw-r--r--mcp/scripts/lib.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index 1812663d3..d9b5e6385 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -34,7 +34,9 @@ cleanup_vms() {
virsh destroy "${node}"
done
for node in $(virsh list --name --all | grep -P '\w{3}\d{2}'); do
- virsh undefine --nvram "${node}"
+ virsh domblklist "${node}" | awk '/^.da/ {print $2}' | \
+ xargs --no-run-if-empty -I{} sudo rm -f {}
+ virsh undefine "${node}" --remove-all-storage --nvram
done
}
@@ -45,6 +47,7 @@ prepare_vms() {
cleanup_vms
get_base_image "${base_image}" "${image_dir}"
+ # shellcheck disable=SC2016
envsubst '${SALT_MASTER},${CLUSTER_DOMAIN}' < \
user-data.template > user-data.sh