4

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.

Christian Berendt
  • 3,416
  • 2
  • 13
  • 22
Apurva Mayank
  • 721
  • 2
  • 12
  • 32

3 Answers3

24

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
Roman Prykhodchenko
  • 12,655
  • 8
  • 29
  • 33
6

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.

Alexander Craggs
  • 7,874
  • 4
  • 24
  • 46
DhruvKalaria
  • 125
  • 2
  • 7
  • 5
    Careful, there might be other things in /usr/local/bin prior to devstack. – Joe D'Andrea Mar 14 '16 at 21:06
  • 2
    **Highly recommend** using `rm -f /usr/local/bin/openstack*` in place of step 3 as listed in this post. This command will forcefully remove the scripts `openstack` and `openstack-inventory` and any others that begin with "openstack" from your `/usr/local/bin/` folder. – Steven K7FAQ May 18 '19 at 17:36
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
Matt Joyce
  • 2,010
  • 2
  • 20
  • 31