Nova flavor-show should not get deleted flavor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Qing Xin Meng |
Bug Description
Issue #1
A deleted flavor still could be shown
Issue #2
Create another flavor with some different parameters, and the id is same with the deleted flavor id, after creation, run the command "nova flavor-show id", it still shows the information of the deleted flavor.
Recreate these issues.
===
===
[root@localhost ˜]# nova flavor-list
+----+-
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | I s_Public | extra_specs |
+----+-
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | T rue | {} |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | T rue | {} |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | T rue | {} |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | T rue | {} |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | T rue | {} |
+----+-
[root@localhost ˜]# nova flavor-create flavor6 6 128 0 1
+----+-
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-
| 6 | flavor6 | 128 | 0 | 0 | | 1 | 1.0 | True | {} |
+----+-
[root@localhost ˜]# 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 | 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 | {} |
| 6 | flavor6 | 128 | 0 | 0 | | 1 | 1.0 | True | {} |
+----+-
[root@localhost ˜]# nova flavor-delete 6
[root@localhost ˜]# 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 | 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 | {} |
+----+-
[root@localhost ˜]# nova flavor-show 6
+------
| Property | Value |
+------
| name | flavor6 |
| ram | 128 |
| OS-FLV-
| vcpus | 1 |
| extra_specs | {} |
| swap | |
| os-flavor-
| rxtx_factor | 1.0 |
| OS-FLV-
| disk | 0 |
| id | 6 |
+------
[root@localhost ˜]# nova flavor-create flavor_t 6 256 1 1
+----+-
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | extra_specs |
+----+-
| 6 | flavor_t | 256 | 1 | 0 | | 1 | 1.0 | True | {} |
+----+-
[root@localhost ˜]# nova flavor-show 6
+------
| Property | Value |
+------
| name | flavor6 |
| ram | 128 |
| OS-FLV-
| vcpus | 1 |
| extra_specs | {} |
| swap | |
| os-flavor-
| rxtx_factor | 1.0 |
| OS-FLV-
| disk | 0 |
| id | 6 |
+------
[root@localhost ˜]#
===
Changed in nova: | |
assignee: | nobody → Satyanarayana Patibandla (satya-patibandla-i) |
status: | New → Confirmed |
Changed in nova: | |
status: | Confirmed → In Progress |
Fixed this issue when i changed code from:
def get_instance_ type_by_ flavor_ id(flavorid, ctxt=None, read_deleted= "yes"):
to
def get_instance_ type_by_ flavor_ id(flavorid, ctxt=None, read_deleted="no"):
What do you think this?