Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm doing some testing and sometimes I have issues with containers and juju. How do I clean up a machine so that I can start using the local provider "from scratch" without reinstalling?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

LXC containers and the Juju environment need to persist through a reboot, so everything is not contained in one place.

First, ensure that you have the environment destroyed and the containers are not running. Then remove the following files and directories:

/etc/init/juju-* 
/etc/lxc/auto/juju-*
/etc/rsyslog.d/25-juju* 
/var/lib/juju/containers/* 
/var/lib/lxc/juju-* 
~/.juju/<env> 
~/.juju/environments/<env>.jenv

Then you can reboostrap with a clean environment.

In certain cases you might need to list, stop, and destroy containers by hand, do this before removing the Juju files.

share|improve this answer
    
This 2 command didn't work for me: sudo rm -r /etc/lxc/auto/juju-* AND sudo rm -r /var/lib/lxc/juju-* –  mini Mar 8 at 17:05

You might find the following snippet I use helpful:

http://blog.naydenov.net/2014/03/remove-juju-local-environment-cleanly/

It's a bash script that needs to be run as root, and it tries to clean up aggressively all remnants of a local juju environment, including LXC templates, containers, logs, running mongodb test servers, etc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.