-1 vs. None w/ Unlimited Quotas

Bug #972034 reported by Gabriel Hurley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Dan Prince

Bug Description

1. Nova uses -1 as its special value for configuring unlimited quotas.
2. The Nova API sends "None" for an unlimited quota.
3. Novaclient strips out "None" in the quota update code, so you can't send a None/null.
4. Sending a -1 through novaclient works, but isn't treated specially and thus -1 is sent back when the quota is retrieved instead of None.

This inconsistency makes working with unlimited quotas via the API very very difficult.

(Also, the quotas API happily accepts any negative number, which seems rather broken.)

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
Dan Prince (dan-prince)
Changed in nova:
status: Confirmed → In Progress
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/6184

Revision history for this message
Dan Prince (dan-prince) wrote :

Okay. Part one of this ticket should be fixed in: https://review.openstack.org/#change,6184

I'll push a separate branch to add checks so that negative numbers (besides -1) aren't allowed.

Changed in nova:
milestone: none → essex-rc3
tags: removed: essex-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/6184
Committed: http://github.com/openstack/nova/commit/7f226a7bd560fe76cfa6f2211b1694c4c6b4dd47
Submitter: Jenkins
Branch: master

commit 7f226a7bd560fe76cfa6f2211b1694c4c6b4dd47
Author: Dan Prince <email address hidden>
Date: Tue Apr 3 15:23:48 2012 -0400

    Treat -1 quotas as unlimited.

    Updates quota db API calls so they treat -1 quotas as unlimited
    for consistency with the Nova flags.

    Fixes LP Bug #972034.

    Change-Id: I56456c2780110f8fd55afa9d1fe30193bf99d928

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

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/6205

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

Reviewed: https://review.openstack.org/6205
Committed: http://github.com/openstack/nova/commit/d9465624ba68e513c02539c685d5d834ca3094ba
Submitter: Jenkins
Branch: milestone-proposed

commit d9465624ba68e513c02539c685d5d834ca3094ba
Author: Dan Prince <email address hidden>
Date: Tue Apr 3 15:23:48 2012 -0400

    Treat -1 quotas as unlimited.

    Updates quota db API calls so they treat -1 quotas as unlimited
    for consistency with the Nova flags.

    Fixes LP Bug #972034.

    Change-Id: I56456c2780110f8fd55afa9d1fe30193bf99d928

Changed in nova:
status: Fix Committed → Fix Released
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/6209

Changed in nova:
status: Fix Released → In Progress
Changed in nova:
status: Fix Released → In Progress
Revision history for this message
Eoghan Glynn (eglynn) wrote :

Would it be more symmetric to use -1 end-to-end to represent unlimited? (instead of -1 for create/update, but None for show)

So -1 would be stored as the hard_limit in the quotas & quota_classes tables to represent an unlimited threshold, and the checks against None in nova/quota.py would morph to == -1.

Then novaclient could also be updated to report say '-1 (unlimited)' instead of None for unlimited thresholds.

Thierry Carrez (ttx)
no longer affects: nova/folsom
no longer affects: nova/essex
Changed in nova:
status: In Progress → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-rc3 → 2012.1
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.