cloud-init removes SharedConfig.XML on new instances of Azure
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | walinuxagent (Ubuntu) |
High
|
Ben Howard | ||
Bug Description
The Azure DS is removing /var/lib/
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Attempting to remove /var/lib/
Apr 14 11:46:24 ubuntu [CLOUDINIT] DataSourceAzure
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Running command hostname with allowed return codes [0] (shell=False, capture=True)
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Running command ['hostname', 'daily-
Apr 14 11:46:24 ubuntu [CLOUDINIT] DataSourceAzure
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Read 11 bytes from /proc/uptime
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Running command ['sh', '-xc', 'i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x'] with allowed return codes [0] (shell=False, capture=False)
Apr 14 11:46:26 ubuntu [CLOUDINIT] util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
Apr 14 11:46:26 ubuntu [CLOUDINIT] util.py[DEBUG]: Read 11 bytes from /proc/uptime
Apr 14 11:46:26 ubuntu [CLOUDINIT] util.py[DEBUG]: publishing hostname took 2.119 seconds (2.12)
Apr 14 11:46:26 ubuntu [CLOUDINIT] DataSourceAzure
Apr 14 11:46:26 ubuntu [CLOUDINIT] util.py[DEBUG]: Running command ['service', 'walinuxagent', 'start'] with allowed return codes [0] (shell=False, capture=True)
Apr 14 11:47:27 ubuntu [CLOUDINIT] util.py[DEBUG]: waiting for files took 60.959 seconds
Apr 14 11:47:27 ubuntu [CLOUDINIT] DataSourceAzure
Apr 14 11:47:27 ubuntu [CLOUDINIT] DataSourceAzure
| affects: | ubuntu → cloud-init (Ubuntu) |
| Changed in cloud-init (Ubuntu): | |
| status: | New → Confirmed |
| Changed in cloud-init: | |
| status: | New → Confirmed |
| Scott Moser (smoser) wrote : | #1 |
| Scott Moser (smoser) wrote : | #2 |
i'm pretty sure this is a systemd loop caused by cloud-init and wallinuxagent
* cloud-init's cloud-init.service [1] is issuing 'service walinuxagent start'
* walinux-agent's systemd job:
| +After=
| +Wants=sshd.service sshd-keygen.service
* Also, be aware of bug 1440180 that fixed cloud-init's (mis)use of network.target.
--
[1] http://
| Scott Moser (smoser) wrote : | #3 |
bug 1425376 has more information than bug 1440180 about network.target, but for some reason slangasek closed 1440180 in the cloud-init changelog wiht his fix.
| Changed in cloud-init (Ubuntu): | |
| assignee: | nobody → Ben Howard (utlemming) |
| affects: | cloud-init (Ubuntu) → walinuxagent (Ubuntu) |
| Changed in walinuxagent (Ubuntu): | |
| assignee: | Ben Howard (utlemming) → nobody |
| assignee: | nobody → Ben Howard (utlemming) |
| importance: | Undecided → High |
| Launchpad Janitor (janitor) wrote : | #4 |
This bug was fixed in the package walinuxagent - 2.0.12-0ubuntu2
---------------
walinuxagent (2.0.12-0ubuntu2) vivid; urgency=medium
* Fixed systemd unit file which caused SharedConfig.xml to be deleted by
Cloud-init (LP: #1444086).
-- Ben Howard <email address hidden> Wed, 15 Apr 2015 10:59:38 -0600
| Changed in walinuxagent (Ubuntu): | |
| status: | Confirmed → Fix Released |
| no longer affects: | cloud-init |


so, to give an idea on what happens here.
cloud-init boots, finds its on azure, and then runs:
service walinuxagent start
it expects that that will produce some files in some amount of time (60 seconds).
if it does not find those, it complains and goes on.
/var/log/ waagent. log has similar messages about missing sharedconfig.xml
2015/04/14 16:13:44 Finished processing ExtensionsConfi g.xml waagent" , line 4600, in AddSystemInfo minidom. parse(" /var/lib/ waagent/ SharedConfig. xml").childNode s[0] python2. 7/xml/dom/ minidom. py", line 1918, in parse parse(file) python2. 7/xml/dom/ expatbuilder. py", line 922, in parse waagent/ SharedConfig. xml'
2015/04/14 16:13:44 ERROR:Traceback (most recent call last):
2015/04/14 16:13:44 ERROR: File "/usr/sbin/
2015/04/14 16:13:44 ERROR: sharedConfig = xml.dom.
2015/04/14 16:13:44 ERROR: File "/usr/lib/
2015/04/14 16:13:44 ERROR: return expatbuilder.
2015/04/14 16:13:44 ERROR: File "/usr/lib/
2015/04/14 16:13:44 ERROR: fp = open(file, 'rb')
2015/04/14 16:13:44 ERROR:IOError: [Errno 2] No such file or directory: '/var/lib/
2015/04/14 16:13:44 ERROR: