Ignore the 'already initialized' error from lxd init #6765

Merged
merged 1 commit into from Jan 4, 2017

Conversation

Projects
None yet
3 participants
Contributor

natefinch commented Jan 4, 2017

Fixes https://bugs.launchpad.net/juju/+bug/1652161

QA:

  1. juju bootstrap (anything other than LXD)
  2. juju add-machine lxd
  3. (wait for machine to come up)
  4. juju ssh 0 sudo reboot
  5. (wait for machine to reboot)
  6. juju add-machine lxd:0
  7. (wait for container to boot up)
  8. juju status, see 0/lxd/1 is started

Descrition:

Previously, after adding the second container (post reboot), the container would be stuck in pending, and you'd see this in the default model's machine-0 log:

2016-12-22 21:00:16 INFO juju.worker runner.go:262 stopped "0-container-watcher", err: worker "0-container-watcher" exited: setting up container dependencies on host machine: while running lxd init --auto: LXD init cannot be used at this time.
However if all you want to do is reconfigure the network,
you can still do so by running "sudo dpkg-reconfigure -p medium lxd"

error: You have existing containers or images. lxd init requires an empty LXD.
: exit status 1

This is because we'd re-run lxd init on starting the machine, and we actually return the errors it produces, and evidently it's been erroring out every timne we reboot, we just never noticied because we swallow it.

Now we return the error, but we check for the "already initialized" error and ignore just that one.

Contributor

natefinch commented Jan 4, 2017

$$merge$$

Contributor

jujubot commented Jan 4, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 4a7fcff into juju:2.1-dynamic-bridges Jan 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment