← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1368667] Re: Nova supports creating flavor with an existing ID if the previous flavor(with same ID) is in deleted state.

 

Realistically, I don't think this is a bug in the state machine, I think
it's a bug in the display. Instances show should not show the flavor
from the db, it should show the information from the instance metadata.

** Changed in: nova
       Status: New => Confirmed

** Changed in: nova
   Importance: Undecided => Low

** Changed in: nova
       Status: Confirmed => Invalid

** Also affects: python-novaclient
   Importance: Undecided
       Status: New

** Changed in: python-novaclient
       Status: New => Confirmed

** Changed in: python-novaclient
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1368667

Title:
  Nova supports creating flavor with an existing ID if the previous
  flavor(with same ID) is in deleted state.

Status in OpenStack Compute (Nova):
  Invalid
Status in Python client library for Nova:
  Confirmed

Bug description:
  Nova supports creating flavor with an existing ID if the previous
  flavor(with same ID) is in deleted state.

  1 Create a new flavor with some ID (in this case 99)

  [root@nova1 ~]# nova flavor-create flavor_1 99 128 1 1
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
  | ID | Name        | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
  | 99 | flavor_1 | 128       | 1    | 0         |      | 1     | 1.0         | True      |
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
    
  2 Now boot a VM with the flavor we just created (flavor_1 with ID 99)

  [root@nova1 ~]# nova boot --image 55479ee4-e28e-4c45-a093-742f71cff25c --flavor 99 --nic net-id=8b0c3729-380f-4949-b471-1acd8a42aa62 vm_test
  +--------------------------------------+----------------------------------------------------------------+
  | Property                             | Value                                                          |
  +--------------------------------------+----------------------------------------------------------------+
  | flavor                               | flavor_1 (99)                                               |
  | hostId                               |                                                                |
  | id                                   | 4d08c60e-1771-48ca-93ec-35aa30097e01                           |
  | image                                | cirros-0.3.1-x86_64-uec (55479ee4-e28e-4c45-a093-742f71cff25c) |
  | name                                 | vm_test                                                        |
  +--------------------------------------+----------------------------------------------------------------+

  3 Delete the flavor that was created in Step1 (flavor_1, ID = 99)

  [root@nova1 ~]# nova flavor-delete 99
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
  | ID | Name        | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
  | 99 | flavor_1 | 128       | 1    | 0         |      | 1     | 1.0         | True      |
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+

  4 Run nova show vm_test to get the details of the instance
  [root@nova1 ~]# nova show vm_test
  +--------------------------------------+----------------------------------------------------------------+
  | Property                             | Value                                                          |
  +--------------------------------------+----------------------------------------------------------------+
  | flavor                               | flavor_1 (99)                                               |
  | hostId                               | 2af068c472a702b23c0bb6fc39be58cad4620aebc8f5c7f66535b277       |
  | id                                   | 4d08c60e-1771-48ca-93ec-35aa30097e01                           |
  | image                                | cirros-0.3.1-x86_64-uec (55479ee4-e28e-4c45-a093-742f71cff25c) |
  | name                                 | vm_test                                                        |
  +--------------------------------------+----------------------------------------------------------------+

  5 Now create an other flavor with the same ID(99) and different
  specifications

  [root@nova1 ~]#  nova flavor-create flavor_2 99 512 6 4
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
  | ID | Name        | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+
  | 99 | flavor_2    | 512       | 6    | 0         |      | 4     | 1.0         | True      |
  +----+-------------+-----------+------+-----------+------+-------+-------------+-----------+

  6 Run nova show again to get the details of the instance vm_test
  +--------------------------------------+----------------------------------------------------------------+
  | Property                             | Value                                                          |
  +--------------------------------------+----------------------------------------------------------------+
  | flavor                               | flavor_2 (99)                                               |
  | hostId                               | 2af068c472a702b23c0bb6fc39be58cad4620aebc8f5c7f66535b277       |
  | id                                   | 4d08c60e-1771-48ca-93ec-35aa30097e01                           |
  | image                                | cirros-0.3.1-x86_64-uec (55479ee4-e28e-4c45-a093-742f71cff25c) |
  | name                                 | vm_test                                                        |                          |
  +--------------------------------------+----------------------------------------------------------------+

  
  Instance vm_test now shows flavor_2 as the flavor because it has the same id as flavor_1. The issue is that both the flavor have different specifications so this information can be misleading. 

  Expected Result :- 
  1. We should not allow the creation of a flavor with an existing ID (even if the the flavor mapped to the existing ID is in deleted state) 
  Or
  2. VM's mapped to the old flavor should continue to map to the same flavor as we are not sure that the specifications for both the flavors will be same so this should not be allowed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1368667/+subscriptions


References