Commit 3f256fe8 authored by Dan Radez's avatar Dan Radez

updates to cleanup.sh

- adding vol-delete to help ensure volumes are cleaned up
- adding brbm clean up

Change-Id: I3cbb79b09c6ac77dbc3c452938dbd6a6d03c815b
parent f2bddf8a
#!/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"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment