summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2015-11-17 19:13:37 -0500
committerDan Radez <dradez@redhat.com>2015-11-18 09:23:03 -0500
commit3f256fe8fdb4d37387314ab4657b08b7ade364cf (patch)
treeae287f292f8edd09bec4fd708c22784e1792189c
parentf2bddf8acd6f2d702209b1dda74e93afd6b78ff3 (diff)
updates to cleanup.sh
- adding vol-delete to help ensure volumes are cleaned up - adding brbm clean up Change-Id: I3cbb79b09c6ac77dbc3c452938dbd6a6d03c815b
-rwxr-xr-xci/clean.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/ci/clean.sh b/ci/clean.sh
index 265c8484..492b0dc2 100755
--- a/ci/clean.sh
+++ b/ci/clean.sh
@@ -1,17 +1,31 @@
#!/usr/bin/env bash
-#Clean script to uninstall provisioning server for Foreman/QuickStack
+#Clean script to uninstall provisioning server for Apex
#author: Dan Radez (dradez@redhat.com)
#
-#Uses Vagrant and VirtualBox
-#
vm_index=4
+
+# Clean off instack VM
virsh destroy instack 2> /dev/null || echo -n ''
virsh undefine instack --remove-all-storage 2> /dev/null || echo -n ''
-
+virsh vol-delete instack.qcow2 default 2> /dev/null
rm -f /var/lib/libvirt/images/instack.qcow2 2> /dev/null
+
+# Clean off baremetal VMs in case they exist
for i in $(seq 0 $vm_index); do
virsh destroy baremetalbrbm_brbm1_$i 2> /dev/null || echo -n ''
virsh undefine baremetalbrbm_brbm1_$i --remove-all-storage 2> /dev/null || echo -n ''
+ virsh vol-delete baremetalbrbm_brbm1_${i}.qcow2 default 2> /dev/null
rm -f /var/lib/libvirt/images/baremetalbrbm_brbm1_${i}.qcow2 2> /dev/null
done
+
+# Clean off brbm bridges
+virsh net-destroy brbm 2> /dev/null
+virsh net-undefine brbm 2> /dev/null
+vs-vsctl del-br brbm 2> /dev/null
+
+virsh net-destroy brbm1 2> /dev/null
+virsh net-undefine brbm1 2> /dev/null
+vs-vsctl del-br brbm1 2> /dev/null
+
+echo "Cleanup Completed"