Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running juju on my local box using the local provider (LXC).

I've 3 machines at the moment. Since this is probably using resources and I need it occasionally, I would like to shut it down (without losing my data or any other state) and restart (bootstrap?) it from the command line.

However, I can't find a way to just shut down all machines without losing the setup and the data.

Is there a way to shut it down and restart it from command line?

share|improve this question
up vote 4 down vote accepted

As mentioned by @hatch, there is currently no command to deal with this.

You can however do it manually.

All of the lxc containers are named after the user and the name of the environment.

So let's say that your user-id is 'tim' (mine is), and the environment is 'testlocal', if you have three machines (other than machine 0 which is actually the host), you can go:

sudo lxc-stop -n tim-testlocal-machine-1
sudo lxc-stop -n tim-testlocal-machine-2
sudo lxc-stop -n tim-testlocal-machine-3

You can then stop the machine agent and db server on the host machine.

sudo stop juju-agent-tim-testlocal
sudo stop juju-db-tim-testlocal

To bring it back up, just reverse the steps:

sudo start juju-db-tim-testlocal
sudo start juju-agent-tim-testlocal

And then bring up the lxc containers

sudo lxc-start -n tim-testlocal-machine-1
sudo lxc-start -n tim-testlocal-machine-2
sudo lxc-start -n tim-testlocal-machine-3

That should be sufficient.

share|improve this answer

At the time of writing (Juju 1.17.1) it's not possible to suspend machines through juju.

You can file a bug here: requesting the feature though :)

share|improve this answer
Thanks, but is there any way I can suspend them without destroying them? – ariskk Jan 30 '14 at 10:34
@ariskk see thumper's answer on how to do it via LXC manually – hatch Jan 31 '14 at 14:15
Thanks, it works. – ariskk Feb 1 '14 at 2:27

Your Answer


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.