out of range flavor parameter should return error

Bug #1259213 reported by Edward Hope-Morley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Edward Hope-Morley

Bug Description

Currently if user provides a parameter value to nova flavor-create that is out of range e.g.

nova flavor-create --rxtx-factor 3402823000000000000000000000000000000000000000000 foo 100 1 1 1

we get a warning in the logs:

/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py:331: Warning: Out of range value for column 'rxtx_factor' at row 1

and nova cli returns 200 and a message as follows:

+-----+------+-----------+------+-----------+------+-------+--------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+-----+------+-----------+------+-----------+------+-------+--------------+-----------+
| 100 | foo | 1 | 1 | 0 | | 1 | 3.402823e+48 | True |
+-----+------+-----------+------+-----------+------+-------+--------------+-----------+

i.e. indicating that the full value has been written successfully. If you then do a nova flavour-list and look at the rxtx_factor:

+-----+------+-----------+------+-----------+------+-------+--------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+-----+------+-----------+------+-----------+------+-------+--------------+-----------+
| 100 | foo | 1 | 1 | 0 | | 1 | 3.40282e+38 | True |

we see that the value was actually truncated to fit the max value for Float. While it is not likely that such large values would be used, it would be better if the call failed (400) and only succeeded if valid values were supplied.

Changed in nova:
status: New → In Progress
assignee: nobody → Edward Hope-Morley (hopem)
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/60887

Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/60887
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3c9ed4c6ed216d018076de9f1391dae36b28a883
Submitter: Jenkins
Branch: master

commit 3c9ed4c6ed216d018076de9f1391dae36b28a883
Author: Edward Hope-Morley <email address hidden>
Date: Mon Dec 9 17:26:04 2013 +0000

    Guard against oversize flavor rxtx_factor float

    We now check that rxtx_factor provided is not greater than
    the Float type to be stored in the db. While the check is not
    100% accurate due to float approximation it will be very
    close to the max allowable. A 400 error is returned if the
    provided value is too big.

    Closes-Bug: 1259213
    Change-Id: I72c52fa46d75275c45e72b6f5a36106d5abf8220
    Co-authored-by: Takashi Natsume <email address hidden>

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.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.