New flavor name may be the same as existent flavor id

Bug #1584025 reported by aohuanxuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Invalid
Undecided
Unassigned

Bug Description

(openstack) flavor list
+----+-----------+-------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+-------+------+-----------+-------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | 1 | True |
| 2 | m1.small | 2048 | 20 | 0 | 1 | True |
| 3 | m1.medium | 4096 | 40 | 0 | 2 | True |
| 4 | m1.large | 8192 | 80 | 0 | 4 | True |
| 42 | m1.nano | 64 | 0 | 0 | 1 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | 8 | True |
| 84 | m1.micro | 128 | 0 | 0 | 1 | True |
| c1 | cirros256 | 256 | 0 | 0 | 1 | True |
| d1 | ds512M | 512 | 5 | 0 | 1 | True |
| d2 | ds1G | 1024 | 10 | 0 | 1 | True |
| d3 | ds2G | 2048 | 10 | 0 | 2 | True |
| d4 | ds4G | 4096 | 20 | 0 | 4 | True |
+----+-----------+-------+------+-----------+-------+-----------+
The flavor list shows that the ID of existent flavor is particular because it is not a uuid but a string.(Such as "1","2","42","c1","d3"...)

We know flavor name is a string too,so if we create a new flavor,the new flavor name may be the same as the existent flavor id.
for example:
(openstack) flavor create 1
+----------------------------+--------------------------------------+
| Field | Value |
+----------------------------+--------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 0 |
| id | ccda0d67-e98d-42a9-96f8-7531c381048c |
| name | 1 |
| os-flavor-access:is_public | True |
| ram | 256 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+--------------------------------------+
I create a new flavor named "1" which is the same as a existent flavor ID "1".
Then I want to show this new flavor.
(openstack) flavor show 1
+----------------------------+---------+
| Field | Value |
+----------------------------+---------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 1 |
| id | 1 |
| name | m1.tiny |
| os-flavor-access:is_public | True |
| properties | |
| ram | 512 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+---------+
We can see,we showed not the new flavor but a flavor which id is "1",the reason is that commands always find a flavor by ID at first.
So,I think it is necessary to avoid sameness between new flavor name and existent flavor ID.

aohuanxuan (huanxuan-ao)
Changed in python-openstackclient:
assignee: nobody → aohuanxuan (huanxuan-ao)
summary: - New flavor name may be the same with existent flavor id
+ New flavor name may be the same as existent flavor id
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/319523

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

Change abandoned by Huanxuan Ao (<email address hidden>) on branch: master
Review: https://review.openstack.org/319523

Revision history for this message
Steve Martinelli (stevemar) wrote :

Flavors can have the same name, this is fine.

Changed in python-openstackclient:
status: In Progress → Invalid
assignee: aohuanxuan (huanxuan-ao) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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