Bug 1023358

Summary: nova displays incorrect flavor name when a flavor with same id is recreated
Product: Red Hat OpenStack Reporter: Dharmit Shah <dshah>
Component: python-novaclientAssignee: Solly Ross <sross>
Status: CLOSED CURRENTRELEASE QA Contact: Ami Jeain <ajeain>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: dallan, hateya, jruzicka, ndipanov, sankarshan, sclewis, sputhenp, sross, yeylon
Target Milestone: asyncKeywords: ZStream
Target Release: 4.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-19 20:19:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dharmit Shah 2013-10-25 09:19:53 UTC
Description of problem:
"nova boot", "nova show <instance-id>" and "nova show <instance-name>" commands display incorrect flavor name when a flavor with id (say 10) is deleted and new flavor with same id but different name is created.

Version-Release number of selected component (if applicable):
python-novaclient-2.13.0-2.el6ost.noarch

How reproducible:
Always

Steps to Reproduce:

1. Create two flavors with flavor-id 10 and 20.
# nova flavor-create --ephemeral 5 --swap 2048 dharmit 10 1024 5 1
# nova flavor-create --ephemeral 5 --swap 2048 dharmit_2 20 1024 5 1
# 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      | {}          |
| 10                                   | dharmit           | 1024      | 5    | 5         | 2048 | 1     | 1.0         | True      | {}          |
| 1443d192-6496-4d0f-9caa-313b998acfb8 | cirros-512        | 512       | 5    | 2         | 512  | 1     | 1.0         | True      | {}          |
| 2                                    | m1.small          | 2048      | 20   | 0         |      | 1     | 1.0         | True      | {}          |
| 20                                   | dharmit_2         | 1024      | 5    | 5         | 2048 | 1     | 1.0         | True      | {}          |
| 3                                    | m1.medium         | 4096      | 40   | 0         |      | 2     | 1.0         | True      | {}          |
| 4                                    | m1.large          | 8192      | 80   | 0         |      | 4     | 1.0         | True      | {}          |
| 5                                    | m1.xlarge         | 16384     | 160  | 0         |      | 8     | 1.0         | True      | {}          |
| 9f3df894-f4d6-4c1b-9611-97e793f32c00 | Sadique           | 1024      | 10   | 1         | 512  | 2     | 1.0         | True      | {}          |
| ef2db5db-8089-48e0-8538-5d6402576a90 | sraje-test-flavor | 8192      | 10   | 1         | 2048 | 4     | 1.0         | True      | {}          |
+--------------------------------------+-------------------+-----------+------+-----------+------+-------+-------------+-----------+-------------+

2. Delete the above created flavors
# nova flavor-delete 10
# nova flavor-delete 20
# 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      | {}          |
| 1443d192-6496-4d0f-9caa-313b998acfb8 | cirros-512        | 512       | 5    | 2         | 512  | 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      | {}          |
| 5                                    | m1.xlarge         | 16384     | 160  | 0         |      | 8     | 1.0         | True      | {}          |
| 9f3df894-f4d6-4c1b-9611-97e793f32c00 | Sadique           | 1024      | 10   | 1         | 512  | 2     | 1.0         | True      | {}          |
| ef2db5db-8089-48e0-8538-5d6402576a90 | sraje-test-flavor | 8192      | 10   | 1         | 2048 | 4     | 1.0         | True      | {}          |
+--------------------------------------+-------------------+-----------+------+-----------+------+-------+-------------+-----------+-------------+

3. Create a new flavor with flavor-id 20 but different name.
# nova flavor-create --ephemeral 5 --swap 2048 dharmit_3 20 1024 5 1
# 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      | {}          |
| 1443d192-6496-4d0f-9caa-313b998acfb8 | cirros-512        | 512       | 5    | 2         | 512  | 1     | 1.0         | True      | {}          |
| 2                                    | m1.small          | 2048      | 20   | 0         |      | 1     | 1.0         | True      | {}          |
| 20                                   | dharmit_3         | 1024      | 5    | 5         | 2048 | 1     | 1.0         | True      | {}          |
| 3                                    | m1.medium         | 4096      | 40   | 0         |      | 2     | 1.0         | True      | {}          |
| 4                                    | m1.large          | 8192      | 80   | 0         |      | 4     | 1.0         | True      | {}          |
| 5                                    | m1.xlarge         | 16384     | 160  | 0         |      | 8     | 1.0         | True      | {}          |
| 9f3df894-f4d6-4c1b-9611-97e793f32c00 | Sadique           | 1024      | 10   | 1         | 512  | 2     | 1.0         | True      | {}          |
| ef2db5db-8089-48e0-8538-5d6402576a90 | sraje-test-flavor | 8192      | 10   | 1         | 2048 | 4     | 1.0         | True      | {}          |
+--------------------------------------+-------------------+-----------+------+-----------+------+-------+-------------+-----------+-------------+

