Need to convince cloud-init we really want Ec2 datasource

Bug #1683038 reported by Simon Leinen on 2017-04-15
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Simon Leinen

Bug Description

cloud-init was recently changed to be more selective about the types of data source it wants to access. See In particular, when it is run on a non-EC2 cloud and sees EC2 metadata, it recently started to print annoying warnings to the user.

When we add the "Ec2" datasource to images, we should also generate a workaround that suppresses the warning. According to the warning itself, this can be achieved by adding a file /etc/cloud/cloud.cfg.d/99-ec2-datasource.cfg that says

    strict_id: false

An alternative would be to live with the warnings, and hope that DIB users select other datasources in preference of Ec2, for example OpenStack and/or ConfigDrive.

Another option would be to convince the cloud-init developers that OpenStack clouds can be expected to provide the Ec2 metadata service, and that there's no need to issue warnings about that.

Related branches

Fix proposed to branch: master

Changed in diskimage-builder:
assignee: nobody → Simon Leinen (simon-leinen)
status: New → In Progress

Submitter: Jenkins
Branch: master

commit 0ff40cf63ca84346b3d7f254a69368e214928a18
Author: Simon Leinen <email address hidden>
Date: Sat Apr 15 19:01:42 2017 +0200

    Turn off strict_id mode for Ec2 datasource

    Recent changes in the default configuration of cloud-init in Ubuntu
    cause warnings when the Ec2 datasource is used on non-Amazon clouds,

    We explicitly select the previous behavior when an Ec2 datasource is

    Change-Id: Iebad8f6c0017fe08013dd5fe667c6132158b71cd
    Closes-bug: 1683038

Changed in diskimage-builder:
status: In Progress → Fix Released
Scott Moser (smoser) wrote :

I wonder why an openstack project would not configure images built to run on openstack to use the openstack metadata service. Is there a reason? Generally speaking I think it should perform much better as the openstack metadata service is often quite slow. Cloud-init crawls the metadata service and on openstack that will take probably 6 requests while EC2 will take several more. (Openstack provides lots of data in json format in a single payload while Ec2 provides individual bits in individual urls).

All that said, I'll consider it a bug that if you have only 1 or 2 entries
in the datasource list that Ec2 strict should be assumed.

Changed in cloud-init:
importance: Undecided → Medium
status: New → Confirmed
tags: added: dsid
Scott Moser (smoser) on 2017-07-13
Changed in cloud-init:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers