Read-only API for default quotas

Bug #1204956 reported by Julie Pichon on 2013-07-25
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack SDK
Fix Released
Undecided
Rui Chen
neutron
Medium
Abhishek Raut
python-neutronclient
Undecided
Abhishek Raut
python-openstackclient
Fix Released
Medium
Rui Chen

Bug Description

Having a read-only API to access the default quotas, similar to `nova quota-defaults` would be helpful to API consumers like Horizon (see e.g. bug 1109140). As far as I can tell, there is no way to get to this information at the moment.

tags: added: neutron-core
Changed in neutron:
status: New → Triaged
importance: Undecided → Medium
Akihiro Motoki (amotoki) wrote :

Other projects usually provides an API to read the default quotas.
It is not difficult to provide this information through the API.

The question is what URL should be used.
The URL of "neutron quota-show" is "/v2.0/quotas/<tenant-id>".
there are several options:

(1) GET /v2.0/quotas/default ("default" is a special tenant-id to represent the default quotas.)
(2) GET /v2.0/quotas/<tenant-id>/default
(3) ....

If we use (1), all tenants can have a single set of default quotas.
If tenants are categorized into several classes and default quotas are defined per class, (1) cannot be used.

Changed in neutron:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Julie Pichon (jpichon) wrote :

Hi Armando. Is there any update on this?

Akihiro Motoki (amotoki) wrote :

I clear the assignee once. There is no activity for a long time.

Changed in neutron:
assignee: Armando Migliaccio (armando-migliaccio) → nobody
Changed in neutron:
assignee: nobody → Slawek Kaplonski (slawek-t)

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

Changed in neutron:
status: Triaged → In Progress

Change abandoned by Salvatore Orlando (<email address hidden>) on branch: master
Review: https://review.openstack.org/100663
Reason: This patch has been inactive long enough that I think it's safe to abandon.
The author can resurrect it if needed.

Changed in neutron:
status: In Progress → Confirmed
li,chen (chen-li) on 2015-11-25
Changed in neutron:
assignee: Slawek Kaplonski (slaweq) → li,chen (chen-li)

I completely forgot that this bug was raised....
so this how 'default quotas' are retrieved in nova:

GET /v2.1/d7960ca10de9478baa1cd2897e63011c/os-quota-sets/d7960ca10de9478baa1cd2897e63011c/defaults

Tenants get "quota sets" that override the default quotas. Neutron applies a similar concept, but it does not differentiate the overriden quotas from the default ones in the response.

GET http://127.0.0.1:9696/v2.0/quotas/d7960ca10de9478baa1cd2897e63011c.json

Will return the quota for the tenant - which will be the tenant default quotas if quotas were never updated for the tenant.
In Neutron there are no tenant-specific defaults - only global ones.
Therefore you can actually leverage what could be regarded as a Neutron bug to get default quotas, doing something like the following:

GET http://127.0.0.1:9696/v2.0/quotas/meh_i_do_not_exist.json

Nevertheless, there is a need for a RFE to make Neutron quota mgmt API consistent with the other major openstack projects.

Abhishek Raut (abhraut) on 2016-04-15
tags: added: rfe

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

Changed in neutron:
assignee: li,chen (chen-li) → Abhishek Raut (abhraut)
status: Confirmed → In Progress
Changed in neutron:
assignee: Abhishek Raut (abhraut) → Henry Gessau (gessau)
vikram.choudhary (vikschw) wrote :

 As per confirmation over "https://review.openstack.org/#/c/306200/", we also need an equivalent command line for retrieving default quotas.

Changed in neutron:
assignee: Henry Gessau (gessau) → Abhishek Raut (abhraut)
Abhishek Raut (abhraut) on 2016-05-05
Changed in python-neutronclient:
assignee: nobody → Abhishek Raut (abhraut)

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

Changed in python-neutronclient:
status: New → In Progress
Richard Theis (rtheis) on 2016-05-11
Changed in python-openstackclient:
importance: Undecided → Medium
status: New → Confirmed

Reviewed: https://review.openstack.org/306200
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f5a2ee300d109ac9d403ee1f39d6e056ac925133
Submitter: Jenkins
Branch: master

commit f5a2ee300d109ac9d403ee1f39d6e056ac925133
Author: Abhishek Raut <email address hidden>
Date: Thu Apr 7 13:59:15 2016 -0700

    Add API to retrieve default quotas

    Currently there is no support to retrieve default quotas set
    for all projects. This patch adds a new API function to get
    default quotas.
    GET /v2.0/quotas/<tenant-id>/default

    DocImpact: Document new API to used to retrieve default quotas
    APIImpact: New Read-only API to retrieve default quotas

    Change-Id: If40a44348e305da444acd6196d2e0c04202b8f7a
    Closes-Bug: #1204956

Changed in neutron:
status: In Progress → Fix Released

This issue was fixed in the openstack/neutron 9.0.0.0b1 development milestone.

Rui Chen (kiwik-chenrui) wrote :

We must support quota default show in openstacksdk, then fix the bug in openstackclient, I propose to push patch in openstacksdk side first, then commit openstackclient side patch.

Changed in python-openstacksdk:
assignee: nobody → Rui Chen (kiwik-chenrui)
Changed in python-openstackclient:
assignee: nobody → Rui Chen (kiwik-chenrui)
Brian Curtin (brian.curtin) wrote :

This has been available in openstacksdk for almost two years.

Changed in python-openstacksdk:
status: New → Fix Released
assignee: Rui Chen (kiwik-chenrui) → nobody
Rui Chen (kiwik-chenrui) wrote :

Hi Brian:

