deleted (then replaced) flavors keep the old name in nova show

Bug #1183259 reported by LaMont Jones
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Unassigned

Bug Description

If I create a flavor and then delete it and create it anew, the original name comes out in nova show and elsewhere. I suspect that the DB query is lacking a "(deleted=0)"

To reproduce:
 OS_TENANT_NAME=admin nova flavor-create foo 1010 1024 10 1
 OS_TENANT_NAME=admin nova flavor-delete foo
 OS_TENANT_NAME=admin nova flavor-create bar 1010 2048 10 1
 nova boot --flavor=bar --image=$WHATEVER baz
 #See how the output says that the flavor is "foo (1010)"
 nova show baz <-- also says foo

This is using: 1:2013.1-0ubuntu2.1~cloud0

LaMont Jones (lamont)
tags: added: canonical-webops
Changed in nova:
status: New → Confirmed
assignee: nobody → surendra reddy narala (narala-surendra)
Michael Still (mikal)
tags: added: ops
Changed in nova:
importance: Undecided → Low
LaMont Jones (lamont)
tags: added: prodstack
Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

I cannot reproduce this bug with the latest git tree. The flavor used is "bar", as expected, and not "foo". Can you still reproduce this bug ?

Revision history for this message
Yan Huang (yanhcdl) wrote :

I can reproduce this problem in both folsom and grizzly:
#nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True | {} |
| 2 | m1.small | 2048 | 10 | 20 | | 1 | 1.0 | True | {} |
| 3 | m1.medium | 4096 | 10 | 40 | | 2 | 1.0 | True | {} |
| 4 | m1.large | 8192 | 10 | 80 | | 4 | 1.0 | True | {} |
| 5 | m1.xlarge | 16384 | 10 | 160 | | 8 | 1.0 | True | {} |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
#nova flavor-delete 3

# nova flavor-create newmedium 3 2048 15 2
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 3 | newmedium | 2048 | 15 | 0 | | 2 | 1 | True | {} |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
# nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+-------------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True | {} |
| 2 | m1.small | 2048 | 10 | 20 | | 1 | 1.0 | True | {} |
| 3 | newmedium | 2048 | 15 | 0 | | 2 | 1.0 | True | {} |
| 4 | m1.large | 8192 | 10 | 80 | | 4 | 1.0 | True | {} |
| 5 | m1.xlarge | 16384 | 10 | 160 | | 8 | 1.0 | True | {} |

# nova boot --image 229ac0e5-1c38-44b1-a521-d41db8baf343 --flavor newmedium ros
+-------------------------------------+----------------------------------------------------------+
| Property | Value |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-SRV-ATTR:host | sco-vmw-13-fb |
| OS-EXT-SRV-ATTR:hypervisor_hostname | sco-vmw-13-fb |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | 7VcZJVCrGCux |
| config_drive | |
| created | 2013-07-26T11:22:02Z |
| flavor | m1.medium |
| hostId | d4356d97491fde4a9fe9906e04672663ff30c208752eeda6a8fd4767 |
| id | 7a102098-3b0f-422e-9db2-0e0cf013957b |
| image | Fedora.ova |
| key_name | None |
| metadata | {} |
| name | ros |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| tenant_id | 6a322c1e077e44eab4dcadf9a452b46e |
| updated | 2013-07-26T11:22:02Z |
| user_id | 18c18022a1474250b36d489ecfacc004 |
+-------------------------------------+----------------------------------------------------------+

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

OK, I can reproduce this in Grizzly, but not in HEAD, so it must have been fixed at some point. It's quite a PITA to bisect and I have no idea which commit fixed this. Do you need a backport to Grizzly ?

Revision history for this message
Charlie Zhou (zhouzlin) wrote :

def flavor_get_by_flavor_id(context, flavor_id, read_deleted):
    """Returns a dict describing specific flavor_id."""
    result = _instance_type_get_query(context, read_deleted=read_deleted).\
                        filter_by(flavorid=flavor_id).\
                        first()

the filter_by(flavorid=flavor_id) return different flavor sequence in grizzly and Head. I am not sure whether it's caused by this commit:
https://github.com/openstack/nova/commit/64ce647003b110771331d3daf92980729bd3988e

Changed in nova:
assignee: surendra reddy narala (narala-surendra) → nobody
lizheming (lizheming-li)
Changed in nova:
assignee: nobody → lizheming (lizheming-li)
lizheming (lizheming-li)
Changed in nova:
assignee: lizheming (lizheming-li) → nobody
Revision history for this message
Thang Pham (thang-pham) wrote :
Download full text (8.6 KiB)

I could not reproduce this bug in the latest code upstream.

$ nova flavor-create test 10 1024 5 1
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
| 10 | test | 1024 | 5 | 0 | | 1 | 1.0 | True |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+

$ nova flavor-list
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 0e1f3f32-f5c6-4009-bd14-bb41489c23db | m2.tiny | 1024 | 4 | 0 | 512 | 1 | 1.0 | True |
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 10 | test | 1024 | 5 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 84 | m1.micro | 128 | 0 | 0 | | 1 | 1.0 | True |
| ab03c186-0ae1-4a00-a5a2-bdceaf8a8174 | m2.small | 1024 | 8 | 0 | 1024 | 1 | 1.0 | True |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+

$ nova flavor-delete 10
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+
| 10 | test | 1024 | 5 | 0 | | 1 | 1.0 | True |
+----+------+-----------+------+-----------+------+-------+-------------+-----------+

$ nova flavor-create new.test 10 1024 5 1
+----+----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+----------+-----------+------+-----------+------+-------+-------------+-----------+
| 10 | new.test | 1024 | 5 | 0 | | 1 | 1.0 | True |
+----+----------+-----------+------+----...

Read more...

Thang Pham (thang-pham)
Changed in nova:
status: Confirmed → Incomplete
Revision history for this message
Tom Fifield (fifieldt) wrote :

Looks like this was fixed in icehouse, or havana. I'm marking this bug as fix released. If you are able to reproduce it in a supported version, please reopen.

Changed in nova:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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