The strange case of the quota_items config option

Bug #1453322 reported by Salvatore Orlando
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Salvatore Orlando

Bug Description

The quota_items option [1] declares which resources will be subject to quota limiting.
Then the code, for each value, there, will look for an option named quota_<resource_name>, when registering resources with the quota engine. This happens at module load time.

This is pretty much how networks, ports, and subnets have been registering themselves with the quota engine so far.
All the other resources for which neutron does quota limiting, are a bit smarter, and register themselves when the respective API extensions are loaded.

Indeed there are config options for routers, floating ips, and other resources, which are not listed in quota_items. While this is not an error, it is surely confusing for operators.
In order to avoid making the configuration schema dependent on the value for a conf option (eg: requiring a quota_meh option if 'meh' is in quota_items), the system picks a 'default limit' for all resources for which there is no corresponding limit. This avoid failures but is, again, fairly confusing.
Registration happens at module load. This is probably not great from a practical perspective. It's also bad for maintainability, and it is a bit ugly from a coding style perspective.
And finally it is unclear why resource registration is done in a way for core resources and in another way for all other resources. Consistency is somewhat important.

the quota_items options should probably just be deprecated

[1] http://git.openstack.org/cgit/openstack/neutron/tree/neutron/quota.py#n35

Tags: deprecation
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

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

commit a6b6e5597f32dfb0d92dc168d91e83d6daafe227
Author: Salvatore Orlando <email address hidden>
Date: Fri May 8 17:03:55 2015 -0700

    Deprecate quota_items, register resources upon REST initialization

    Register 'core' resources when the respective rest controllers are
    instantiated, rather than at module load time.

    Since in this way there will not be any need to iterate over
    quota_items, the option is being deprecated.

    This patch does not supply unit tests as the already-existing
    routine for registering a resource from quota_items is being
    deprecated as well (and was not covered by any unit test beforehand).

    DocImpact

    Change-Id: Icdb744adfd86d38363239a454ccf04f3c6b9c158
    Closes-Bug: #1453322

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-1 → 7.0.0
tags: added: deprecation
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.