4. Create a VM using "nova boot".
# nova boot cirros-vm --image "d69c6c8b-0589-4617-9279-20e9a16b17a9" --flavor 20 
+-------------------------------------+--------------------------------------+
| Property                            | Value                                |
+-------------------------------------+--------------------------------------+
| status                              | BUILD                                |
| updated                             | 2013-10-25T08:19:09Z                 |
| OS-EXT-STS:task_state               | scheduling                           |
| OS-EXT-SRV-ATTR:host                | None                                 |
| key_name                            | None                                 |
| image                               | cirros                               |
| hostId                              |                                      |
| OS-EXT-STS:vm_state                 | building                             |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000056                    |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                 |
| flavor                              | dharmit_2                            |  <------------- This flavor was actually removed.
| id                                  | 3acb40d0-72d2-475f-88cc-139f31e4e247 |
| security_groups                     | [{u'name': u'default'}]              |
| user_id                             | c85e09def151404681f68286693720b2     |
| name                                | cirros-vm                            |
| adminPass                           | rSB9gMk4hZwn                         |
| tenant_id                           | 7b0c30fce02d4fc79a41ce8917238943     |
| created                             | 2013-10-25T08:19:09Z                 |
| OS-DCF:diskConfig                   | MANUAL                               |
| metadata                            | {}                                   |
| accessIPv4                          |                                      |
| accessIPv6                          |                                      |
| progress                            | 0                                    |
| OS-EXT-STS:power_state              | 0                                    |
| OS-EXT-AZ:availability_zone         | nova                                 |
| config_drive                        |                                      |
+-------------------------------------+--------------------------------------+

5. Use "nova show" commands.
# nova show 3acb40d0-72d2-475f-88cc-139f31e4e247
+-------------------------------------+-----------------------------------------------------------------------+
| Property                            | Value                                                                 |
+-------------------------------------+-----------------------------------------------------------------------+
| status                              | ACTIVE                                                                |
| updated                             | 2013-10-25T08:19:22Z                                                  |
| OS-EXT-STS:task_state               | None                                                                  |
| OS-EXT-SRV-ATTR:host                | hp-dl160g6-1.gsslab.pnq.redhat.com                                    |
| ext network                         | 10.65.216.134                                                         |
| key_name                            | None                                                                  |
| image                               | cirros (d69c6c8b-0589-4617-9279-20e9a16b17a9)                         |
| int network                         | 192.168.35.15                                                         |
| hostId                              | 07690c9fef59717f92d0fc73433d658a3e93967668369a7097783dd9              |
| OS-EXT-STS:vm_state                 | active                                                                |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000056                                                     |
| OS-EXT-SRV-ATTR:hypervisor_hostname | hp-dl160g6-1.gsslab.pnq.redhat.com                                    |
| flavor                              | dharmit_2 (20)                                                        |  <----------- incorrect flaovor name
| id                                  | 3acb40d0-72d2-475f-88cc-139f31e4e247                                  |
| security_groups                     | [{u'name': u'default'}, {u'name': u'default'}, {u'name': u'default'}] |
| user_id                             | c85e09def151404681f68286693720b2                                      |
| name                                | cirros-vm                                                             |
| created                             | 2013-10-25T08:19:09Z                                                  |
| tenant_id                           | 7b0c30fce02d4fc79a41ce8917238943                                      |
| OS-DCF:diskConfig                   | MANUAL                                                                |
| metadata                            | {}                                                                    |
| accessIPv4                          |                                                                       |
| accessIPv6                          |                                                                       |
| test_network-1 network              | 172.16.0.2                                                            |
| progress                            | 0                                                                     |
| OS-EXT-STS:power_state              | 1                                                                     |
| OS-EXT-AZ:availability_zone         | nova                                                                  |
| config_drive                        |                                                                       |
+-------------------------------------+-----------------------------------------------------------------------+

Actual results:
Incorrect flavor name in "nova boot" and "nova show" commands.

Expected results:
Correct flavor name in "nova boot" and "nova show" commands.

Additional info:

Comment 8 Solly Ross 2013-12-19 20:19:22 UTC
not needed in RHOS 3.0 anymore and was NAB in RHOS 4.0, closing