The simple-tenant-usage API should pull instance flavor attrs rather than system_metadata now

Bug #1485025 reported by Matt Riedemann
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann

Bug Description

This is sort of a follow on update to bug 1383469.

Per https://github.com/openstack/nova/commit/a6ff9efda33f4e465d5639618da1e2e2105890b6 we no longer do an in-place migration of instance flavor data from system_metadata to the flavor json blob in the instance_extra table, so the simple-tentant-usage API shouldn't join on system_metadata anymore:

https://github.com/openstack/nova/blob/12.0.0.0b2/nova/api/openstack/compute/contrib/simple_tenant_usage.py#L107

That should just expect the flavor attribute when pulling the instances since they are used here:

https://github.com/openstack/nova/blob/12.0.0.0b2/nova/api/openstack/compute/contrib/simple_tenant_usage.py#L84

This is not a high severity bug, but it is a performance nit so we should fix it.

Matt Riedemann (mriedem)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Matt Riedemann (mriedem)
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/213340

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/213340
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=efdb4ce5755795d455860297d84d5d97daa704b7
Submitter: Jenkins
Branch: master

commit efdb4ce5755795d455860297d84d5d97daa704b7
Author: Matt Riedemann <email address hidden>
Date: Fri Aug 14 13:47:12 2015 -0700

    Load flavor when getting instances for simple-tenant-usage

    Per commit a6ff9efda33f4e465d5639618da1e2e2105890b6 which removes the
    flavor compatibility code for system_metadata we no longer need to load
    system_metadata when getting instances in the simple-tenant-usage API.
    Instead we should expect the flavor attribute to be loaded when getting
    the instances.

    This updates the tests a bit since we no longer rely on system_metadata
    so we have to mock out the instance.flavor instead. There were a few
    tests that relied on how instance.get_flavor() used to work with
    system_metadata and since that's not really valid anymore, we change
    those tests to just raise a NotFound from instance.get_flavor() if we're
    testing some other lookup path. As a result, two of the tests became
    basically the same so one was removed.

    Closes-Bug: #1485025

    Change-Id: Ie6b3c470619bd67871b49e75af8044f173bed615

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.