flavor show shouldn't read deleted flavors.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Triaged
|
Undecided
|
Rohan | ||
OpenStack Compute (nova) |
Triaged
|
Low
|
Abhishek Talwar | ||
OpenStack Dashboard (Horizon) |
In Progress
|
Undecided
|
Rohan | ||
python-novaclient |
Triaged
|
Low
|
Abhishek Talwar |
Bug Description
An instance type is created by:
return db.instance_
which uses the read_deleted="no" from the admin context.
This means, as seen in nova/tests/
def test_read_
"""
Ensure deleted instance types are not returned when not needed (for
example when creating a server and attempting to translate from
flavorid to instance_type_id.
"""
instance_
instance_
instance_
instance_type = instance_
self.
flavors with colliding ids can exist in the database.
From the test we see this looks intended, however it results in undesirable results if we consider the following scenario.
For 'show' in the flavors api, it uses read_deleted="yes". The reason for this is if a vm was created in the past with a now-deleted flavor, 'nova show' can still show the flavor name that was specified for that vm creation. The flavor name is retrieved using the flavor id stored with the instance.
Well, if there are colliding flavor ids in the database, the first of the duplicates will be picked, and it may not be the correct flavor for the vm.
This leads me to believe that maybe at flavor create time, colliding ids should not be allowed, i.e. use
return db.instance_
to prevent the possibility of colliding flavor ids.
description: | updated |
Changed in nova: | |
assignee: | nobody → Rohan (kanaderohan) |
Changed in nova: | |
assignee: | Rohan (kanaderohan) → Shrirang Phadke (shrirangphadke) |
Changed in nova: | |
assignee: | Shrirang Phadke (shrirangphadke) → Rohan (kanaderohan) |
Changed in python-novaclient: | |
assignee: | nobody → Rohan (kanaderohan) |
Changed in horizon: | |
assignee: | nobody → Rohan (kanaderohan) |
Changed in tempest: | |
assignee: | nobody → Rohan (kanaderohan) |
Changed in python-novaclient: | |
importance: | Undecided → Wishlist |
no longer affects: | tempest |
Changed in ceilometer: | |
assignee: | nobody → Rohan (kanaderohan) |
Changed in ceilometer: | |
status: | New → Triaged |
tags: | added: api |
Changed in nova: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in python-novaclient: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in nova: | |
assignee: | nobody → Abhishek Talwar (abhishek-talwar) |
Changed in python-novaclient: | |
assignee: | nobody → Abhishek Talwar (abhishek-talwar) |
I don't think that such approach is good.
If we have another situation.
User has create some flavor than he deleted it, and then he want to create one more time with same flavorid and he couldn't do it... Why?
For example if we are using dashboard then flavor update method do next: (delete old flavor, create new with same name but other parameters) So there will be a lot of problems...
Probably the right way is to store in instances not only flavorid but also instance_type_id but I am not sure...