Public bug reported: Current way of working * Cell name in nova is just a symbolic thing but not really used and not forced to be unique or even required to be provided when the cell is created * nova-manage cell_v2 create_cell generates a uuid for the new cell. But does not allow passing a uuid from the client. * the user requests cells with a name as it is easier to talk about cell0 and cell1 than an uuid. * the installer (nova-operator) ensures that cell hosting the top level services is always called cell0 and always exists. * the installer (nova-operator) ensures that the cell name are unique. * all the nova-manage cell_v2 command manipulating a cell (update / delete) requires the cell uuid to be passed. * the installer (nova-operator) has no easy way to propagate back the uuid from the cell creation to the k8s layers and therefore today the installer does not persist the cell uuid.
Problem So today the installe3r needs to look up the cell uuid by grepping for the cell name in the nova-manage cell_v2 list_cells output. This leads to a very hackish code[1]: # NOTE(gibi): nova-manage should be enhanced upstream to get rid of this # uglyness # Note the "|" around the CELL_NAME, that is needed as a single line from # nova-manage cell_v2 cell_list can match to multiple cells if the cell name # is part of the line, e.g. as the user name of the DB URL cell_uuid=$(nova-manage cell_v2 list_cells | tr ' ' '|' | tr --squeeze-repeats '|' | grep -e "^|$CELL_NAME|" | cut -d '|' -f 3) Proposed solution Enhance nova-manage cell_v2 to be able to improve the installer logic. Either: * allow cell name to be used in update_cell and delete_cell instead of cell uuid. * add an option to nova_manage cell_v2 to return easily machine readable output. * allow the client to pass a uuid during cell creation. This way the installer could generate and persist the uuid in the k8s layer and pass it down for the cell creation and later for cell manipulation. [1] https://github.com/openstack-k8s-operators/nova- operator/blob/b05427a4ffbfac7655a53aff5401d276485310ab/templates/nova- manage/bin/ensure_cell_mapping.sh#L20-L25 ** Affects: nova Importance: Undecided Status: New ** Tags: low-hanging-fruit nova-manage ** Tags added: nova-m ** Tags removed: nova-m ** Tags added: low-hanging-fruit nova-manage -- 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/2108980 Title: Improve nova-manage cell_v2 command to work by cell names Status in OpenStack Compute (nova): New Bug description: Current way of working * Cell name in nova is just a symbolic thing but not really used and not forced to be unique or even required to be provided when the cell is created * nova-manage cell_v2 create_cell generates a uuid for the new cell. But does not allow passing a uuid from the client. * the user requests cells with a name as it is easier to talk about cell0 and cell1 than an uuid. * the installer (nova-operator) ensures that cell hosting the top level services is always called cell0 and always exists. * the installer (nova-operator) ensures that the cell name are unique. * all the nova-manage cell_v2 command manipulating a cell (update / delete) requires the cell uuid to be passed. * the installer (nova-operator) has no easy way to propagate back the uuid from the cell creation to the k8s layers and therefore today the installer does not persist the cell uuid. Problem So today the installe3r needs to look up the cell uuid by grepping for the cell name in the nova-manage cell_v2 list_cells output. This leads to a very hackish code[1]: # NOTE(gibi): nova-manage should be enhanced upstream to get rid of this # uglyness # Note the "|" around the CELL_NAME, that is needed as a single line from # nova-manage cell_v2 cell_list can match to multiple cells if the cell name # is part of the line, e.g. as the user name of the DB URL cell_uuid=$(nova-manage cell_v2 list_cells | tr ' ' '|' | tr --squeeze-repeats '|' | grep -e "^|$CELL_NAME|" | cut -d '|' -f 3) Proposed solution Enhance nova-manage cell_v2 to be able to improve the installer logic. Either: * allow cell name to be used in update_cell and delete_cell instead of cell uuid. * add an option to nova_manage cell_v2 to return easily machine readable output. * allow the client to pass a uuid during cell creation. This way the installer could generate and persist the uuid in the k8s layer and pass it down for the cell creation and later for cell manipulation. [1] https://github.com/openstack-k8s-operators/nova- operator/blob/b05427a4ffbfac7655a53aff5401d276485310ab/templates/nova- manage/bin/ensure_cell_mapping.sh#L20-L25 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/2108980/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp