Upper bounds checking not performed on flavor-create API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Christopher Yeoh |
Bug Description
The flavor-create API does validation that root_gb and other integer values are positive integers but it doesn't do an upper bounds check to make sure they aren't longs. If a user tries to create a flavor with an integer value that is bigger than an int, the python int() method (used in the validation) will just convert it to a long but the database model for InstanceTypes defines the column as an Integer (not a BigInteger) and then the database has to handle the value.
Some examples:
http://
The nova.compute.
From the DB model, it looks like these are the fields that need the validation:
memory_mb = Column(Integer, nullable=False)
vcpus = Column(Integer, nullable=False)
root_gb = Column(Integer)
ephemeral_gb = Column(Integer)
swap = Column(Integer, nullable=False, default=0)
vcpu_weight = Column(Integer)
tags: | added: api db |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in nova: | |
assignee: | nobody → Christopher Yeoh (cyeoh-0) |
Changed in nova: | |
milestone: | none → icehouse-1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-1 → 2014.1 |
The validation I'm referring to is here:
https:/ /github. com/openstack/ nova/blob/ 2013.2/ nova/compute/ flavors. py#L120
https:/ /github. com/openstack/ nova/blob/ 2013.2/ nova/compute/ flavors. py#L130
It doesn't look like vcpu_weight is validated.