OpenStack Compute (Nova)

ec2 metadata service regressed for block-device-mapping and empty kernel-id, ramdisk-id

Reported by Scott Moser on 2012-03-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Jesse Andrews

Bug Description

After changes made for bug 851159 [1], it seems there were some regressions in the content of the metadata service.
This is causing issues for consumers of that service (cloud-init).

Some things that are broken:
 a.) kernel-id, ramdisk-id show up in the metadata service items list even if there they're not valid for this image.
     The following should be empty output if there are no kernel or ramdisk:
      wget http://169.254.169.254/2009-04-04/meta-data -q -O - | egrep "(kernel|ramdisk)-id"
     This causes a problem when the dataservice is crawled as gets for metadata/kernel-id or ramdisk-id show 404.
 b.) block-device-mapping content is broken
      previously:
    $ python -c 'import boto.utils, pprint; pprint.pprint(boto.utils.get_instance_metadata()["block-device-mapping"])'
    {'ami': 'vda', 'ephemeral0': '/dev/vdb', 'root': '/dev/vda'}
    But now,
    $ python -c 'import boto.utils, pprint; pprint.pprint(boto.utils.get_instance_metadata()["block-device-mapping"])'
    ['ami', 'ephemeral0' 'root']

  c.) public-keys should not be present in meta-data/ list if none were provided
     (wget http://169.254.169.254/latest/meta-data/ -O - -q; echo ) | grep public

  d.) if something is a dict it shoudl appear as a directory in the meta-data list
      Examples of things that previously had trailing slashes but now do not:
       * placement/
       * mpi/
       * public-keys/
       * block-device-mapping/

Then, one thing which seems to have been the case before this change was:
 x.) kernel-id, ramdisk-id, ami-id show 'ami-000000'
     $ ec2metadata --kernel-id --ramdisk-id --ami-id
    ami-00000000
    ami-00000000
    ami-00000000
   That is that 'ami-0000000' was the kernel-id, ramdisk-id and ami-id, rather than the actual values (this was for an instance that did have a kernel and ramdisk).

[1] https://github.com/openstack/nova/commit/1bcf5f5431d3c9620596f5329d7654872235c7ee

Scott Moser (smoser) on 2012-03-13
summary: - ec2 metadata service regressed for block-device-mapping, kernel-id,
- ramdisk-id, ami-id
+ ec2 metadata service regressed for block-device-mapping and empty
+ kernel-id, ramdisk-id
Scott Moser (smoser) on 2012-03-13
description: updated
description: updated
Brian Waldon (bcwaldon) wrote :

This should fix the incorrect mapping of ami/aki/ari ids: https://review.openstack.org/#change,5265

Changed in nova:
milestone: none → essex-rc1
assignee: nobody → Jesse Andrews (anotherjesse)
Changed in nova:
importance: Undecided → High
status: New → In Progress

Reviewed: https://review.openstack.org/5363
Committed: http://github.com/openstack/nova/commit/4c8dbf81d9a9f27faeb19271b774ea4f130e516c
Submitter: Jenkins
Branch: master

commit 4c8dbf81d9a9f27faeb19271b774ea4f130e516c
Author: Jesse Andrews <email address hidden>
Date: Wed Mar 14 13:20:07 2012 -0700

    metadata speed - revert logic changes, just caching

     * reverts most of https://review.openstack.org/5042
     * keep changes that cache the results so subsequent calls are fast

     fixes bug 954377

    Change-Id: Ia047f1d04dc360dd657d4d80d3dff8c8101635cd

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-03-20
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-rc1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers