LXD containers fail to upgrade because the bridge config changes to a different IP address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
Critical
|
Andrew McDermott |
Bug Description
It's not possible to run:
$ juju upgrade-juju --upload-tools
when a container has been deployed and for the container to be upgrade in line with the version running on its host.
The steps are:
0) bootstrap (on MAAS)
1) juju add-machine lxd:0
2) juju upgrade-juju --upload-tools
Post the upgrade you see a mismatch between the version on the containers host and the container itself:
model: admin
machines:
"0":
juju-status:
current: started
since: 12 Apr 2016 14:02:18+01:00
version: 2.0-beta4.2
dns-name: 10.17.20.201
instance-id: /MAAS/api/
machine-status:
current: running
message: Deployed
since: 12 Apr 2016 13:47:05+01:00
series: xenial
containers:
0/lxd/0:
current: started
since: 12 Apr 2016 13:52:48+01:00
version: 2.0-beta4.1
dns-name: 10.17.20.202
current: running
message: Container started
since: 12 Apr 2016 13:51:27+01:00
series: xenial
hardware: arch=amd64 cpu-cores=1 mem=1024M availability-
controller-
This happens because the container cannot reach the API server and that happens because (*I think*) the `lxd init' runs again and changes the setup of /etc/default/
The 1/etc/... and 2/etc... paths refer to the steps above (i.e., 1/etc/... is a capture after add-machine and 2/etc/... is after the upgrade step).
--- 1/etc/default/
+++ 2/etc/default/
@@ -20,16 +20,16 @@
# IPv4
## IPv4 address (e.g. 10.0.8.1)
-LXD_IPV4_
+LXD_IPV4_
## IPv4 netmask (e.g. 255.255.255.0)
LXD_IPV4_
## IPv4 network (e.g. 10.0.8.0/24)
-LXD_IPV4_
+LXD_IPV4_
## IPv4 DHCP range (e.g. 10.0.8.
-LXD_IPV4_
+LXD_IPV4_
## IPv4 DHCP number of hosts (e.g. 250)
LXD_IPV4_
@@ -53,4 +53,8 @@
# Run a minimal HTTP PROXY server
LXD_IPV6_
-EXISTING_BRIDGE=
+EXISTING_BRIDGE=""
There is also a difference with the apiaddresses between steps (1) and (2):
ubuntu@node1:~$ diff -u {1,2}/var/
--- 1/var/lib/
+++ 2/var/lib/
@@ -7,7 +7,7 @@
jobs:
- JobManageModel
- JobHostUnits
-upgradedToVersion: 2.0-beta4.1
+upgradedToVersion: 2.0-beta4.2
cacert: |
-----BEGIN CERTIFICATE-----
MIICxTCCAi6g
@@ -31,6 +31,7 @@
statepassword: kerSShV9Tkg4vkY
model: model-2d4e133e-
apiaddresses:
+- 10.0.4.1:17070
- 10.17.20.201:17070
apipassword: kerSShV9Tkg4vkY
oldpassword: c7f003d4ec1c6f3
But NOT between steps (0) and (1):
diff -u {0,1}/var/
<empty result>
Looking at the containers log: machine-0-lxd-0.log
You see the upgrade trying to make progress:
2016-04-12 13:02:52 INFO juju.worker.
2016-04-12 13:02:52 INFO juju.worker.
2016-04-12 13:02:52 INFO juju.worker.
But (from the container) there is nothing listening at this address:
root@juju-
Trying 10.0.4.1...
And back on the containers host the bridge is now 10.0.5.1
$ ifconfig -a lxdbr0
lxdbr0 Link encap:Ethernet HWaddr 62:95:97:93:bc:3e
inet addr:10.0.5.1 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fe80::6095:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:0 (0.0 B) TX bytes:570 (570.0 B)
Perhaps the upgrade step should try on all API addresses:
$ sudo cat /var/lib/
apiaddresses:
- 10.0.4.1:17070
- 10.17.20.201:17070
In capturing the output from this bug it's not entirely clear to me how the LXD bridge went from 10.0.1.1 to 10.0.5.1 but the only recorded address in agents.conf is 10.0.4.1. Perhaps it is related to the `lxd init' step which will trigger everytime the MA is started.
The net effect is that the containers upgrade step never completes.
summary: |
- LXD containers fail to upgrade because the bridge config changes on each - upgrade step + LXD containers fail to upgrade because the bridge config changes to a + different IP address |
tags: | added: network |
Changed in juju-core: | |
status: | New → Triaged |
milestone: | none → 2.0-rc1 |
importance: | Undecided → Critical |
Changed in juju-core: | |
assignee: | nobody → Andrew McDermott (frobware) |
Changed in juju-core: | |
status: | Triaged → Fix Committed |
Changed in juju-core: | |
milestone: | 2.0-beta5 → 2.0-rc1 |
Changed in juju-core: | |
milestone: | 2.0-beta6 → 2.0-beta7 |
Changed in juju-core: | |
milestone: | 2.0-beta7 → 2.0-beta8 |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
affects: | juju-core → juju |
Changed in juju: | |
milestone: | 2.0-beta8 → none |
milestone: | none → 2.0-beta8 |
RB (for next) - http:// reviews. vapour. ws/r/4538/