cloud-init removes SharedConfig.XML on new instances of Azure

Bug #1444086 reported by Ben Howard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
walinuxagent (Ubuntu)
Fix Released
High
Unassigned

Bug Description

The Azure DS is removing /var/lib/waagent/SharedConfig.xml on first boot, causing walinuxagent to fail.

Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Attempting to remove /var/lib/waagent/SharedConfig.xml
Apr 14 11:46:24 ubuntu [CLOUDINIT] DataSourceAzure.py[INFO]: removed stale file(s) in '/var/lib/waagent': ['/var/lib/waagent/SharedConfig.xml']
Apr 14 11:46:24 ubuntu [CLOUDINIT] util.py[DEBUG]: Writing to /var/lib/waagent/ovf-env.xml - wb: [384] 1632 bytes
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-vivid-0414-1ce494fec4'] with allowed return codes [0] (shell=False, capture=True)
Apr 14 11:46:24 ubuntu [CLOUDINIT] DataSourceAzure.py[DEBUG]: pubhname: publishing hostname [phostname=ubuntu hostname=daily-vivid-0414-1ce494fec4 policy=True interface=eth0]
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.py[DEBUG]: invoking agent: ['service', 'walinuxagent', 'start']
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.py[WARNING]: Did not find files, but going on: {'/var/lib/waagent/SharedConfig.xml'}
Apr 14 11:47:27 ubuntu [CLOUDINIT] DataSourceAzure.py[WARNING]: SharedConfig.xml missing, using static instance-id

affects: ubuntu → cloud-init (Ubuntu)
Scott Moser (smoser)
Changed in cloud-init (Ubuntu):
status: New → Confirmed
Changed in cloud-init:
status: New → Confirmed
Revision history for this message
Scott Moser (smoser) wrote :

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 ExtensionsConfig.xml
2015/04/14 16:13:44 ERROR:Traceback (most recent call last):
2015/04/14 16:13:44 ERROR: File "/usr/sbin/waagent", line 4600, in AddSystemInfo
2015/04/14 16:13:44 ERROR: sharedConfig = xml.dom.minidom.parse("/var/lib/waagent/SharedConfig.xml").childNodes[0]
2015/04/14 16:13:44 ERROR: File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
2015/04/14 16:13:44 ERROR: return expatbuilder.parse(file)
2015/04/14 16:13:44 ERROR: File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse
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/waagent/SharedConfig.xml'
2015/04/14 16:13:44 ERROR:

Revision history for this message
Scott Moser (smoser) wrote :

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=network.target
   | +Wants=sshd.service sshd-keygen.service
 * Also, be aware of bug 1440180 that fixed cloud-init's (mis)use of network.target.

--
[1] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/systemd/cloud-init.service

Revision history for this message
Scott Moser (smoser) wrote :

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
Revision history for this message
Launchpad Janitor (janitor) wrote :

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
Scott Moser (smoser)
no longer affects: cloud-init
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.