placement apis for inventory and allocations use insufficiently robust jsonschema

Bug #1673227 reported by Chris Dent on 2017-03-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Dan Smith
Ocata
Medium
Elod Illes

Bug Description

In placement API v 1.4 it is possible to make inventories and allocations that pass the constraints of the jsonschema but are not correct according to the design of the system. If no values are provided, the defaults are incorrect as well:

inventories:

* It is possible to make inventories with with a min_unit or max_unit <= 0. min_unit and max_unit minimum should be 1.
* It is possible to create a step size that is <= 0. It's minimum should be 1.
* default for min_unit should be 1 not 0
* default for max_unit should be a big number not 0
* reserved and total need a minimum, probably of 0 and 1 respectively

allocations:

* resource consumption value must have a minimum of 1

Jay Pipes (jaypipes) on 2017-03-15
Changed in nova:
importance: Undecided → Medium
Matt Riedemann (mriedem) wrote :

"* reserved and total need a minimum, probably of 0 and 1 respectively"

reserved should not be a min of 1.

Matt Riedemann (mriedem) wrote :

Oh nevermind, 0 and 1, *respectively*.

Changed in nova:
assignee: nobody → Ed Leafe (ed-leafe)
Changed in nova:
status: Triaged → In Progress
Changed in nova:
assignee: Ed Leafe (ed-leafe) → Dan Smith (danms)

Reviewed: https://review.openstack.org/416752
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6a6d021f818d6145bd2cdc6431f95f40d8372d59
Submitter: Jenkins
Branch: master

commit 6a6d021f818d6145bd2cdc6431f95f40d8372d59
Author: EdLeafe <email address hidden>
Date: Wed Jan 4 22:09:15 2017 +0000

    Add check for invalid allocation amounts

    This patch adds a check for the amounts in allocations passed to the
    placement API, and returns an error if any amount is not greater than
    zero.

    Partial-Bug: #1673227

    Change-Id: I2a8dc038d6489e82ad51fdc27d22cf0ab2d66322

Reviewed: https://review.openstack.org/428800
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0b2d7c4d028104d3a2a0d5851b194eface707ec3
Submitter: Jenkins
Branch: master

commit 0b2d7c4d028104d3a2a0d5851b194eface707ec3
Author: EdLeafe <email address hidden>
Date: Fri Feb 3 15:32:55 2017 +0000

    Add check for invalid inventory amounts

    This patch adds sane minimum and maximums to the fields for an inventory
    posting, which will quickly return a 400 error if invalid values are
    passed instead of proceeding, only to fail at the DB layer.

    Partial-Bug: #1673227

    Change-Id: I6296cee6b8a4be1dd53c52f6290ebda926cf6465

Chris Dent (cdent) wrote :

The commits for this have merged, I guess the automation won't automate on partials (which makes sense).

Changed in nova:
status: In Progress → Fix Released

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/607321

Reviewed: https://review.openstack.org/607320
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=43ae6df96b85c0e008f575193511ebf28b195edd
Submitter: Zuul
Branch: stable/ocata

commit 43ae6df96b85c0e008f575193511ebf28b195edd
Author: EdLeafe <email address hidden>
Date: Wed Jan 4 22:09:15 2017 +0000

    Add check for invalid allocation amounts

    This patch adds a check for the amounts in allocations passed to the
    placement API, and returns an error if any amount is not greater than
    zero.

    Partial-Bug: #1673227

    Change-Id: I2a8dc038d6489e82ad51fdc27d22cf0ab2d66322
    (cherry picked from commit 6a6d021f818d6145bd2cdc6431f95f40d8372d59)

tags: added: in-stable-ocata

Reviewed: https://review.openstack.org/607321
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3eb967784bbe1c1668d22fdb8cee65dc2417103c
Submitter: Zuul
Branch: stable/ocata

commit 3eb967784bbe1c1668d22fdb8cee65dc2417103c
Author: EdLeafe <email address hidden>
Date: Fri Feb 3 15:32:55 2017 +0000

    Add check for invalid inventory amounts

    This patch adds sane minimum and maximums to the fields for an inventory
    posting, which will quickly return a 400 error if invalid values are
    passed instead of proceeding, only to fail at the DB layer.

    Conflicts:
     nova/tests/functional/api/openstack/placement/gabbits/inventory.yaml

    Partial-Bug: #1673227

    Change-Id: I6296cee6b8a4be1dd53c52f6290ebda926cf6465
    (cherry picked from commit 0b2d7c4d028104d3a2a0d5851b194eface707ec3)

Elod Illes (elod-illes) wrote :

The two partial fix (that together solve the bug) got merged. (automation only works for "closes-bug" according to previous comment)

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

Other bug subscribers