I check the master branch code, openstacksdk support the following network quota APIs:

list: GET /quotas

show: GET /quota/$project_id/

update: PUT /quota/$project_id/

delete: DELETE /quota/$project_id/

But I need a new API to fetch the project default quota, that isn't supported by current openstacksdk:

show default: GET /quota/$project_id/default

Rui Chen (kiwik-chenrui) wrote :

Hi Brian:

I push a patch https://review.openstack.org/339351 to clarify the details, that might be helpful.

Changed in python-openstacksdk:
assignee: nobody → Rui Chen (kiwik-chenrui)

Reviewed: https://review.openstack.org/339351
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=8c4239cdb8bfad1e01982a07dadfdfcb1e245fe2
Submitter: Jenkins
Branch: master

commit 8c4239cdb8bfad1e01982a07dadfdfcb1e245fe2
Author: Rui Chen <email address hidden>
Date: Fri Jul 8 10:40:22 2016 +0800

    Support fetching network project default quota

    Add new API support to get project default quota of networking
    resources(GET /quotas/$project_id/default), related unit test
    cases are added in the patch.

    Change-Id: I6a4e2a146351dd1e7d652442511f1ef2c279da42
    Closes-Bug: #1204956

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

Changed in python-openstackclient:
status: Confirmed → In Progress
QiangTang (qtang) wrote :
Download full text (3.1 KiB)

With commit: https://review.openstack.org/#/c/351581/

Default quota and quota-class can be read as:

rally@9f7f62b82dd4:~$ openstack quota show
+-----------------------+----------------------------------+
| Field | Value |
+-----------------------+----------------------------------+
| backup_gigabytes | 1000 |
| backups | 10 |
| cores | 20 |
| fixed-ips | -1 |
| floating-ips | 50 |
| gigabytes | 1000 |
| healthmonitor | -1 |
| injected-file-size | 10240 |
| injected-files | 5 |
| injected-path-size | 255 |
| instances | 10 |
| key-pairs | 100 |
| l2-gateway-connection | -1 |
| l7policy | -1 |
| listener | -1 |
| loadbalancer | 10 |
| networks | 10 |
| per_volume_gigabytes | -1 |
| pool | 10 |
| ports | 50 |
| project | 794f6f8e6f2047c08fc2146886d7b512 |
| properties | 128 |
| ram | 51200 |
| rbac-policies | 10 |
| routers | 10 |
| secgroup-rules | 100 |
| secgroups | 10 |
| server_group_members | 10 |
| server_groups | 10 |
| snapshots | 10 |
| subnetpools | -1 |
| subnets | 10 |
| volumes | 10 |
+-----------------------+----------------------------------+
rally@9f7f62b82dd4:~$ openstack quota show --class
+----------------------+-------+
| Field | Value |
+----------------------+-------+
| backup_gigabytes | 1000 |
| backups | 10 |
| cores | 20 |
| fixed-ips | -1 |
| floating-ips | 10 |
| gigabytes | 1000 |
| injected-file-size | 10240 |
| injected-files | 5 |
| injected-path-size | 255 |
| instances | 10 |
| key-pairs | 100 |
| per_volume_gigabytes | -1 |
| project | None |
| properties | 128 |
| ram | 51200 |
| secgroup-rules | 20 |
| secgroups | 10 |
| snapshots | 10 |
| volumes | 10 |
+--------------------...

Read more...

Reviewed: https://review.openstack.org/313134
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=d45442b3d46b26d928a5634874530168f961bb2b
Submitter: Jenkins
Branch: master

commit d45442b3d46b26d928a5634874530168f961bb2b
Author: Abhishek Raut <email address hidden>
Date: Tue May 3 05:17:12 2016 -0700

    Add support to expose default quotas for tenants

    Neutron client should be able to show the default quotas
    set for tenants. This patch adds support for the same and
    introduces a new CLI to retrieve default quotas.

    Sample usage:

    neutron quota-default-show
    +-----------------------+-------+
    | Field | Value |
    +-----------------------+-------+
    | floatingip | 50 |
    | l2-gateway-connection | -1 |
    | network | 10 |
    | port | 50 |
    | rbac_policy | 10 |
    | router | 10 |
    | security_group | 10 |
    | security_group_rule | 100 |
    | subnet | 10 |
    | subnetpool | -1 |
    +-----------------------+-------+

    Change-Id: Ie92c22862d2b8ace32a2cf4cb642a6d0bac7932d
    Closes-Bug: #1204956

Changed in python-neutronclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-neutronclient 6.0.0 release.

Reviewed: https://review.openstack.org/343616
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=6f326acd260d035cb024f0c5e3ef2237277d8b37
Submitter: Jenkins
Branch: master

commit 6f326acd260d035cb024f0c5e3ef2237277d8b37
Author: Rui Chen <email address hidden>
Date: Mon Jul 11 09:55:22 2016 +0800

    Support fetching network project default quota

    Neutron server and openstacksdk had supported to fetch
    network project default quota, this patch add the CLI
    support in openstackclient.

    Change-Id: If0ef74c268c41a866c62156da0603a40ae4e6e31
    Closes-Bug: #1204956
    Depends-On: I6a4e2a146351dd1e7d652442511f1ef2c279da42

Changed in python-openstackclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-neutronclient 6.0.0 release.

This issue was fixed in the openstack/python-openstackclient 3.3.0 release.

This issue was fixed in the openstack/python-neutronclient 6.0.0 release.

This issue was fixed in the openstack/python-openstackclient 3.3.0 release.

This issue was fixed in the openstack/python-neutronclient 6.0.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints