cloud-init should fetch image-data as well as user-data

Bug #684804 reported by Alex Bligh
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Low
Unassigned
cloud-init (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: cloud-init

cloud-init should fetch data specific to the image (and the platform) prior to fetching user-data, and treat it the same way.

It should be an objective of ubuntu cloud images that they will run on multiple cloud platforms without customization. As cloud platforms differ, if the image is not customized, it is necessary for the image to perform certain platform-specific operations on first boot. These tend to be image specific too. An example would be to map PV driver disks.

Currently cloud-init sucks down and run a user-data script if supplied. It gets this by default by reading
  http://169.254.169.254/user-data
Cloud platform providers cannot provide data there because there is no agreed format for user-data (i.e. not every user uses the MIME format ubuntu's cloud-init uses), meaning that (a) we would corrupt the user-data blob, and (b) even prepending another MIME part, we'd run into problems with bad MIME etc.

It is suggested that instead cloud-init FIRST gets a user-data script from
   http://169.254.169.254/image-data
or similar. This would be platform specific data (as opposed to instance specific data) that would be run first. This could do platform specific stuff (for instance, change UUID, use custom first password code, disable bits of udev, and so forth).

Added to the end of the URL would be GET parameters describing the operating system type, release, etc. that could be used to help the platform provider interpret what they should send down (although this could form part of the metadata of the image itself, in a situation where a server is e.g. installed manually on a blank disk it won't be there).

This should be a pretty trivial addition to cloud-init.

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

> It is suggested that instead cloud-init FIRST gets a user-data script from
> http://169.254.169.254/image-data
> or similar. This would be platform specific data (as opposed to instance specific data)
> that would be run first

What I would do is just consume it the same way as user-data is consumed now.

If present, it would be consumed before the user data.

If you wanted to run scripts *right then* then a "'Cloud Boothook" would be how to get that done (https://help.ubuntu.com/community/CloudInit).

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Alex, thanks for the detailed feature request.

I've marked this as Triaged in Ubuntu, since its also been sent upstream to cloud-init, and Scott seems willing to take a look. It also sounds like a cool idea. Setting Importance to Wishlist.

Changed in cloud-init (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Scott Moser (smoser) wrote :

Just for reference to anyone looking here. I've added 'vendor_data' to openstack nova under the blueprint at https://blueprints.launchpad.net/nova/+spec/vendor-data . The intent is to support this in some way under cloud-init.

Revision history for this message
Dan Watkins (oddbloke) wrote :

cloud-init does now support vendor-data.

Changed in cloud-init:
status: Triaged → Fix Released
Changed in cloud-init (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.