1

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?

2 Answers 2

4

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.

3

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

You can file a bug here: https://bugs.launchpad.net/juju-core requesting the feature though :)

2
  • Thanks, but is there any way I can suspend them without destroying them?
    – ariskk
    Jan 30, 2014 at 10:34
  • @ariskk see thumper's answer on how to do it via LXC manually
    – hatch
    Jan 31, 2014 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .