nova libvirt xml generate wrong metadata

Bug #1524627 reported by Tardis Xu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Low
Tardis Xu

Bug Description

Environment:

devstack running OpenStack from master.

Steps to reproduce:

1. login as demo/demo
2. boot a instance
3. virsh dumpxml <instance>, view metadata:
<nova:owner>
        <nova:user uuid="<demo-uuid>">demo</nova:user>
        <nova:project uuid="demo-project-uuid">demo</nova:project>
</nova:owner>
4. login as admin/admin
5. hard boot the instance
6. virsh dumpxml <instance>, view metadata:
<nova:owner>
        <nova:user uuid="<admin-uuid>">admin</nova:user>
        <nova:project uuid="<admin-project-uuid>">admin</nova:project>
</nova:owner>

Expected result:

The project and user metadata cannot get from current context.

Actual result:

The project and user metadata all get from current context.

Tardis Xu (xiaoxubeii)
Changed in nova:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Tardis Xu (xiaoxubeii)
tags: added: compute
tags: added: libvirt xml
Revision history for this message
Tardis Xu (xiaoxubeii) wrote :

The problem is in virt/libvirt/driver.py, _get_guest_config_meta, it gets the nova owner meta from current context. But if the instance is rebooted as other context, it will go wrong. I think we can add the identity cache to instance like network info. If this, we must change the db table. So I think we should implement it as a bp not a bug.

Changed in nova:
status: In Progress → Opinion
importance: Medium → Low
Revision history for this message
massimo.sgaravatto (massimo-sgaravatto) wrote :

Doesn't this bug affect also accounting ?

If ceilometer is configured to retrieve some instance metadata from the metadata libvirt API instead of polling the Nova API (i.e. instance_discovery_method is set to libvirt_metadata which, as far as I understand, is the default setting) because of this bug resources won't be charged to the right project after a hard reboot performed by the admin ...

So IMHO the importance of this issue is not so low ...

Revision history for this message
melanie witt (melwitt) wrote :

Looks like this was fixed by https://review.openstack.org/#/c/399679

Please see the duplicate bug https://bugs.launchpad.net/bugs/1607313 for details.

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.