)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"169c5a77cf789da4dee7a2ff7d5bd54aaa316ee2","unresolved":false,"context_lines":[{"line_number":10,"context_line":"using which the nova.compute_node records and nova_api.resource_provider"},{"line_number":11,"context_line":"records will be purged when the host is deleted along with its mapping."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch also modifies the ``force`` option in nova-manage cell_v2"},{"line_number":14,"context_line":"delete_cell to purge the nova.compute_node records instead of just"},{"line_number":15,"context_line":"unmapping them and also removes the nova_api.resource_provider"},{"line_number":16,"context_line":"records before deleting the host and cell mappings."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df7087c5_5cb2b64a","line":14,"range":{"start_line":13,"start_character":0,"end_line":14,"end_character":11},"updated":"2018-03-15 16:09:39.000000000","message":"When we talked about this previously, I don\u0027t think Dan liked the idea of making the force option handle two things, i.e. what it did before, but now also this new thing. I think what he suggested was rather than change the behavior of --force, add a new --recursive option (something like that) to indicate that when you\u0027re deleting the cell you should also delete the host mappings, compute nodes records, and related resource providers in placement.","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8b5b71b3693a36ebad46c517cc0df63b5202ed16","unresolved":false,"context_lines":[{"line_number":10,"context_line":"using which the nova.compute_node records and nova_api.resource_provider"},{"line_number":11,"context_line":"records will be purged when the host is deleted along with its mapping."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch also modifies the ``force`` option in nova-manage cell_v2"},{"line_number":14,"context_line":"delete_cell to purge the nova.compute_node records instead of just"},{"line_number":15,"context_line":"unmapping them and also removes the nova_api.resource_provider"},{"line_number":16,"context_line":"records before deleting the host and cell mappings."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df7087c5_7cd3fa04","line":14,"range":{"start_line":13,"start_character":0,"end_line":14,"end_character":11},"in_reply_to":"df7087c5_5cb2b64a","updated":"2018-03-15 16:24:13.000000000","message":"I remember that we were planning to add the --no-placement option for this. But the use case provided was \"in case placement is not reachable..... we should not purge the compute node records as it would orphan the RP records\". But this does not add up for me because:\n\n1. This could easily be the same case as the cellDB not being reachable and we remove the RP record but fail to remove the compute node record?\n2. I think having \"force\" on delete_host remove the records and \"force\" on delete_cell just do the unmapping and not remove the records (if we add --no-placement) makes it inconsistent.\n\nI mean I am not completely convinced with this new --no-placement flag. Or should it be --yes-placement flag because it indicates that we should do the deletion of records also right ?","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"67c480229aa5b4946d9b25cfff60a8bef3392758","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Cleanup comp_node, res_prov, services, aggregate_hosts during cell deletion"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch adds a ``recursively_force`` option to nova-manage cell_v2"},{"line_number":10,"context_line":"delete_cell using which in addition to just removing host and instance"},{"line_number":11,"context_line":"mappings, it will also remove nodes, hosts from aggregates,"},{"line_number":12,"context_line":"resource_providers (with cascade) and all cell services before deleting"},{"line_number":13,"context_line":"the cell."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7faddb67_f499011f","line":10,"range":{"start_line":10,"start_character":12,"end_line":10,"end_character":38},"updated":"2019-07-05 22:41:56.000000000","message":"Need some re-wording here.","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"}],"doc/source/cli/nova-manage.rst":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f017f719f2c7d8d913d545eaa9f5c82dace4ce87","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    database connection details are shown. Use the --verbose option to see"},{"line_number":236,"context_line":"    transport URL and database connection with their sensitive details."},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"``nova-manage cell_v2 delete_cell --cell_uuid \u003ccell_uuid\u003e [--force] [--recursively_force]``"},{"line_number":239,"context_line":"    Delete a cell by the given uuid. The meaning of the various exit codes"},{"line_number":240,"context_line":"    returned by this command are explained below:"},{"line_number":241,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_a592e153","line":238,"updated":"2018-07-31 16:44:56.000000000","message":"would prefer better wrappage in this paragraph.","commit_id":"b4c85475bf7673fb28b6eba3911bb5febf62d5dd"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"116334251bcf57a1be96bb3ac3ca29a7891bfa85","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    database connection details are shown. Use the --verbose option to see"},{"line_number":236,"context_line":"    transport URL and database connection with their sensitive details."},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"``nova-manage cell_v2 delete_cell --cell_uuid \u003ccell_uuid\u003e [--force] [--recursively_force]``"},{"line_number":239,"context_line":"    Delete a cell by the given uuid. The meaning of the various exit codes"},{"line_number":240,"context_line":"    returned by this command are explained below:"},{"line_number":241,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"5f7c97a3_ee72e8af","line":238,"in_reply_to":"5f7c97a3_a592e153","updated":"2018-08-01 08:44:00.000000000","message":"ack","commit_id":"b4c85475bf7673fb28b6eba3911bb5febf62d5dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2e3d4035436cddd9197fe53443e95cf3ad26a8d2","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":"      Deleting a cell that has compute services with the recursively_force"},{"line_number":261,"context_line":"      option expects that the compute services are actually stopped on their"},{"line_number":262,"context_line":"      hosts. If not, the deletion of running compute services will cause"},{"line_number":263,"context_line":"      re-creation of compute_node records in the database."},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"``nova-manage cell_v2 list_hosts [--cell_uuid \u003ccell_uuid\u003e]``"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5f7c97a3_7bd5fc19","line":262,"range":{"start_line":262,"start_character":62,"end_line":262,"end_character":66},"updated":"2018-08-03 13:59:23.000000000","message":"may (depending on timing), right?","commit_id":"dd122ecafcd3b0fbeb51a61bab479a7c23c9fc35"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8175ea9ff5e1295be293295aada54961699dfffc","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":"      Deleting a cell that has compute services with the recursively_force"},{"line_number":261,"context_line":"      option expects that the compute services are actually stopped on their"},{"line_number":262,"context_line":"      hosts. If not, the deletion of running compute services will cause"},{"line_number":263,"context_line":"      re-creation of compute_node records in the database."},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"``nova-manage cell_v2 list_hosts [--cell_uuid \u003ccell_uuid\u003e]``"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f79a3b5_d5ef44e7","line":262,"range":{"start_line":262,"start_character":62,"end_line":262,"end_character":66},"in_reply_to":"5f7c97a3_7bd5fc19","updated":"2018-08-06 08:14:18.000000000","message":"ack, \"may\" is the right phrase.","commit_id":"dd122ecafcd3b0fbeb51a61bab479a7c23c9fc35"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"26706706ba94e3b591728afff339194bd3dbee2d","unresolved":false,"context_lines":[{"line_number":244,"context_line":"      instance_mappings are deleted successfully with ``--force`` option or the"},{"line_number":245,"context_line":"      compute nodes, services, resource_providers, aggregate_hosts are removed"},{"line_number":246,"context_line":"      in addition to host_mappings and instance_mappings with"},{"line_number":247,"context_line":"      ``recursively_force`` option (the cell deletion happens only if there are"},{"line_number":248,"context_line":"      no living instances)."},{"line_number":249,"context_line":"    * Returns 1 if a cell with that uuid could not be found."},{"line_number":250,"context_line":"    * Returns 2 if host mappings were found for the cell (cell not empty)"}],"source_content_type":"text/x-rst","patch_set":5,"id":"3f79a3b5_a3f22b05","line":247,"range":{"start_line":247,"start_character":8,"end_line":247,"end_character":25},"updated":"2018-08-22 11:27:37.000000000","message":"--recursively_force","commit_id":"0d9967d9845a95a66f4d25bb823645ab86814a17"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"26706706ba94e3b591728afff339194bd3dbee2d","unresolved":false,"context_lines":[{"line_number":248,"context_line":"      no living instances)."},{"line_number":249,"context_line":"    * Returns 1 if a cell with that uuid could not be found."},{"line_number":250,"context_line":"    * Returns 2 if host mappings were found for the cell (cell not empty)"},{"line_number":251,"context_line":"      without ``--force`` and ``recursively_force`` options."},{"line_number":252,"context_line":"    * Returns 3 if there are instances mapped to the cell (cell not empty)"},{"line_number":253,"context_line":"      irrespective of the ``--force`` and ``recursively_force`` options."},{"line_number":254,"context_line":"    * Returns 4 if there are instance mappings to the cell but all instances"}],"source_content_type":"text/x-rst","patch_set":5,"id":"3f79a3b5_c3f5e7ee","line":251,"range":{"start_line":251,"start_character":32,"end_line":251,"end_character":49},"updated":"2018-08-22 11:27:37.000000000","message":"ditto","commit_id":"0d9967d9845a95a66f4d25bb823645ab86814a17"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"26706706ba94e3b591728afff339194bd3dbee2d","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    * Returns 2 if host mappings were found for the cell (cell not empty)"},{"line_number":251,"context_line":"      without ``--force`` and ``recursively_force`` options."},{"line_number":252,"context_line":"    * Returns 3 if there are instances mapped to the cell (cell not empty)"},{"line_number":253,"context_line":"      irrespective of the ``--force`` and ``recursively_force`` options."},{"line_number":254,"context_line":"    * Returns 4 if there are instance mappings to the cell but all instances"},{"line_number":255,"context_line":"      have been deleted in the cell, again without the ``--force`` and"},{"line_number":256,"context_line":"      ``recursively_force`` options."}],"source_content_type":"text/x-rst","patch_set":5,"id":"3f79a3b5_63dc1374","line":253,"range":{"start_line":253,"start_character":44,"end_line":253,"end_character":61},"updated":"2018-08-22 11:27:37.000000000","message":"ditto","commit_id":"0d9967d9845a95a66f4d25bb823645ab86814a17"},{"author":{"_account_id":25562,"name":"Chen","email":"dstbtgagt@foxmail.com","username":"chenn2"},"change_message_id":"26706706ba94e3b591728afff339194bd3dbee2d","unresolved":false,"context_lines":[{"line_number":253,"context_line":"      irrespective of the ``--force`` and ``recursively_force`` options."},{"line_number":254,"context_line":"    * Returns 4 if there are instance mappings to the cell but all instances"},{"line_number":255,"context_line":"      have been deleted in the cell, again without the ``--force`` and"},{"line_number":256,"context_line":"      ``recursively_force`` options."},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    .. note::"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"3f79a3b5_23e61b46","line":256,"range":{"start_line":256,"start_character":8,"end_line":256,"end_character":25},"updated":"2018-08-22 11:27:37.000000000","message":"ditto","commit_id":"0d9967d9845a95a66f4d25bb823645ab86814a17"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a22c109a22a7a0dc217e233d500737c21549589b","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    .. note::"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"      Deleting a cell that has compute services with the recursively_force"},{"line_number":261,"context_line":"      option expects that the compute services are actually stopped on their"},{"line_number":262,"context_line":"      hosts. If not, the deletion of running compute services may cause"},{"line_number":263,"context_line":"      re-creation of compute_node records in the database."}],"source_content_type":"text/x-rst","patch_set":6,"id":"9fb8cfa7_120a2978","line":260,"range":{"start_line":260,"start_character":57,"end_line":260,"end_character":74},"updated":"2019-06-26 16:19:28.000000000","message":"``--recursively_force``","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":"      Deleting a cell that has compute services with the recursively_force"},{"line_number":261,"context_line":"      option expects that the compute services are actually stopped on their"},{"line_number":262,"context_line":"      hosts. If not, the deletion of running compute services may cause"},{"line_number":263,"context_line":"      re-creation of compute_node records in the database."},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"``nova-manage cell_v2 list_hosts [--cell_uuid \u003ccell_uuid\u003e]``"}],"source_content_type":"text/x-rst","patch_set":6,"id":"7faddb67_b4ee2986","line":262,"updated":"2019-07-05 22:40:42.000000000","message":"Should we call the service group API to see if the compute service is up before trying to delete it? That\u0027s something that came up somewhere in the ML thread [1]. It could be time consuming if you have hundreds of services in the cell being deleted, but I guess it depends on how bad it might be if the services aren\u0027t all stopped.\n\n[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/thread.html#7097","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"}],"nova/cmd/manage.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05eac0fed879079942cd15b320983ef0a4da4aca","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"        print(t)"},{"line_number":1378,"context_line":"        return 0"},{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"    @args(\u0027--force\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"},{"line_number":1381,"context_line":"          help\u003d_(\u0027Delete hosts and instance_mappings that belong to the cell \u0027"},{"line_number":1382,"context_line":"                 \u0027as well. The compute_node and the resource_provider records \u0027"},{"line_number":1383,"context_line":"                 \u0027of the nodes under this host will also be deleted.\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_5322a0ba","line":1380,"range":{"start_line":1380,"start_character":13,"end_line":1380,"end_character":18},"updated":"2018-03-15 20:51:32.000000000","message":"I realize this is a legacy argument and so maybe difficult to change at this point, but \"--force\" to me does not make me think \"and also delete this other stuff\".","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b25376a240dc94d182fb82905447b5a3ad55ed5","unresolved":false,"context_lines":[{"line_number":1377,"context_line":"        print(t)"},{"line_number":1378,"context_line":"        return 0"},{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"    @args(\u0027--force\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"},{"line_number":1381,"context_line":"          help\u003d_(\u0027Delete hosts and instance_mappings that belong to the cell \u0027"},{"line_number":1382,"context_line":"                 \u0027as well. The compute_node and the resource_provider records \u0027"},{"line_number":1383,"context_line":"                 \u0027of the nodes under this host will also be deleted.\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_b6be8ad2","line":1380,"range":{"start_line":1380,"start_character":13,"end_line":1380,"end_character":18},"in_reply_to":"df7087c5_5322a0ba","updated":"2018-03-15 20:57:55.000000000","message":"Right, that\u0027s why we were talking about a --recursive or similar option.","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05eac0fed879079942cd15b320983ef0a4da4aca","unresolved":false,"context_lines":[{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"    @args(\u0027--force\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"},{"line_number":1381,"context_line":"          help\u003d_(\u0027Delete hosts and instance_mappings that belong to the cell \u0027"},{"line_number":1382,"context_line":"                 \u0027as well. The compute_node and the resource_provider records \u0027"},{"line_number":1383,"context_line":"                 \u0027of the nodes under this host will also be deleted.\u0027))"},{"line_number":1384,"context_line":"    @args(\u0027--cell_uuid\u0027, metavar\u003d\u0027\u003ccell_uuid\u003e\u0027, dest\u003d\u0027cell_uuid\u0027,"},{"line_number":1385,"context_line":"          required\u003dTrue, help\u003d_(\u0027The uuid of the cell to delete.\u0027))"},{"line_number":1386,"context_line":"    def delete_cell(self, cell_uuid, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_165df613","line":1383,"range":{"start_line":1382,"start_character":27,"end_line":1383,"end_character":67},"updated":"2018-03-15 20:51:32.000000000","message":"what about the \"service\" records?","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b25376a240dc94d182fb82905447b5a3ad55ed5","unresolved":false,"context_lines":[{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"    @args(\u0027--force\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"},{"line_number":1381,"context_line":"          help\u003d_(\u0027Delete hosts and instance_mappings that belong to the cell \u0027"},{"line_number":1382,"context_line":"                 \u0027as well. The compute_node and the resource_provider records \u0027"},{"line_number":1383,"context_line":"                 \u0027of the nodes under this host will also be deleted.\u0027))"},{"line_number":1384,"context_line":"    @args(\u0027--cell_uuid\u0027, metavar\u003d\u0027\u003ccell_uuid\u003e\u0027, dest\u003d\u0027cell_uuid\u0027,"},{"line_number":1385,"context_line":"          required\u003dTrue, help\u003d_(\u0027The uuid of the cell to delete.\u0027))"},{"line_number":1386,"context_line":"    def delete_cell(self, cell_uuid, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_d6c1be55","line":1383,"range":{"start_line":1382,"start_character":27,"end_line":1383,"end_character":67},"in_reply_to":"df7087c5_165df613","updated":"2018-03-15 20:57:55.000000000","message":"We could, and we\u0027d also need to consider any aggregates that the compute host is in, which is something the delete services REST API takes care of today:\n\nhttps://github.com/openstack/nova/blob/5f38500df6a8e1665b968c3e98b804e0fdfefc63/nova/api/openstack/compute/services.py#L212\n\nThis tends to snowball...","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05eac0fed879079942cd15b320983ef0a4da4aca","unresolved":false,"context_lines":[{"line_number":1435,"context_line":"                print(_(\u0027There are existing instances mapped to cell with \u0027"},{"line_number":1436,"context_line":"                        \u0027uuid %s.\u0027) % cell_uuid)"},{"line_number":1437,"context_line":"                return 3"},{"line_number":1438,"context_line":"            elif not force:"},{"line_number":1439,"context_line":"                # There are no instances in the cell but the records remain"},{"line_number":1440,"context_line":"                # in the \u0027instance_mappings\u0027 table."},{"line_number":1441,"context_line":"                print(_(\"There are instance mappings to cell with uuid \""},{"line_number":1442,"context_line":"                        \"%s, but all instances have been deleted \""},{"line_number":1443,"context_line":"                        \"in the cell.\") % cell_uuid)"},{"line_number":1444,"context_line":"                print(_(\"So execute \u0027nova-manage db archive_deleted_rows\u0027 \""},{"line_number":1445,"context_line":"                        \"to delete the instance mappings.\"))"},{"line_number":1446,"context_line":"                return 4"},{"line_number":1447,"context_line":""},{"line_number":1448,"context_line":"        # Delete instance_mappings of the deleted instances"},{"line_number":1449,"context_line":"        for instance_mapping in instance_mappings:"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_76079219","line":1446,"range":{"start_line":1438,"start_character":0,"end_line":1446,"end_character":24},"updated":"2018-03-15 20:51:32.000000000","message":"you\u0027re not changing any logic in here, so is it worth it just to reformat the code slightly?","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05eac0fed879079942cd15b320983ef0a4da4aca","unresolved":false,"context_lines":[{"line_number":1449,"context_line":"        for instance_mapping in instance_mappings:"},{"line_number":1450,"context_line":"            instance_mapping.destroy()"},{"line_number":1451,"context_line":""},{"line_number":1452,"context_line":"        # Delete the records of the compute_nodes, resource_providers."},{"line_number":1453,"context_line":"        self._delete_compute_nodes_and_resource_providers(ctxt, nodes)"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"        # Delete hosts mapped to the cell."},{"line_number":1456,"context_line":"        for host_mapping in host_mappings:"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_366cbacc","line":1453,"range":{"start_line":1452,"start_character":6,"end_line":1453,"end_character":70},"updated":"2018-03-15 20:51:32.000000000","message":"based on the discussion on IRC today, it was recommended to delete the resource providers first, then the host mappings, then the compute nodes, then the service.","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05eac0fed879079942cd15b320983ef0a4da4aca","unresolved":false,"context_lines":[{"line_number":1547,"context_line":"        return 0"},{"line_number":1548,"context_line":""},{"line_number":1549,"context_line":"    @args(\u0027--force\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"},{"line_number":1550,"context_line":"          help\u003d_(\u0027Delete the compute_node and resource_provider records of\u0027"},{"line_number":1551,"context_line":"                 \u0027the nodes under this host as well.\u0027))"},{"line_number":1552,"context_line":"    @args(\u0027--cell_uuid\u0027, metavar\u003d\u0027\u003ccell_uuid\u003e\u0027, dest\u003d\u0027cell_uuid\u0027,"},{"line_number":1553,"context_line":"          required\u003dTrue, help\u003d_(\u0027The uuid of the cell.\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_d6a0def6","line":1550,"range":{"start_line":1550,"start_character":29,"end_line":1550,"end_character":71},"updated":"2018-03-15 20:51:32.000000000","message":"what about the service record?","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"754b266d2bc0765c0de506a08a2bf412d71e34db","unresolved":false,"context_lines":[{"line_number":1553,"context_line":"          required\u003dTrue, help\u003d_(\u0027The uuid of the cell.\u0027))"},{"line_number":1554,"context_line":"    @args(\u0027--host\u0027, metavar\u003d\u0027\u003chost\u003e\u0027, dest\u003d\u0027host\u0027,"},{"line_number":1555,"context_line":"          required\u003dTrue, help\u003d_(\u0027The host to delete.\u0027))"},{"line_number":1556,"context_line":"    def delete_host(self, cell_uuid, host, force\u003dFalse):"},{"line_number":1557,"context_line":"        \"\"\"Delete a host in a cell (host mappings) by the given host name"},{"line_number":1558,"context_line":""},{"line_number":1559,"context_line":"        This command will return a non-zero exit code in the following cases."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_9949648f","line":1556,"updated":"2018-07-06 13:44:19.000000000","message":"if I incorporate deleting cns, rps, and services apart from hms, it is the same as nova service-delete; redundant. So I will just focus on delete_cell","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"8b5b71b3693a36ebad46c517cc0df63b5202ed16","unresolved":false,"context_lines":[{"line_number":1598,"context_line":"                node.mapped \u003d 0"},{"line_number":1599,"context_line":"                node.save()"},{"line_number":1600,"context_line":""},{"line_number":1601,"context_line":"        if force:"},{"line_number":1602,"context_line":"            # Delete the records of the compute_nodes, resource_providers."},{"line_number":1603,"context_line":"            self._delete_compute_nodes_and_resource_providers(ctxt, nodes)"},{"line_number":1604,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_c267ed4c","line":1601,"updated":"2018-03-15 16:24:13.000000000","message":"change this to else.","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4fcc99320531acc35e6d892e47b442e851fd45e9","unresolved":false,"context_lines":[{"line_number":1606,"context_line":"                            service.compute_node, cascade\u003dTrue)"},{"line_number":1607,"context_line":"                    # destroying service record also destroys compute_node"},{"line_number":1608,"context_line":"                    # record."},{"line_number":1609,"context_line":"                    service.destroy()"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        # Delete hosts mapped to the cell."},{"line_number":1612,"context_line":"        for host_mapping in host_mappings:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_65a129a8","line":1609,"range":{"start_line":1609,"start_character":20,"end_line":1609,"end_character":37},"updated":"2018-07-31 16:43:11.000000000","message":"Sorry for lack of context, but is the compute service running up to this point? If so, it may autovivify the compute node resource provider in placement if it hits the update_available_resource periodic before we get here.","commit_id":"b4c85475bf7673fb28b6eba3911bb5febf62d5dd"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"116334251bcf57a1be96bb3ac3ca29a7891bfa85","unresolved":false,"context_lines":[{"line_number":1606,"context_line":"                            service.compute_node, cascade\u003dTrue)"},{"line_number":1607,"context_line":"                    # destroying service record also destroys compute_node"},{"line_number":1608,"context_line":"                    # record."},{"line_number":1609,"context_line":"                    service.destroy()"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        # Delete hosts mapped to the cell."},{"line_number":1612,"context_line":"        for host_mapping in host_mappings:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0e4de46f","line":1609,"range":{"start_line":1609,"start_character":20,"end_line":1609,"end_character":37},"in_reply_to":"5f7c97a3_65a129a8","updated":"2018-08-01 08:44:00.000000000","message":"the compute service usually needs to be stopped before its deletion (see https://review.openstack.org/#/c/563233/1) because of the problem with the update_available_resource periodic task like you have said. Maybe I could add a similar note for cell deletion like we have to service deletion to the manage docs.","commit_id":"b4c85475bf7673fb28b6eba3911bb5febf62d5dd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":1494,"context_line":"        print(t)"},{"line_number":1495,"context_line":"        return 0"},{"line_number":1496,"context_line":""},{"line_number":1497,"context_line":"    @args(\u0027--recursively_force\u0027, action\u003d\u0027store_true\u0027, default\u003dFalse,"},{"line_number":1498,"context_line":"          help\u003d_(\u0027Delete hosts from aggregates, corresponding resource \u0027"},{"line_number":1499,"context_line":"                 \u0027providers with cascade, host_mappings, compute nodes and \u0027"},{"line_number":1500,"context_line":"                 \u0027finally the services and then delete the cell (if there \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_743bd137","line":1497,"range":{"start_line":1497,"start_character":24,"end_line":1497,"end_character":25},"updated":"2019-07-05 22:40:42.000000000","message":"I haven\u0027t looked through the rest of this change yet, but kind of hate that we have options like this with underscores in nova-manage. I know we already have --cell_uuid in here, but ideally that would be fixed to be --cell-uuid at some point.\n\nFor example, the --max_rows option on archive_deleted_rows *always* screws me up and I have to check before I use it because I usually get it wrong.\n\nSo this is my way of saying, if we\u0027re adding new options, let\u0027s name them like real CLI options and use dashes rather than underscores.","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":1554,"context_line":"            # so that they can be unmapped."},{"line_number":1555,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":1556,"context_line":"                nodes \u003d objects.ComputeNodeList.get_all(cctxt)"},{"line_number":1557,"context_line":"                services \u003d objects.ServiceList.get_all(cctxt)"},{"line_number":1558,"context_line":""},{"line_number":1559,"context_line":"        # Check to see if there are any InstanceMappings for this cell."},{"line_number":1560,"context_line":"        instance_mappings \u003d objects.InstanceMappingList.get_by_cell_id("}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_f47d81e7","line":1557,"updated":"2019-07-05 22:40:42.000000000","message":"Are you only looking for nova-compute services here? Because you could be getting other services as well (nova-consoleauth? nova-conductor if running split MQ, nova-novncproxy? metadata API per cell based on config, etc). Maybe it doesn\u0027t matter based on how this is used below (at least for aggregates) but it could be more efficient to only get nova-compute services. In that case you\u0027d use Service.get_by_binary.\n\nI guess for L1609 below you want to delete all services in the cell and not just nova-compute services?","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":1588,"context_line":"            node.mapped \u003d 0"},{"line_number":1589,"context_line":"            node.save()"},{"line_number":1590,"context_line":""},{"line_number":1591,"context_line":"        if recursively_force:"},{"line_number":1592,"context_line":"            aggregate_api \u003d compute_api.AggregateAPI()"},{"line_number":1593,"context_line":"            placement_client \u003d aggregate_api.placement_client"},{"line_number":1594,"context_line":"            for service in services:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_34e1d99b","line":1591,"updated":"2019-07-05 22:40:42.000000000","message":"It feels like we should have a --verbose option on this command now to at least give the option of logging the stuff we\u0027re removing in here as we process it. Maybe that could be a follow up but if something goes wrong I\u0027d think you\u0027d want the ability to enable verbose logging when you do this because deleting stuff can be scary, and recursively deleting stuff could be extra scary.","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":1603,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":1604,"context_line":"                    if service.binary \u003d\u003d \u0027nova-compute\u0027:"},{"line_number":1605,"context_line":"                        placement_client.delete_resource_provider(cctxt,"},{"line_number":1606,"context_line":"                            service.compute_node, cascade\u003dTrue)"},{"line_number":1607,"context_line":"                    # destroying service record also destroys compute_node"},{"line_number":1608,"context_line":"                    # record."},{"line_number":1609,"context_line":"                    service.destroy()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_f4cb411b","line":1606,"range":{"start_line":1606,"start_character":50,"end_line":1606,"end_character":62},"updated":"2019-07-05 22:40:42.000000000","message":"Also, as noted in the ML thread related to this [1] cascade\u003dTrue may not be what you\u0027re hoping it is and we could still leak providers here. However, the main issue raised in that thread is that providers are leaked if there are pending migrations or evacuated instances and if we get this far hopefully we have neither of those records in the nova cell database holding allocations against the provider(s) we\u0027re going to delete here.\n\n[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007097.html","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":1603,"context_line":"                with context.target_cell(ctxt, cell_mapping) as cctxt:"},{"line_number":1604,"context_line":"                    if service.binary \u003d\u003d \u0027nova-compute\u0027:"},{"line_number":1605,"context_line":"                        placement_client.delete_resource_provider(cctxt,"},{"line_number":1606,"context_line":"                            service.compute_node, cascade\u003dTrue)"},{"line_number":1607,"context_line":"                    # destroying service record also destroys compute_node"},{"line_number":1608,"context_line":"                    # record."},{"line_number":1609,"context_line":"                    service.destroy()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_7452f169","line":1606,"range":{"start_line":1606,"start_character":28,"end_line":1606,"end_character":48},"updated":"2019-07-05 22:40:42.000000000","message":"As shown in I9e852e25ea89f32bf19cdaeb1f5dac8f749f5dbc this is only the first compute node record so if this is an ironic nova-compute managing several nodes, you\u0027re going to be leaking all of those other resource providers.","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e9296c6d016a213ddb289d6387c33f79cfbf0c0","unresolved":false,"context_lines":[{"line_number":1606,"context_line":"                            service.compute_node, cascade\u003dTrue)"},{"line_number":1607,"context_line":"                    # destroying service record also destroys compute_node"},{"line_number":1608,"context_line":"                    # record."},{"line_number":1609,"context_line":"                    service.destroy()"},{"line_number":1610,"context_line":""},{"line_number":1611,"context_line":"        # Delete hosts mapped to the cell."},{"line_number":1612,"context_line":"        for host_mapping in host_mappings:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_f466e151","line":1609,"updated":"2019-07-05 22:40:42.000000000","message":"Do you want this for all types of services in the cell or only nova-compute services?","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"}],"nova/tests/functional/test_nova_manage.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"28902d48446d59296617faf395816b53aa0dd557","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            \u0027/os-aggregates/%s\u0027 % agg[\u0027id\u0027]).body[\u0027aggregate\u0027]"},{"line_number":400,"context_line":"        self.assertEqual([\u0027fake-host1\u0027], aggregate[\u0027hosts\u0027])"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"        # Delete both cell1 with recursively_force option."},{"line_number":403,"context_line":"        res \u003d self.commands.delete_cell(cells[1].uuid, recursively_force\u003dTrue)"},{"line_number":404,"context_line":"        self.assertEqual(0, res)"},{"line_number":405,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_cea04cf5","line":402,"range":{"start_line":402,"start_character":16,"end_line":402,"end_character":22},"updated":"2018-08-01 08:44:45.000000000","message":"cut this","commit_id":"b4c85475bf7673fb28b6eba3911bb5febf62d5dd"}],"releasenotes/notes/add-force-option-for-delete_host-acfe4eeafe42d3f0.yaml":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05eac0fed879079942cd15b320983ef0a4da4aca","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Support for purging the compute node records and the resource provider"},{"line_number":5,"context_line":"    records of those nodes under the host which is to be deleted using the"},{"line_number":6,"context_line":"    ``nova-manage cell_v2 delete_host`` is provided by introducing the"},{"line_number":7,"context_line":"    ``force`` option in this command. Using this option, the compute nodes"},{"line_number":8,"context_line":"    and resource providers will be deleted from the database as opposed to"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"df7087c5_b6868a65","line":5,"range":{"start_line":4,"start_character":28,"end_line":5,"end_character":11},"updated":"2018-03-15 20:51:32.000000000","message":"should we do service records?","commit_id":"8c28bbecf89ddebfde7479c8fa51ff74558cbd41"}],"releasenotes/notes/delete_cell_with_recursive_force-15c2f7c75d7e84e5.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a22c109a22a7a0dc217e233d500737c21549589b","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Adds support for deleting the hosts from aggregates, compute_nodes,"},{"line_number":5,"context_line":"    resource_providers and services of the cell which is being deleted using"},{"line_number":6,"context_line":"    ``nova-manage cell_v2 delete_cell`` through the new ``recursively_force``"},{"line_number":7,"context_line":"    option."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"9fb8cfa7_32840dd3","line":6,"range":{"start_line":6,"start_character":58,"end_line":6,"end_character":75},"updated":"2019-06-26 16:19:28.000000000","message":"--recursively_force","commit_id":"14737cca0f2abb99294b6e2cf377749bb3439b3a"}]}
