Appendix A. Removing PackStack Deployments

Important

There is no automated uninstall process for undoing a PackStack install. If you have a previously installed version of OpenStack, you will need to uninstall it first, before installing with PackStack.
You can follow either of two procedures. Both are scripts. The first procedure below removes OpenStack, all application data and all packages installed on a base system. The second procedure removes only OpenStack specific application data and packages, although it may also leave some OpenStack related data behind.

Note

These procedures need to be carried out on all OpenStack hosts. Also, some of the commands may give errors if the information which the script is attempting to delete was not created in the first place.

A.1. Completely removing OpenStack, application data and all packages

To completely uninstall a deployment made using PackStack, including all application data and all packages which are installed on a base system, run the script in the following procedure.

Procedure A.1. Removing OpenStack, all application data and all packages installed on a base system

Warning

This script will remove packages including Puppet, httpd, Nagios and others which you may require for other packages. The script will also delete all MySQL databases and Nagios application data.
  • Copy the following script into a file and then run it.
    # Warning! Dangerous step! Destroys VMs
    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 "*nagios*" puppet ntp ntp-perl ntpdate "*openstack*" \
    "*nova*" "*keystone*" "*glance*" "*cinder*" "*swift*" \
    mysql mysql-server httpd "*memcache*" scsi-target-utils \
    iscsi-initiator-utils perl-DBI perl-DBD-MySQL ;
    
    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 ;
    setenforce 1 ;
    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
    
You have now completely uninstalled the OpenStack deployment made using PackStack, including all application data and all packages.