UpdateProjectQuotas doesn't pay attention on disabled_quotas

Bug #1286099 reported by Roman Sokolkov
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Unassigned
OpenStack Dashboard (Horizon)
Fix Released
Medium
Timur Sufiev

Bug Description

Environment:
- OpenStack Havana release (2013.2.1)
- Neutron

Steps to reproduce:
- Go to admin -> projects
- Try to update project quotas
- Update fails with "Error: Modified project information and members, but unable to modify project quotas."

Workaround:
Comment out "security_group", "security_group_rule" in NEUTRON_QUOTA_FIELDS (openstack_dashboard/usage/quotas.py)

In neutron/server.log:

2014-02-28 11:45:03.145 34093 ERROR neutron.api.v2.resource [-] update failed
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource Traceback (most recent call last):
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/resource.py", line 84, in resource
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource result = method(request=request, **args)
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/extensions/quotasv2.py", line 107, in update
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource EXTENDED_ATTRIBUTES_2_0[RESOURCE_COLLECTION])
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/base.py", line 555, in prepare_request_body
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource Controller._verify_attributes(res_dict, attr_info)
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/base.py", line 602, in _verify_attributes
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource raise webob.exc.HTTPBadRequest(msg)
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource HTTPBadRequest: Unrecognized attribute(s) 'security_group_rule, security_group'
2014-02-28 11:45:03.145 34093 TRACE neutron.api.v2.resource

Revision history for this message
Liyingjun (liyingjun) wrote :
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

I've rechecked this one on the most recent Havana release (2013.2.3) - and got the same error, but as some investigation shown the root of problem was different: bug in Nova.

So, the bad thing happens here https://github.com/openstack/horizon/blob/2013.2.3/openstack_dashboard/dashboards/admin/projects/workflows.py#L711 and then the known error message is shown in dashboard, and it is caused by the https://github.com/openstack/nova/blob/2013.2.3/nova/quota.py#L741 (where a dictionary operation is called for non-existing key of quotas dictionary). Once I changed string

quotas[resource.name].update(minimum=0, maximum=-1)

to

quotas[resource.name] = dict(minimum=0, maximum=-1)

the error message in dashboard disappeared.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

It seems I haven't tried hard enough to reproduce that bug, because that one exists: https://bugs.launchpad.net/horizon/+bug/1330632 And seems that the fix for bug 1330632 (https://review.openstack.org/#/c/101813/) will fix the original issue of that bug also.

Revision history for this message
Gary W. Smith (gary-w-smith) wrote :

@Roman Sokolkov can you verify that the bug still exists?

Changed in horizon:
status: New → Incomplete
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

After further investigation it was found, that this error only happens when NoopQuotaDriver is used (i.e. quotas *are not* enforced on purpose by Nova). So while this is still an error (and the error message is indeed rather misleading), it doesn't affect the way quotas work. To reproduce the bug ensure that /etc/nova/nova.conf on controller node has 'quota_driver=nova.quota.NoopQuotaDriver' setting (restart nova-api service if you have changed it).

Horizon user experience (as of J2 milestone) is probably not very good here, as it makes users think they *can* modify the quotas, when they actually *can't* do that, given the fact that NoopQuotaDriver is chosen. The proposed fix is to disable 'Modify Quota' button when quotas are disabled that way in Nova.

Changed in horizon:
assignee: nobody → Timur Sufiev (tsufiev-x)
Changed in horizon:
status: Incomplete → Confirmed
tags: added: error-reporting nova
tags: added: customer-found
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

The misleading error with NoopQoutaDriver is fixed in https://review.openstack.org/#/c/117746/

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

With the above fix in Nova, the Dashboard doesn't produce errors when modifying data of a project with Nova quota driver set to NoopQoutaDriver, still the Dashboard makes user to think that he can change some quota values while actually he can't. Unfortunately, currently there is no way to query Nova about the type of quota driver it uses, so it cannot be fixed in Horizon alone. Adding Nova to this bug.

Changed in horizon:
importance: Undecided → Low
assignee: Timur Sufiev (tsufiev-x) → nobody
Sean Dague (sdague)
Changed in nova:
status: New → Fix Released
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
assignee: nobody → Timur Sufiev (tsufiev-x)
status: Confirmed → In Progress
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

So, if we cannot query services for the state of their quotas, let's use some prior knowledge on Horizon side.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Timur Sufiev (<email address hidden>) on branch: master
Review: https://review.openstack.org/215566
Reason: created new CR by a mistake

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by David Lyle (<email address hidden>) on branch: master
Review: https://review.openstack.org/215277
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Raised Severity to Medium since the user-facing Error (caused by the absence of this fix) is pretty disturbing.

Changed in horizon:
importance: Low → Medium
Timur Sufiev (tsufiev-x)
Changed in horizon:
milestone: none → newton-2
Revision history for this message
Steve McLellan (sjmc7) wrote :

https://review.openstack.org/#/c/342283/ may address this by accident

Changed in horizon:
milestone: newton-2 → newton-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/215277
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=baca29144b5f3e771e780d86210c11e85d8351ed
Submitter: Jenkins
Branch: master

commit baca29144b5f3e771e780d86210c11e85d8351ed
Author: Timur Sufiev <email address hidden>
Date: Fri Aug 21 13:22:03 2015 +0300

    Pay attention to Nova disabled quotas defined in a config file

    Since Nova doesn't currently provide an API call to indicate whether
    its quotas are disabled, we could use a parameter named
    'enable_quotas' within 'OPENSTACK_HYPERVISOR_FEATURES' setting for
    this purpose. This allows to avoid errors while trying to update
    quotas which are disabled on service side. Also make disabled_quotas
    collection to be a set instead of a list - this removes duplicate
    fields that appear due to some possible quota overlaps between Nova
    and Neutron.

    Also, since we dropped out python2.6 support fancy set literals and
    dict comprehensions can be used.

    Co-Authored-By: Paul Karikh <email address hidden>
    Closes-Bug: #1286099
    Change-Id: I10923f147e4c323aba8bbcc130d2016ad6725e86

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 10.0.0.0b3

This issue was fixed in the openstack/horizon 10.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.