all instances have user data

Bug #1035317 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Chuck Short

Bug Description

Hi,
  I just noticed that all of my instances are showing user-data in the metadata service even if the instance was not started with any user-data. Launch an instance like:

$ img=f57b91f2-3eac-4690-bf2d-cf28b25486e8 ; key="mykey"
$ nova boot sm-foo-user-data --flavor m1.tiny --key_name $key --image $img sm-foo-no-user-data

Then, inside the instance you'll see:
$ wget -O - -q http://169.254.169.254/latest/ ; echo
meta-data/
user-data

Previously (and in EC2) user-data is not listed. This indicates it is Null rather than "".

I see in the database:

mysql> select id, hostname, user_data from instances;
+----+---------------------------------------------+--------------------------+
| id | hostname | user_data |
+----+---------------------------------------------+--------------------------+
| 4 | sm-foo-user-data-none | |
| 6 | sm-foo-user-data | W3B5dGhvbjogKioucHldCgo= |
+----+---------------------------------------------+--------------------------+

I think I would have expected a NULL there for user_data.

I know the metadata service code has explicit checks for this:
nova/api/metadata/base.py:
        if instance.get('user_data', None) is not None:
            self.userdata_b64 = base64.b64decode(instance['user_data'])
        else:
            self.userdata_b64 = None

I'm not actually sure at what point this regressed. It seems present in the folsom nova installation I have access to.
Is there a way to determine that userdata is None rather than "" ?

Perhaps the web service code is just doing it wrong?

Revision history for this message
Chuck Short (zulcss) wrote :

I see this on folsom as well.

Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11177

Changed in nova:
assignee: nobody → Chuck Short (zulcss)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/11177
Committed: http://github.com/openstack/nova/commit/293cd3e9232c3bbdb693a074bc306e35ea9e4f08
Submitter: Jenkins
Branch: master

commit 293cd3e9232c3bbdb693a074bc306e35ea9e4f08
Author: Chuck Short <email address hidden>
Date: Fri Aug 10 13:50:13 2012 -0500

    Don't show user-data when its not sent.

    Don't show user-data in the instance metadata service
    if the instance was not started with any user-data.

    LP: #1035317

    Change-Id: Idf9b263a39f3b8d75aaf3e6d1debbe283cf9ff64
    Signed-off-by: Chuck Short <email address hidden>

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
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.