should not provide /etc/cloud/cloud.cfg.d/91_walinuxagent.cfg

Bug #1700769 reported by Scott Moser
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
walinuxagent (Ubuntu)
Fix Released
Medium
Łukasz Zemczak

Bug Description

I noticed on an azure instance that I had a file /etc/cloud/cloud.cfg.d/91_walinuxagent.cfg.
$ cat /etc/cloud/cloud.cfg.d/91_walinuxagent.cfg
# This configuration file is provided by the WALinuxAgent package.
datasource_list: [ Azure ]

This puts unnecessary and even harmful configuration into cloud-init.

Consider:
 a.) launch a container
 b.) install walinuxagent
 c.) reboot -- FAIL

on reboot, cloud-init will not find the NoCloud datasource that it should use in an lxc container.

Additionally, this is not really necessary any more with the 'ds-identify' code that is in cloud-init as it will identify the platform and do effectively the same thing as the static config.

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: walinuxagent 2.2.12-0ubuntu1~17.04.1
ProcVersionSignature: User Name 4.10.0-24.28-generic 4.10.15
Uname: Linux 4.10.0-24-generic x86_64
ApportVersion: 2.20.4-0ubuntu4.1
Architecture: amd64
Date: Tue Jun 27 13:55:58 2017
ProcEnviron:
 TERM=screen.xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: walinuxagent
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Moser (smoser) wrote :
Scott Moser (smoser)
Changed in walinuxagent (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On which releases ds-identify is enabled by default? E.g. do we need to keep that snippet for e.g. xenial/yakkety?

Changed in walinuxagent (Ubuntu):
assignee: nobody → Łukasz Zemczak (sil2100)
Revision history for this message
Scott Moser (smoser) wrote :

cloud-init uses ds-identify on yakkety+ at this point.
xenial is still in reporting only mode.

Perhaps we should hold this fix in xenial until the point in which cloud-init enables ds-identify there.
That said, its not strictly necessary as the shortened list doesn't really do much except for stop some other datasources from doing their quick check.

Revision history for this message
Krzysztof (kwarzecha7) wrote :

This bug prevents me from using NoCloud datasource with http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.vhd.zip and Hyper-V on Windows Server 2012r2.

Cloud-init will not load settings from nocloud.iso attached to vm unless I delete /etc/cloud/cloud.cfg.d/91_walinuxagent.cfg file.

Snippet from the logs:

Before removing:

2018-01-17 00:43:43,241 - __init__.py[DEBUG]: Looking for for data source in: ['Azure'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM']
2018-01-17 00:43:43,297 - __init__.py[DEBUG]: Searching for local data source in: ['DataSourceAzure']
2018-01-17 00:43:44,481 - __init__.py[DEBUG]: Looking for for data source in: ['Azure'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']
2018-01-17 00:43:44,503 - __init__.py[DEBUG]: Searching for network data source in: []
cloudinit.sources.DataSourceNotFoundException: Did not find any data source, searched classes: ()

After removing the file:

2018-01-17 01:03:02,335 - __init__.py[DEBUG]: Looking for for data source in: ['NoCloud', 'ConfigDrive', 'OpenNebula', 'DigitalOcean', 'Azure', 'AltCloud', 'OVF', 'MAAS', 'GCE', 'OpenStack', 'CloudSigma', 'SmartOS', 'Bigstep', 'Scaleway',
'AliYun', 'Ec2', 'CloudStack', 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM']
2018-01-17 01:03:02,480 - __init__.py[DEBUG]: Searching for local data source in: ['DataSourceNoCloud', 'DataSourceConfigDrive', 'DataSourceOpenNebula', 'DataSourceDigitalOcean', 'DataSourceAzure', 'DataSourceOVF', 'DataSourceCloudSigma',
'DataSourceSmartOS', 'DataSourceEc2Local']

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

Kryzsztof,

I'm curious why you would use the .vhd file. Is there something specific that you wanted from it *other* than the format of the disk image?

If not, then you most likely can just grab the .img file (qcow2) and use qemu-img to convert it to vhd.

I do realize that converting a disk image is a pain, and sometimes more painful than it should be.
And in the past I know I had to employ vboxconvert (from virtualbox) to get something that windows was happy with. https://gist.github.com/smoser/5364534 might be of assistance, but I failed to document it well enough and a lot of context is since left my head.

Revision history for this message
Dan Watkins (oddbloke) wrote : Re: [Bug 1700769] Re: should not provide /etc/cloud/cloud.cfg.d/91_walinuxagent.cfg

On Wed, Jan 17, 2018 at 03:32:32PM -0000, Scott Moser wrote:
> I'm curious why you would use the .vhd file. Is there something
> specific that you wanted from it *other* than the format of the disk
> image?

The VHD contains Hyper-V-specific customisations (such as the
linux-azure kernel), so there is a compelling reason to want to use it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package walinuxagent - 2.2.21+really2.2.20-0ubuntu2

---------------
walinuxagent (2.2.21+really2.2.20-0ubuntu2) bionic; urgency=medium

  * Do not provide config to cloud-init specifying datasource_list.
    (LP: #1700769)

 -- Scott Moser <email address hidden> Fri, 23 Feb 2018 13:17:20 -0500

Changed in walinuxagent (Ubuntu):
status: Confirmed → Fix Released
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.