OpenStack Compute (Nova)

-1 vs. None w/ Unlimited Quotas

Reported by Gabriel Hurley on 2012-04-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
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) on 2012-04-03
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Dan Prince (dan-prince) on 2012-04-03
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
Dan Prince (dan-prince) on 2012-04-03
Changed in nova:
status: Confirmed → In Progress
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

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

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

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
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) on 2012-04-04
no longer affects: nova/folsom
no longer affects: nova/essex
Changed in nova:
status: In Progress → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-rc3 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers