Juju LXC instances are routable after reboot #2281

Merged
merged 6 commits into from May 13, 2015

Conversation

Projects
None yet
2 participants
Contributor

dooferlad commented May 11, 2015

This is a fix for https://bugs.launchpad.net/juju-core/+bug/1442012

This branch adds a maintenance step that is run on daemon start up for each instance that has already been provisioned. For all instance types other than LXC this does nothing.

If jujud finds an LXC instance it will run through the same network provisioning steps as it did when first creating the machine. This already checked to see if a route or IP Tables rule existed before adding them, so there is no harm in running it again, even if the network is set up correctly already. What we have found so far is that routes are not saved across reboots of host machines. We could have solved this by writing a route save and restore init task, but it is difficult to find if such a task already exists. This way we keep all Juju related network configuration inside Juju.

This has been live tested on MAAS by:
juju bootstrap -e maas --upload-tools
juju add-machine -e maas lxc:0

watch juju status # until 0/lxc/0 is in state running
juju ssh 0/lxc/0 "echo hello world"

juju ssh 0 "sudo reboot"
watch juju status # until 0/lxc/0 is in state running
juju ssh 0/lxc/0 "echo hello world"

Repeat with more containers on the same host.

(Review request: http://reviews.vapour.ws/r/1642/)

dooferlad added some commits May 7, 2015

MaintainInstance call added, which is called for LXC units on each st…
…artup. This instructs the host of those containers to check that the network configuration has the correct iptables and route configuration.
Contributor

dooferlad commented May 12, 2015

$$merge$$

Contributor

jujubot commented May 12, 2015

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

Contributor

jujubot commented May 12, 2015

Build failed: Does not match ['fixes-1453805']
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/3199

Contributor

dooferlad commented May 13, 2015

$$merge$$

Contributor

jujubot commented May 13, 2015

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

jujubot added a commit that referenced this pull request May 13, 2015

Merge pull request #2298 from dooferlad/1.23-lxc-reboot
Juju LXC instances are routable after reboot

This is a fix for https://bugs.launchpad.net/juju-core/+bug/1442012

Backport from #2281

Already reviewed at http://reviews.vapour.ws/r/1642/

(Review request: http://reviews.vapour.ws/r/1661/)

jujubot added a commit that referenced this pull request May 13, 2015

Merge pull request #2281 from dooferlad/lxc-reboot
Juju LXC instances are routable after reboot

This is a fix for https://bugs.launchpad.net/juju-core/+bug/1442012

This branch adds a maintenance step that is run on daemon start up for each instance that has already been provisioned. For all instance types other than LXC this does nothing.

If jujud finds an LXC instance it will run through the same network provisioning steps as it did when first creating the machine. This already checked to see if a route or IP Tables rule existed before adding them, so there is no harm in running it again, even if the network is set up correctly already. What we have found so far is that routes are not saved across reboots of host machines. We could have solved this by writing a route save and restore init task, but it is difficult to find if such a task already exists. This way we keep all Juju related network configuration inside Juju.

This has been live tested on MAAS by:
juju bootstrap -e maas --upload-tools
juju add-machine -e maas lxc:0

watch juju status # until 0/lxc/0 is in state running
juju ssh 0/lxc/0 "echo hello world"

juju ssh 0 "sudo reboot"
watch juju status # until 0/lxc/0 is in state running
juju ssh 0/lxc/0 "echo hello world"

Repeat with more containers on the same host.

(Review request: http://reviews.vapour.ws/r/1642/)

@jujubot jujubot merged commit b8f1d3f into juju:master May 13, 2015

@dooferlad dooferlad deleted the dooferlad:lxc-reboot branch Jun 11, 2015

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