User-created flavors do not enforce flavor id uniqueness

Bug #1425747 reported by Darren Sanders
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Low
Noel Nelson Dsouza

Bug Description

The nova API makes an implicit assumption that the "flavorid" field is unique, but under certain circumstances this is not enforced. This results in incorrect behavior in the situation where a deleted flavor's flavorid is re-used for a new flavor. Any instances that are associated to the deleted flavor will now appear to be associated to the new flavor that re-used the id.

Steps to reproduce:

  1. Create a flavor named FOO with a flavorid of 5
  2. Create an instance using flavor FOO
  3. Delete the flavor FOO
  4. Create a flavor named BAR with a flavorid of 5

Look at the instance detail for the launched instance

Expected Behavior:

The instance detail says the instance is launched against FOO

Actual Behavior:

The instance detail says the instance is launched against BAR

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Eric Xie (mark-xiett) wrote :

Infos of "flavor" for instance were stored in the nova-db's table "instance_system_metadata".
| 2015-03-01 01:45:29 | NULL | NULL | 3258 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_memory_mb | 1024 | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3259 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_swap | 0 | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3260 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_vcpu_weight | NULL | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3261 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_root_gb | 10 | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3262 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_id | 39 | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3263 | f65c4708-e419-4e82-9a41-1e7fb6940115 | requested_network_num | 1 | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3264 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_name | FOO | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3265 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_ephemeral_gb | 0 | 0 |
| 2015-03-01 01:45:29 | NULL | NULL | 3266 | f65c4708-e419-4e82-9a41-1e7fb6940115 | instance_type_rxtx_factor | 1.0

I think that the flavor info can be got from the "instance_system_metadata" table instead of the record of "instance_types" table got by "flavorid".

Revision history for this message
Eli Qiao (taget-9) wrote :

hi Eric,
flavor id is not stored in instance_system_metadata any more, it is now in instance_extra

check this bp in K

http://specs.openstack.org/openstack/nova-specs/specs/kilo/approved/flavor-from-sysmeta-to-blob.html

Revision history for this message
Feodor Tersin (ftersin) wrote :

Nova API returns only flavor id. The API should be extended to get the original flavor details.

Changed in nova:
assignee: nobody → Noel Nelson Dsouza (noelnelson)
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/186665

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/186665
Reason: This review has been stalled for a long time, so I am abandoning it to keep the code review queue sane. Please restore the change when the code is ready for review.

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/217674

Revision history for this message
Chris St. Pierre (stpierre) wrote :

This is likely a duplicate of 1175667, 1183259, 1231226, and/or 1288636.

Revision history for this message
Chris St. Pierre (stpierre) wrote :

I take that back; on further investigation, those four bugs all address booting a new instance from a flavor that shares a flavor ID with a deleted flavor; this bug deals with deleting the flavor out from under a running instance, and creating a duplicate flavor ID.

Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/217674
Reason: See https://review.openstack.org/#/c/265282/

Matt Riedemann (mriedem)
Changed in nova:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.