Different APIs 'os-quota-class-sets' Response between v2 and v2.1

Bug #1693168 reported by Ghanshyam Mann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ghanshyam Mann

Bug Description

'os-quota-class-sets' GET and PUT APIs response is different between v2(all extensions) and v2.1
There is no 'server_groups' and 'server_group_members' in quota class set APIs response where these were present in v2 (with all extension).

'os-server-group-quotas' extension was introduced in this -
  I78974602d4be04deaf173b3e43f2dab92e8f4171 in v2 API.
and if extension 'os-server-group-quotas' was enabled in v2, then 'server_groups' and 'server_group_members' were present in APIs response.
This behavior was till we had the legacy_v2 code where this extensions class and way to enable/disable extensions was available.

In v2.1 API, there was never such extensions. v2.1 should behave same as v2 with all extensions. But we forgot to merge the if/else extension code[1] which caused 'server_groups' and 'server_group_members' never showed up in quota class set APIs (GET and PUT) response.

.. 1 http://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/compute/quota_classes.py#n47

This issue did not get caught on tests as legacy_v2 code got removed before functional tests with all extensions were enabled. And somehow sample file with 'server_groups' and 'server_group_members' attributes in response got disappeared while changing the directory structure v3->v2.1>/compute etc.

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Verified this behavior locally with mitaka(which has legacy_v2 code).

Revision history for this message
jichenjc (jichenjc) wrote :

ah... thanks for find this ,maybe we can consider to use microversion to restore those output?

Changed in nova:
assignee: nobody → jichenjc (jichenjc)
Revision history for this message
Matt Riedemann (mriedem) wrote :

Can anyone say what happens when you run:

nova quota-class-show default

As a non-admin? I'm interested in how the policy rule works:

'is_admin:True or quota_class:%(quota_class)s',

Which is effectively:

'is_admin:True or quota_class:default',

I guess that means you can configure policy per-class?

--

Also, since you should be able to get the 'server_groups' and 'server_group_members' keys in the os-quota-sets response (which is per-project) on 2.1, that's the workaround.

So in the May 24 nova api subteam meeting we agreed to document the bug and workaround in the api-ref (note that we don't even document os-quota-class-sets in the api-ref today), and then fix this in a microversion for os-quota-class-sets.

Revision history for this message
Matt Riedemann (mriedem) wrote :

We will need a spec for the microversion change, which Alex said he'd write, but please work together.

Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → pike-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/467938

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/467999

Changed in nova:
assignee: jichenjc (jichenjc) → Ghanshyam Mann (ghanshyammann)
status: Confirmed → In Progress
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

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

commit b25b66e284dfae5afcbb1502abf27f013447f470
Author: ghanshyam <email address hidden>
Date: Thu May 25 12:06:11 2017 +0300

    Add api-ref for os-quota-class-set APIs

    This commit adds the api doc for os-quota-class-set GET & PUT
    APIs.

    - Also mentioned about the recommendation over usage of this API.
    - Added warning for current bug in v2.1 API #1693168

    This is also needed by BP
    - https://blueprints.launchpad.net/nova/+spec/fix-quota-classes-api

    Change-Id: Ib765e2d1dec7b236a2009148e0b1067a46326ce9
    Related-Bug: #1693168
    Closes-Bug: #1602400

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 92e0efeefd6782f205dc6a2b1f8e8a97f146596d
Author: ghanshyam <email address hidden>
Date: Thu Jul 6 08:58:48 2017 +0300

    Fix quota class set APIs

    v2.1 API which does not return the 'server_groups' and
    'server_group_members' quotas in GET & PUT os-quota-class-sets
    API response. v2 API used to return those keys in API response.

    Also filter out the network related quotas from os-quota-class-sets
    APIs

    Fixing this with microversion.
    Closes-Bug: #1701211
    Closes-Bug: #1693168
    implement-blueprint fix-quota-classes-api

    Change-Id: I66aeb7a92fb5ee906fead78030bd84a2e97916e8

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0b3

This issue was fixed in the openstack/nova 16.0.0.0b3 development milestone.

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.