)]}'
{"nova/conductor/tasks/cross_cell_migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"313b8d9e71459af675a1a73df083ebcb6d572e25","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"        for bdm in bdms_from_target_cell:"},{"line_number":1147,"context_line":"            if bdm.uuid in source_cell_bdms_by_uuid:"},{"line_number":1148,"context_line":"                # Existing BDM in the source cell so just update it."},{"line_number":1149,"context_line":"                # TODO(mriedem): Is this correct? Could we be orphaning"},{"line_number":1150,"context_line":"                # volume attachments by overwriting the attachment_id field?"},{"line_number":1151,"context_line":"                source_bdm \u003d source_cell_bdms_by_uuid.pop(bdm.uuid)"},{"line_number":1152,"context_line":"                self._update_source_obj_from_target_cell(source_bdm, bdm)"},{"line_number":1153,"context_line":"                source_bdm.save()"},{"line_number":1154,"context_line":"            else:"},{"line_number":1155,"context_line":"                # Newly attached BDM while in the target cell, so create it"},{"line_number":1156,"context_line":"                # in the source cell."}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_55a9e121","line":1153,"range":{"start_line":1149,"start_character":16,"end_line":1153,"end_character":33},"updated":"2019-02-20 23:14:11.000000000","message":"I\u0027m pretty sure this is wrong because revert_snapshot_based_resize_at_dest is going to delete the volume attachments on the volume BDMs attached to the instance in the target cell, and here we\u0027re copying those attachment_ids over to the BDMs in the source cell which will be used in finish_revert_snapshot_based_resize_at_source.","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cb2b7b6ea23479219dcaa27bb2f334681adb826","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"        for bdm in bdms_from_target_cell:"},{"line_number":1147,"context_line":"            if bdm.uuid in source_cell_bdms_by_uuid:"},{"line_number":1148,"context_line":"                # Existing BDM in the source cell so just update it."},{"line_number":1149,"context_line":"                # TODO(mriedem): Is this correct? Could we be orphaning"},{"line_number":1150,"context_line":"                # volume attachments by overwriting the attachment_id field?"},{"line_number":1151,"context_line":"                source_bdm \u003d source_cell_bdms_by_uuid.pop(bdm.uuid)"},{"line_number":1152,"context_line":"                self._update_source_obj_from_target_cell(source_bdm, bdm)"},{"line_number":1153,"context_line":"                source_bdm.save()"},{"line_number":1154,"context_line":"            else:"},{"line_number":1155,"context_line":"                # Newly attached BDM while in the target cell, so create it"},{"line_number":1156,"context_line":"                # in the source cell."}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_a1e18ed2","line":1153,"range":{"start_line":1149,"start_character":16,"end_line":1153,"end_character":33},"in_reply_to":"9fdfeff1_3a05d3c2","updated":"2019-02-26 15:28:57.000000000","message":"\u003e So either here or elsewhere in conductor, we need to create empty\n \u003e attachments on the bdms in the source cell prior to calling\n \u003e compute.\n\nWe can do that in prep_snapshot_based_resize_at_source by calling _terminate_volume_connections.","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97aa2850408507466e0d0ed93a95971d05c28ad2","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"        for bdm in bdms_from_target_cell:"},{"line_number":1147,"context_line":"            if bdm.uuid in source_cell_bdms_by_uuid:"},{"line_number":1148,"context_line":"                # Existing BDM in the source cell so just update it."},{"line_number":1149,"context_line":"                # TODO(mriedem): Is this correct? Could we be orphaning"},{"line_number":1150,"context_line":"                # volume attachments by overwriting the attachment_id field?"},{"line_number":1151,"context_line":"                source_bdm \u003d source_cell_bdms_by_uuid.pop(bdm.uuid)"},{"line_number":1152,"context_line":"                self._update_source_obj_from_target_cell(source_bdm, bdm)"},{"line_number":1153,"context_line":"                source_bdm.save()"},{"line_number":1154,"context_line":"            else:"},{"line_number":1155,"context_line":"                # Newly attached BDM while in the target cell, so create it"},{"line_number":1156,"context_line":"                # in the source cell."}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_3a05d3c2","line":1153,"range":{"start_line":1149,"start_character":16,"end_line":1153,"end_character":33},"in_reply_to":"9fdfeff1_55a9e121","updated":"2019-02-25 23:50:08.000000000","message":"So either here or elsewhere in conductor, we need to create empty attachments on the bdms in the source cell prior to calling compute.","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"313b8d9e71459af675a1a73df083ebcb6d572e25","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"                self._update_source_obj_from_target_cell(source_bdm, bdm)"},{"line_number":1153,"context_line":"                source_bdm.save()"},{"line_number":1154,"context_line":"            else:"},{"line_number":1155,"context_line":"                # Newly attached BDM while in the target cell, so create it"},{"line_number":1156,"context_line":"                # in the source cell."},{"line_number":1157,"context_line":"                LOG.debug(\u0027Creating BlockDeviceMapping with volume ID %s \u0027"},{"line_number":1158,"context_line":"                          \u0027in the source cell database since the volume was \u0027"},{"line_number":1159,"context_line":"                          \u0027attached while the server was resized.\u0027,"},{"line_number":1160,"context_line":"                          bdm.volume_id, instance\u003dself.instance)"},{"line_number":1161,"context_line":"                source_bdm \u003d clone_creatable_object(source_cell_context, bdm)"},{"line_number":1162,"context_line":"                source_bdm.create()"},{"line_number":1163,"context_line":"        # If there are any source bdms left that were not processed from the"},{"line_number":1164,"context_line":"        # target cell bdms, it means those source bdms were detached while"},{"line_number":1165,"context_line":"        # resized in the target cell, and we need to delete them from the"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_b5712de1","line":1162,"range":{"start_line":1155,"start_character":16,"end_line":1162,"end_character":35},"updated":"2019-02-20 23:14:11.000000000","message":"This is likely also a problem for the same reason above - this attachment on the target cell BDMs is going to be deleted in revert_snapshot_based_resize_at_dest. We should find out this fails in finish_revert_snapshot_based_resize_at_source when we try to complete this attachment which should be an error because the attachment should already be gone, but this has to be fixed first:\n\nhttps://github.com/openstack/nova/blob/af78b13c24d4abf393d17ac57e9135204ef12b73/nova/tests/fixtures.py#L1887","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cb2b7b6ea23479219dcaa27bb2f334681adb826","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"                self._update_source_obj_from_target_cell(source_bdm, bdm)"},{"line_number":1153,"context_line":"                source_bdm.save()"},{"line_number":1154,"context_line":"            else:"},{"line_number":1155,"context_line":"                # Newly attached BDM while in the target cell, so create it"},{"line_number":1156,"context_line":"                # in the source cell."},{"line_number":1157,"context_line":"                LOG.debug(\u0027Creating BlockDeviceMapping with volume ID %s \u0027"},{"line_number":1158,"context_line":"                          \u0027in the source cell database since the volume was \u0027"},{"line_number":1159,"context_line":"                          \u0027attached while the server was resized.\u0027,"},{"line_number":1160,"context_line":"                          bdm.volume_id, instance\u003dself.instance)"},{"line_number":1161,"context_line":"                source_bdm \u003d clone_creatable_object(source_cell_context, bdm)"},{"line_number":1162,"context_line":"                source_bdm.create()"},{"line_number":1163,"context_line":"        # If there are any source bdms left that were not processed from the"},{"line_number":1164,"context_line":"        # target cell bdms, it means those source bdms were detached while"},{"line_number":1165,"context_line":"        # resized in the target cell, and we need to delete them from the"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_419a2213","line":1162,"range":{"start_line":1155,"start_character":16,"end_line":1162,"end_character":35},"in_reply_to":"9fdfeff1_b5712de1","updated":"2019-02-26 15:28:57.000000000","message":"Done","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"54939748a648bd1a942c6c405a1a60ee58e23e68","unresolved":false,"context_lines":[{"line_number":1218,"context_line":"        # \"reverting\"."},{"line_number":1219,"context_line":"        self._update_source_obj_from_target_cell("},{"line_number":1220,"context_line":"            source_cell_migration, self.migration)"},{"line_number":1221,"context_line":"        source_cell_migration.save()"},{"line_number":1222,"context_line":"        return source_cell_migration"},{"line_number":1223,"context_line":""},{"line_number":1224,"context_line":"    def _update_instance_in_source_cell(self, instance):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_a926acb9","line":1221,"updated":"2019-02-21 13:53:58.000000000","message":"Something blowing up on timestamps here:\n\nhttp://logs.openstack.org/68/638268/1/check/nova-tox-functional/bb3d2ae/job-output.txt.gz#_2019-02-20_22_07_37_816020","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cb2b7b6ea23479219dcaa27bb2f334681adb826","unresolved":false,"context_lines":[{"line_number":1218,"context_line":"        # \"reverting\"."},{"line_number":1219,"context_line":"        self._update_source_obj_from_target_cell("},{"line_number":1220,"context_line":"            source_cell_migration, self.migration)"},{"line_number":1221,"context_line":"        source_cell_migration.save()"},{"line_number":1222,"context_line":"        return source_cell_migration"},{"line_number":1223,"context_line":""},{"line_number":1224,"context_line":"    def _update_instance_in_source_cell(self, instance):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_619f2602","line":1221,"in_reply_to":"9fdfeff1_1a580f2f","updated":"2019-02-26 15:28:57.000000000","message":"Done","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4692e18b5594c03239514d9f9260d8cad0979c64","unresolved":false,"context_lines":[{"line_number":1218,"context_line":"        # \"reverting\"."},{"line_number":1219,"context_line":"        self._update_source_obj_from_target_cell("},{"line_number":1220,"context_line":"            source_cell_migration, self.migration)"},{"line_number":1221,"context_line":"        source_cell_migration.save()"},{"line_number":1222,"context_line":"        return source_cell_migration"},{"line_number":1223,"context_line":""},{"line_number":1224,"context_line":"    def _update_instance_in_source_cell(self, instance):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_1a580f2f","line":1221,"in_reply_to":"9fdfeff1_a926acb9","updated":"2019-02-25 23:36:21.000000000","message":"Need to ignore created_at and updated_at. updated_at is updated on the save() call anyway, and we shouldn\u0027t change created_at anyway probably.","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1cafca1f445029dcd4f549bdad2865fe6f4b1e1","unresolved":false,"context_lines":[{"line_number":1288,"context_line":"        self.instance.hidden \u003d True"},{"line_number":1289,"context_line":"        self.instance.save()"},{"line_number":1290,"context_line":""},{"line_number":1291,"context_line":"    def _execute(self):"},{"line_number":1292,"context_line":"        # Send the resize.revert.start notification(s) using the target"},{"line_number":1293,"context_line":"        # cell instance since we start there."},{"line_number":1294,"context_line":"        self._send_resize_revert_notification("}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_bc783a2b","line":1291,"range":{"start_line":1291,"start_character":8,"end_line":1291,"end_character":16},"updated":"2019-02-20 20:10:32.000000000","message":"Need more logging throughout what\u0027s going on in here.","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e3a937fb2166f44f1eea54678c96d8ea9768899","unresolved":false,"context_lines":[{"line_number":1320,"context_line":"        self.instance.destroy()"},{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"        # Launch the guest at the source host with the old flavor."},{"line_number":1323,"context_line":"        self.compute_rpcapi.finish_revert_snapshot_based_resize_at_source("},{"line_number":1324,"context_line":"            source_cell_instance._context, source_cell_instance,"},{"line_number":1325,"context_line":"            source_cell_migration)"},{"line_number":1326,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_9870b50a","line":1323,"range":{"start_line":1323,"start_character":28,"end_line":1323,"end_character":73},"updated":"2019-02-22 17:20:08.000000000","message":"This will revert the allocations held in placement so the instance allocations against the dest compute are dropped and the allocations from the source node, held by the migration record, are moved back to the instance. At this point, the instance in the target cell is destroyed, but there would still be allocations against the dest node held by the instance consumer. So if this code runs on the dest compute:\n\nhttps://github.com/openstack/nova/blob/27617ee1931b3240dbd0ad4c7d8ffd64cc202bc9/nova/compute/resource_tracker.py#L1302\n\nIt could drop the allocations held by the instance against the dest node. That\u0027s not terrible since we\u0027re going to overwrote those anyway, effectively dropping them, but we should probably deal with that RT code anyway and skip it if the instance is hidden, which it will be before we destroy it.","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cb2b7b6ea23479219dcaa27bb2f334681adb826","unresolved":false,"context_lines":[{"line_number":1320,"context_line":"        self.instance.destroy()"},{"line_number":1321,"context_line":""},{"line_number":1322,"context_line":"        # Launch the guest at the source host with the old flavor."},{"line_number":1323,"context_line":"        self.compute_rpcapi.finish_revert_snapshot_based_resize_at_source("},{"line_number":1324,"context_line":"            source_cell_instance._context, source_cell_instance,"},{"line_number":1325,"context_line":"            source_cell_migration)"},{"line_number":1326,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_a1c2eee7","line":1323,"range":{"start_line":1323,"start_character":28,"end_line":1323,"end_character":73},"in_reply_to":"9fdfeff1_9870b50a","updated":"2019-02-26 15:28:57.000000000","message":"Done","commit_id":"2ee3573303fb2b5a393a7a9b1ddd2b463a076225"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"218199f2c294f7b99caf01a5fe8c588d58426775","unresolved":false,"context_lines":[{"line_number":1352,"context_line":"        # operate on the instance in the source cell."},{"line_number":1353,"context_line":"        self._update_instance_mapping("},{"line_number":1354,"context_line":"            source_cell_instance, source_cell_mapping)"},{"line_number":1355,"context_line":"        # Save off the source cell migration record for rollbacks."},{"line_number":1356,"context_line":"        self._source_cell_migration \u003d source_cell_migration"},{"line_number":1357,"context_line":""},{"line_number":1358,"context_line":"        # Clean the instance from the target host."},{"line_number":1359,"context_line":"        LOG.debug(\u0027Calling destination host %s to revert cross-cell resize.\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"bfb3d3c7_4537e0e4","line":1356,"range":{"start_line":1355,"start_character":8,"end_line":1356,"end_character":59},"updated":"2019-05-21 18:16:00.000000000","message":"This should probably happen before we update the instance mappings.","commit_id":"77be1712e43847ecff2dc9f843e905cf7c0ac43a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fda82b4277d61798e6017a2f8ffe7bd2be6c79de","unresolved":false,"context_lines":[{"line_number":1352,"context_line":"        # operate on the instance in the source cell."},{"line_number":1353,"context_line":"        self._update_instance_mapping("},{"line_number":1354,"context_line":"            source_cell_instance, source_cell_mapping)"},{"line_number":1355,"context_line":"        # Save off the source cell migration record for rollbacks."},{"line_number":1356,"context_line":"        self._source_cell_migration \u003d source_cell_migration"},{"line_number":1357,"context_line":""},{"line_number":1358,"context_line":"        # Clean the instance from the target host."},{"line_number":1359,"context_line":"        LOG.debug(\u0027Calling destination host %s to revert cross-cell resize.\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"bfb3d3c7_8d865edb","line":1356,"range":{"start_line":1355,"start_character":8,"end_line":1356,"end_character":59},"in_reply_to":"bfb3d3c7_4537e0e4","updated":"2019-05-21 21:25:07.000000000","message":"Oh nevermind this is intentional because rollback will set the migration record to error status in the target cell if we fail to update the instance mapping which is what we want.","commit_id":"77be1712e43847ecff2dc9f843e905cf7c0ac43a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6be3e288b57136ff51e08de6b830a84bbd3c939e","unresolved":false,"context_lines":[{"line_number":1232,"context_line":"                      \u0027source cell database during cross-cell resize revert \u0027"},{"line_number":1233,"context_line":"                      \u0027since the volume was detached while the server was \u0027"},{"line_number":1234,"context_line":"                      \u0027resized.\u0027, bdm.volume_id, instance\u003dself.instance)"},{"line_number":1235,"context_line":"            bdm.destroy()"},{"line_number":1236,"context_line":""},{"line_number":1237,"context_line":"    def _update_instance_actions_in_source_cell(self, source_cell_context):"},{"line_number":1238,"context_line":"        \"\"\"Update instance action records in the source cell database"}],"source_content_type":"text/x-python","patch_set":51,"id":"3fa7e38b_a703cbbd","line":1235,"updated":"2019-11-20 18:59:50.000000000","message":"We also need to delete the attachment using the bdm.attachment_id here otherwise we leak the attachment in cinder. I found this while implementing a functional test for the TODO above.","commit_id":"9ad8ea11f16da9dbb27e242221851e0544ca74e0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4a081a35aab73c522a1167faba797d03335f94b","unresolved":false,"context_lines":[{"line_number":1420,"context_line":"        with compute_utils.EventReporter("},{"line_number":1421,"context_line":"                source_cell_instance._context, event_name,"},{"line_number":1422,"context_line":"                self.migration.dest_compute, self.instance.uuid):"},{"line_number":1423,"context_line":"            self.compute_rpcapi.revert_snapshot_based_resize_at_dest("},{"line_number":1424,"context_line":"                self.context, self.instance, self.migration)"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":"        # Destroy the instance and its related records from the target cell DB."}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_1a01b004","line":1423,"updated":"2019-12-12 01:37:19.000000000","message":"We could refresh self.instance after this since revert_snapshot_based_resize_at_dest will update it, but we just go and destroy it right after this anyway so it\u0027s probably not a big deal.","commit_id":"b5abd12cec33f05a392b94ec07fdb0011fd35e4e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3e9d6925c0aed29e36b54df5c864189ba5d3efb3","unresolved":false,"context_lines":[{"line_number":1420,"context_line":"        with compute_utils.EventReporter("},{"line_number":1421,"context_line":"                source_cell_instance._context, event_name,"},{"line_number":1422,"context_line":"                self.migration.dest_compute, self.instance.uuid):"},{"line_number":1423,"context_line":"            self.compute_rpcapi.revert_snapshot_based_resize_at_dest("},{"line_number":1424,"context_line":"                self.context, self.instance, self.migration)"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":"        # Destroy the instance and its related records from the target cell DB."}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_fab92dca","line":1423,"in_reply_to":"3fa7e38b_1a01b004","updated":"2019-12-12 13:51:18.000000000","message":"Done","commit_id":"b5abd12cec33f05a392b94ec07fdb0011fd35e4e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4a081a35aab73c522a1167faba797d03335f94b","unresolved":false,"context_lines":[{"line_number":1434,"context_line":"        LOG.debug(\u0027Calling source host %s to finish reverting cross-cell \u0027"},{"line_number":1435,"context_line":"                  \u0027resize.\u0027, self.migration.source_compute,"},{"line_number":1436,"context_line":"                  instance\u003dself.instance)"},{"line_number":1437,"context_line":"        self.compute_rpcapi.finish_revert_snapshot_based_resize_at_source("},{"line_number":1438,"context_line":"            source_cell_instance._context, source_cell_instance,"},{"line_number":1439,"context_line":"            source_cell_migration)"},{"line_number":1440,"context_line":""}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_7a11c452","line":1437,"updated":"2019-12-12 01:37:19.000000000","message":"Similarly, finish_revert_snapshot_based_resize_at_source will update source_cell_instance so if we needed to do something with it after this we should refresh it. Right now that\u0027s just notifications, but it\u0027s probably going to make sure we have a fresh copy of the instance for those anyway.","commit_id":"b5abd12cec33f05a392b94ec07fdb0011fd35e4e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3e9d6925c0aed29e36b54df5c864189ba5d3efb3","unresolved":false,"context_lines":[{"line_number":1434,"context_line":"        LOG.debug(\u0027Calling source host %s to finish reverting cross-cell \u0027"},{"line_number":1435,"context_line":"                  \u0027resize.\u0027, self.migration.source_compute,"},{"line_number":1436,"context_line":"                  instance\u003dself.instance)"},{"line_number":1437,"context_line":"        self.compute_rpcapi.finish_revert_snapshot_based_resize_at_source("},{"line_number":1438,"context_line":"            source_cell_instance._context, source_cell_instance,"},{"line_number":1439,"context_line":"            source_cell_migration)"},{"line_number":1440,"context_line":""}],"source_content_type":"text/x-python","patch_set":55,"id":"3fa7e38b_dab6b1dc","line":1437,"in_reply_to":"3fa7e38b_7a11c452","updated":"2019-12-12 13:51:18.000000000","message":"Done","commit_id":"b5abd12cec33f05a392b94ec07fdb0011fd35e4e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4311d6568a412c6de058ef68ba48978f39dee89c","unresolved":false,"context_lines":[{"line_number":896,"context_line":"                LOG.exception(\u0027Rollback for task %s failed.\u0027, task_name)"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"def get_instance_from_source_cell("},{"line_number":900,"context_line":"        target_cell_context, source_compute, instance_uuid):"},{"line_number":901,"context_line":"    \"\"\"Queries the instance from the source cell database."},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_872c524a","line":899,"range":{"start_line":899,"start_character":4,"end_line":899,"end_character":33},"updated":"2019-12-13 11:44:19.000000000","message":"nit: I\u0027d like to have seen this renamed given it\u0027s not really reflective of what it\u0027s doing anymore, but I can\u0027t think of anything snappy and don\u0027t want to make you rebase the whole thing. If you\u0027ve a good idea, perhaps a follow-up?","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a7726203873f1ad0d654584b9a689387fdda186","unresolved":false,"context_lines":[{"line_number":896,"context_line":"                LOG.exception(\u0027Rollback for task %s failed.\u0027, task_name)"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"def get_instance_from_source_cell("},{"line_number":900,"context_line":"        target_cell_context, source_compute, instance_uuid):"},{"line_number":901,"context_line":"    \"\"\"Queries the instance from the source cell database."},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_b27ae7b7","line":899,"range":{"start_line":899,"start_character":4,"end_line":899,"end_character":33},"in_reply_to":"3fa7e38b_2fe1b4cf","updated":"2019-12-13 16:25:58.000000000","message":"get_source_instance_and_cell() ?","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"944792f2ac188403b3f8d2e2856c9592ddc1eb36","unresolved":false,"context_lines":[{"line_number":896,"context_line":"                LOG.exception(\u0027Rollback for task %s failed.\u0027, task_name)"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"def get_instance_from_source_cell("},{"line_number":900,"context_line":"        target_cell_context, source_compute, instance_uuid):"},{"line_number":901,"context_line":"    \"\"\"Queries the instance from the source cell database."},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_2fe1b4cf","line":899,"range":{"start_line":899,"start_character":4,"end_line":899,"end_character":33},"in_reply_to":"3fa7e38b_6f356ca7","updated":"2019-12-13 15:06:22.000000000","message":"I went with get_inst_and_cell_map_from_source so I can actually have a chance of fitting the thing on a line.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ed710cf47ce1bf4a66dc7d38626fd949b0fd4db","unresolved":false,"context_lines":[{"line_number":896,"context_line":"                LOG.exception(\u0027Rollback for task %s failed.\u0027, task_name)"},{"line_number":897,"context_line":""},{"line_number":898,"context_line":""},{"line_number":899,"context_line":"def get_instance_from_source_cell("},{"line_number":900,"context_line":"        target_cell_context, source_compute, instance_uuid):"},{"line_number":901,"context_line":"    \"\"\"Queries the instance from the source cell database."},{"line_number":902,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_6f356ca7","line":899,"range":{"start_line":899,"start_character":4,"end_line":899,"end_character":33},"in_reply_to":"3fa7e38b_872c524a","updated":"2019-12-13 14:56:43.000000000","message":"You mean it\u0027s not just getting the instance but also returning the source cell mapping, which it already had but just didn\u0027t return?\n\nHow about: get_instance_and_cell_mapping_from_source\n\nQuite verbose though.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"88d675f98e192f4ad6ec2ffa84fd32bbbff919a8","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"            self.legacy_notifier, ctxt, instance, \u0027resize.revert.%s\u0027 % phase)"},{"line_number":1158,"context_line":"        # Send the versioned notification."},{"line_number":1159,"context_line":"        compute_utils.notify_about_instance_action("},{"line_number":1160,"context_line":"            ctxt, instance, instance.host,  # TODO(mriedem): Use CONF.host?"},{"line_number":1161,"context_line":"            action\u003dfields.NotificationAction.RESIZE_REVERT,"},{"line_number":1162,"context_line":"            phase\u003dphase)"},{"line_number":1163,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_4f0bd07a","line":1160,"range":{"start_line":1160,"start_character":44,"end_line":1160,"end_character":75},"updated":"2019-12-13 15:10:26.000000000","message":"Per https://review.opendev.org/#/c/698028/3/nova/conductor/tasks/cross_cell_migrate.py yes we should use CONF.host. Will handle in a FUP.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a7726203873f1ad0d654584b9a689387fdda186","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"        ignore_fields \u003d [\u0027created_at\u0027, \u0027id\u0027, \u0027updated_at\u0027]"},{"line_number":1185,"context_line":"        for field in source_obj.obj_fields:"},{"line_number":1186,"context_line":"            if field in target_obj and field not in ignore_fields:"},{"line_number":1187,"context_line":"                setattr(source_obj, field, getattr(target_obj, field))"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    def _update_bdms_in_source_cell(self, source_cell_context):"},{"line_number":1190,"context_line":"        \"\"\"Update BlockDeviceMapppings in the source cell database."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_320ef73c","line":1187,"updated":"2019-12-13 16:25:58.000000000","message":"This seems a little dangerous, as nested objects will have their own context targeted at the target cell database, and referencing them from the source object won\u0027t update that. I\u0027d have to go look at the details of how instance.save() delegates to all the nested save objects and make sure they\u0027re all okay. Have you done that and/or proven that they all get updated? Looks like the test for this is NoDB...\n\nDo you want to use your create_cloneable_object() thing for this? Although not sure that handles nested-nested things.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f439c26760539c7cf7101d1fcb2bd981585da9be","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"        ignore_fields \u003d [\u0027created_at\u0027, \u0027id\u0027, \u0027updated_at\u0027]"},{"line_number":1185,"context_line":"        for field in source_obj.obj_fields:"},{"line_number":1186,"context_line":"            if field in target_obj and field not in ignore_fields:"},{"line_number":1187,"context_line":"                setattr(source_obj, field, getattr(target_obj, field))"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    def _update_bdms_in_source_cell(self, source_cell_context):"},{"line_number":1190,"context_line":"        \"\"\"Update BlockDeviceMapppings in the source cell database."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_ede40410","line":1187,"in_reply_to":"3fa7e38b_0d6de097","updated":"2019-12-13 16:38:41.000000000","message":"\u003e I\u0027d just assert and fail, and add something to the docstring.\n \u003e Unless you\u0027re going to test the recursion, it\u0027d be better to just\n \u003e not claim it works.\n\nCool I was hoping you\u0027d say that.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9eb43a82227d577b341cdaac6897bc93dcabcc8c","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"        ignore_fields \u003d [\u0027created_at\u0027, \u0027id\u0027, \u0027updated_at\u0027]"},{"line_number":1185,"context_line":"        for field in source_obj.obj_fields:"},{"line_number":1186,"context_line":"            if field in target_obj and field not in ignore_fields:"},{"line_number":1187,"context_line":"                setattr(source_obj, field, getattr(target_obj, field))"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    def _update_bdms_in_source_cell(self, source_cell_context):"},{"line_number":1190,"context_line":"        \"\"\"Update BlockDeviceMapppings in the source cell database."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_6dd01454","line":1187,"in_reply_to":"3fa7e38b_320ef73c","updated":"2019-12-13 16:33:40.000000000","message":"This method is only being used to clone the migration record from the target cell to the source and the Migration object doesn\u0027t have any nested fields that I\u0027m aware of so while this could be an issue if used later by something with nested fields, it doesn\u0027t appear to be an immediate blocking issue.\n\nAnd to be clear about terminology, nested field \u003d\u003d field that is an ObjectField correct?\n\nI don\u0027t want to get too hung up on this if it\u0027s not an immediate problem, but can definitely follow up with something though I\u0027m not sure what that would be - could be as simple as a check if the field is an ObjectField and if so recurse into this method? Or just bomb out with an error saying the method doesn\u0027t support those kinds of fields and hope that if it\u0027s getting used for that later at some point it\u0027s noticed during development (I realize that\u0027s the shittier option).","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dbe2fea36dc3c83543693b4b076bfec8e9f01839","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"        ignore_fields \u003d [\u0027created_at\u0027, \u0027id\u0027, \u0027updated_at\u0027]"},{"line_number":1185,"context_line":"        for field in source_obj.obj_fields:"},{"line_number":1186,"context_line":"            if field in target_obj and field not in ignore_fields:"},{"line_number":1187,"context_line":"                setattr(source_obj, field, getattr(target_obj, field))"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    def _update_bdms_in_source_cell(self, source_cell_context):"},{"line_number":1190,"context_line":"        \"\"\"Update BlockDeviceMapppings in the source cell database."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_0d6de097","line":1187,"in_reply_to":"3fa7e38b_6dd01454","updated":"2019-12-13 16:36:18.000000000","message":"\u003e This method is only being used to clone the migration record from\n \u003e the target cell to the source and the Migration object doesn\u0027t have\n \u003e any nested fields that I\u0027m aware of so while this could be an issue\n \u003e if used later by something with nested fields, it doesn\u0027t appear to\n \u003e be an immediate blocking issue.\n\nAck, I assumed you were using this for instance when I wrote this, but then didn\u0027t verify as I ready further down.\n\n \u003e And to be clear about terminology, nested field \u003d\u003d field that is an\n \u003e ObjectField correct?\n\nYep.\n\n \u003e I don\u0027t want to get too hung up on this if it\u0027s not an immediate\n \u003e problem, but can definitely follow up with something though I\u0027m not\n \u003e sure what that would be - could be as simple as a check if the\n \u003e field is an ObjectField and if so recurse into this method? Or just\n \u003e bomb out with an error saying the method doesn\u0027t support those\n \u003e kinds of fields and hope that if it\u0027s getting used for that later\n \u003e at some point it\u0027s noticed during development (I realize that\u0027s the\n \u003e shittier option).\n\nI\u0027d just assert and fail, and add something to the docstring. Unless you\u0027re going to test the recursion, it\u0027d be better to just not claim it works.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ddb034de6d66ac541a8eb06054fd1efd2121880","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"        ignore_fields \u003d [\u0027created_at\u0027, \u0027id\u0027, \u0027updated_at\u0027]"},{"line_number":1185,"context_line":"        for field in source_obj.obj_fields:"},{"line_number":1186,"context_line":"            if field in target_obj and field not in ignore_fields:"},{"line_number":1187,"context_line":"                setattr(source_obj, field, getattr(target_obj, field))"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    def _update_bdms_in_source_cell(self, source_cell_context):"},{"line_number":1190,"context_line":"        \"\"\"Update BlockDeviceMapppings in the source cell database."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_a8983a75","line":1187,"in_reply_to":"3fa7e38b_ede40410","updated":"2019-12-13 17:27:12.000000000","message":"Done: https://review.opendev.org/#/c/698935/","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4311d6568a412c6de058ef68ba48978f39dee89c","unresolved":false,"context_lines":[{"line_number":1231,"context_line":"                          \u0027since the volume was attached while the server was \u0027"},{"line_number":1232,"context_line":"                          \u0027resized.\u0027, bdm.volume_id, attach_ref[\u0027id\u0027],"},{"line_number":1233,"context_line":"                          instance\u003dself.instance)"},{"line_number":1234,"context_line":"                source_bdm.create()"},{"line_number":1235,"context_line":"        # If there are any source bdms left that were not processed from the"},{"line_number":1236,"context_line":"        # target cell bdms, it means those source bdms were detached while"},{"line_number":1237,"context_line":"        # resized in the target cell, and we need to delete them from the"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_47a5fab2","line":1234,"updated":"2019-12-13 11:44:19.000000000","message":"It seems weird that we\u0027d revert and end up with more than we had before the x-cell resize. Wouldn\u0027t it have been much easier to just block attaching block devices while an instance in the confirmation state or auto-confirm them or something? I\u0027m guessing we can\u0027t (API change?) or you\u0027d have done that since it would be less work","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ed710cf47ce1bf4a66dc7d38626fd949b0fd4db","unresolved":false,"context_lines":[{"line_number":1231,"context_line":"                          \u0027since the volume was attached while the server was \u0027"},{"line_number":1232,"context_line":"                          \u0027resized.\u0027, bdm.volume_id, attach_ref[\u0027id\u0027],"},{"line_number":1233,"context_line":"                          instance\u003dself.instance)"},{"line_number":1234,"context_line":"                source_bdm.create()"},{"line_number":1235,"context_line":"        # If there are any source bdms left that were not processed from the"},{"line_number":1236,"context_line":"        # target cell bdms, it means those source bdms were detached while"},{"line_number":1237,"context_line":"        # resized in the target cell, and we need to delete them from the"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_4f5750ca","line":1234,"in_reply_to":"3fa7e38b_47a5fab2","updated":"2019-12-13 14:56:43.000000000","message":"Correct, it would be an API change because the API allows attaching/detaching volumes while a server is resized:\n\nhttps://github.com/openstack/nova/blob/aa096fd18352fb9da94069ec2cab478eed5c6cca/nova/compute/api.py#L4435\n\nhttps://github.com/openstack/nova/blob/aa096fd18352fb9da94069ec2cab478eed5c6cca/nova/compute/api.py#L4542\n\nThankfully we don\u0027t have that with things like attaching/detaching network interfaces:\n\nhttps://github.com/openstack/nova/blob/aa096fd18352fb9da94069ec2cab478eed5c6cca/nova/compute/api.py#L4674\n\nhttps://github.com/openstack/nova/blob/aa096fd18352fb9da94069ec2cab478eed5c6cca/nova/compute/api.py#L4698\n\nOr updating tags:\n\nhttps://github.com/openstack/nova/blob/aa096fd18352fb9da94069ec2cab478eed5c6cca/nova/api/openstack/compute/server_tags.py#L53\n\nMentioned in the spec as well:\n\nhttps://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/cross-cell-resize.html#revert-flow\n\nSince at least Dan and I discussed in the spec at some point the merits of being able to attach/detach volumes on a resized server. He had a use case for it but now I forget what it was.","commit_id":"f6f4657e9c979217969544848cf5ee3f9acb125b"}]}
