diff options
author | Miroslav Suchý <msuchy@redhat.com> | 2014-09-19 12:15:40 +0000 |
---|---|---|
committer | Miroslav Suchý <msuchy@redhat.com> | 2014-09-19 12:15:40 +0000 |
commit | b623d607def915139f28635b22d9614527cf923c (patch) | |
tree | 0866f5298df43b6a49ef1f922afe58c17883de05 | |
parent | 53650fca7c5b7ca0701c0809235224a4b288ca93 (diff) | |
download | ansible-b623d607def915139f28635b22d9614527cf923c.tar.gz ansible-b623d607def915139f28635b22d9614527cf923c.tar.xz ansible-b623d607def915139f28635b22d9614527cf923c.zip |
add uninstall.sh script
this is to wipe OpenStack instance the hard way.
Do not run it mortals!
-rw-r--r-- | files/fedora-cloud/uninstall.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/files/fedora-cloud/uninstall.sh b/files/fedora-cloud/uninstall.sh new file mode 100644 index 000000000..a2d261849 --- /dev/null +++ b/files/fedora-cloud/uninstall.sh @@ -0,0 +1,32 @@ +# Warning! Dangerous step! Destroys VMs +# if you do know what you are doing feel free to remove the line below to proceed +exit 1 +# also if you really insist to remove VM, uncomment that vgremove near bottom + +for x in $(virsh list --all | grep instance- | awk '{print $2}') ; do + virsh destroy $x ; + virsh undefine $x ; +done ; + +# Warning! Dangerous step! Removes lots of packages, including many +# which may be unrelated to RDO. +yum remove -y nrpe "*openstack*" \ +"*nova*" "*keystone*" "*glance*" "*cinder*" "*swift*" \ +mysql mysql-server httpd "*memcache*" ; + +ps -ef | grep -i repli | grep swift | awk '{print $2}' | xargs kill ; + +# Warning! Dangerous step! Deletes local application data +rm -rf /etc/nagios /etc/yum.repos.d/packstack_* /root/.my.cnf \ +/var/lib/mysql/* /var/lib/glance /var/lib/nova /etc/nova /etc/swift \ +/srv/node/device*/* /var/lib/cinder/ /etc/rsync.d/frag* \ +/var/cache/swift /var/log/keystone ; + +umount /srv/node/device* ; +killall -9 dnsmasq tgtd httpd ; +#vgremove -f cinder-volumes ; +losetup -a | sed -e 's/:.*//g' | xargs losetup -d ; +find /etc/pki/tls -name "ssl_ps*" | xargs rm -rf ; +for x in $(df | grep "/lib/" | sed -e 's/.* //g') ; do + umount $x ; +done |