Completely remove openstack from system after installation from devstack script

24,873

Solution 1

The unstack.sh script only stops the services without removing them. Devstack's folder contains a clean.sh script that removes openstack and dependencies so you can run something like this:

cd path/to/devstack

# There's no need to call unstack.sh explicitly
# clean.sh invokes that script itself.
./clean.sh

Solution 2

Follow the following 3 steps:

  1. ./clean.sh
  2. rm -rf /opt/stack
  3. rm -rf /usr/local/bin (careful, this will remove everything installed to your local bin folder, which might include previously installed applications).

For more info of all the impacted files and directories this link.

Solution 3

unstack doesn't clean out /opt/stack. or purge all dependency packages. or clean all eggs out of python.

I recommend running devstack in a VM. It's easy enough to simply remove the VM and rebuild from scratch.

Example shell script for creating a devstack VM for kvm:

#!/bin/sh

/usr/bin/vmbuilder kvm ubuntu -v --suite=oneiric --libvirt=qemu:///system --flavour=server --arch=amd64 --cpus=2 --mem=4096 --swapsize=2048 --rootsize=30480 --ip=192.168.122.236 --hostname=devstack --user=stack --name=stack --pass=stack --addpkg=git --addpkg=screen --addpkg=vim --addpkg=strace --addpkg=lsof --addpkg=nmap --addpkg=subversion --addpkg=acpid --addpkg=tcpdump --addpkg=python-pip --addpkg=wget --addpkg=htop --mirror=http://us.archive.ubuntu.com/ubuntu --components='main,universe' --addpkg=openssh-server --dns=8.8.8.8 --dest=/virts/devstack
Share:
24,873
Apurva Mayank
Author by

Apurva Mayank

Updated on July 09, 2022

Comments

  • Apurva Mayank
    Apurva Mayank almost 2 years

    I am installing OpenStack on my local machine via this link. But I am having trouble in completely removing installed components from my local machine. I ran following command:-

    $ sudo ./unstack.sh
    tgtadm: can't send the request to the tgt daemon, Transport endpoint is not connected
    tgtd seems to be in a bad state, restarting...
    stop: Unknown instance: 
    tgt start/running, process 14629
    tgt stop/waiting
    Volume group "stack-volumes" not found
    Skipping volume group stack-volumes
    

    And file are still present in /opt/stack and /usr/local/bin/. But manually removing these file will not be a good option.