nova-manage update_cell does not check if the same combination of transport_url and database_connection already exists
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Surya Seetharaman | ||
Ocata |
Triaged
|
Low
|
Unassigned | ||
Pike |
Triaged
|
Low
|
Surya Seetharaman |
Bug Description
Unlike in nova-manage create_cell, in nova-manage update_cell the check for the same combination of transport-url and database_connection does not exist. Hence it allows a user to update a cell's transport-url and database_connection to another existing cell's configuration which can create inconsistency (if a user accidentally does do it) and should not be allowed IMO.
Steps to Reproduce :
-> nova-manage cell_v2 list_cells
+------
| Name | UUID | Transport URL | Database Connection |
+------
| cell0 | 00000000-
| cell1 | 20f9fd43-
| cell2 | 7acaf644-
+------
-> nova-manage cell_v2 update_cell --cell-uuid 7acaf644-
Expected result
===============
"Cell with the specified transport_url and database_connection combination already exists"
Actual result
=============
-> nova-manage cell_v2 list_cells
+------
| Name | UUID | Transport URL | Database Connection |
+------
| cell0 | 00000000-
| cell1 | 20f9fd43-
| cell2 | 7acaf644-
+------
Solution : The same kind of check in nova-manage create_cell needs to be done in nova-manage update_cell as well.
Ideally we'd just have a unique constraint across those two columns in the cell_mappings table in the API database, but I'm not sure if there is a case where we'd want more than once cell to have the same db/transport urls, probably not, especially since we don't have a concept of disabled cells.