)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"27ca0b8b930e242cc8e52bcbf3d194b4f320e953","unresolved":false,"context_lines":[{"line_number":10,"context_line":"from the API to orchestrate confirming a cross-cell resize."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This task is responsible for cleaning up the source host"},{"line_number":13,"context_line":"and cell including destroying the guest from the source"},{"line_number":14,"context_line":"hypervisor and hard deleting the instance-related records from"},{"line_number":15,"context_line":"the source cell database. It also updates the information"},{"line_number":16,"context_line":"about the instance and migration in the target cell database."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":56,"id":"3fa7e38b_e8c0164d","line":14,"range":{"start_line":13,"start_character":19,"end_line":14,"end_character":10},"updated":"2019-12-03 12:51:40.000000000","message":"It is more like cleaning up the hypervisor as the guest destroyed already before taking the snapshot isn\u0027t it?","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0f18c1baae640ed193974f1d5247b36cf8f27aa2","unresolved":false,"context_lines":[{"line_number":10,"context_line":"from the API to orchestrate confirming a cross-cell resize."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This task is responsible for cleaning up the source host"},{"line_number":13,"context_line":"and cell including destroying the guest from the source"},{"line_number":14,"context_line":"hypervisor and hard deleting the instance-related records from"},{"line_number":15,"context_line":"the source cell database. It also updates the information"},{"line_number":16,"context_line":"about the instance and migration in the target cell database."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":56,"id":"3fa7e38b_83ac5c88","line":14,"range":{"start_line":13,"start_character":19,"end_line":14,"end_character":10},"in_reply_to":"3fa7e38b_c9b5ca1a","updated":"2019-12-12 08:25:42.000000000","message":"Thanks. it is clearer now.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2eef53c162c275c468d14e443a6a227eb8f3fbf8","unresolved":false,"context_lines":[{"line_number":10,"context_line":"from the API to orchestrate confirming a cross-cell resize."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This task is responsible for cleaning up the source host"},{"line_number":13,"context_line":"and cell including destroying the guest from the source"},{"line_number":14,"context_line":"hypervisor and hard deleting the instance-related records from"},{"line_number":15,"context_line":"the source cell database. It also updates the information"},{"line_number":16,"context_line":"about the instance and migration in the target cell database."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":56,"id":"3fa7e38b_c9b5ca1a","line":14,"range":{"start_line":13,"start_character":19,"end_line":14,"end_character":10},"in_reply_to":"3fa7e38b_e8c0164d","updated":"2019-12-09 14:26:39.000000000","message":"Do you mean because we power off the guest on the source host prior to creating a snapshot (if we create a snapshot)?\n\nhttps://github.com/openstack/nova/blob/e937c5c6c47658e695b1e934b3d6e660dc6514ed/nova/compute/manager.py#L5222\n\nFor libvirt that will destroy the guest, yes, but not necessarily for other virt drivers. That doesn\u0027t remove the guest from being tracked by the hypervisor though.\n\nBut yes the confirm task is more about cleaning up the source host:\n\nhttps://github.com/openstack/nova/blob/e937c5c6c47658e695b1e934b3d6e660dc6514ed/nova/compute/manager.py#L4518","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"}],"nova/conductor/tasks/cross_cell_migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3efb4de49b2e1beef582c2cbb5613d17611b56ae","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        :param instance: Instance object in \"resized\" status from the target"},{"line_number":892,"context_line":"            cell"},{"line_number":893,"context_line":"        :param migration: Migration object from the target cell for the resize"},{"line_number":894,"context_line":"            operation expected to have status \"finished\""},{"line_number":895,"context_line":"        :param legacy_notifier: LegacyValidatingNotifier for sending legacy"},{"line_number":896,"context_line":"            unversioned notifications"},{"line_number":897,"context_line":"        :param compute_rpcapi: instance of nova.compute.rpcapi.ComputeAPI"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_549263a1","line":894,"range":{"start_line":894,"start_character":47,"end_line":894,"end_character":55},"updated":"2019-02-19 17:29:58.000000000","message":"confirming","commit_id":"c0ed884d4430b2eb56d0b71917300bbdae095d76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2192b88b8223e8952b7b465e1c67573229719084","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        :param instance: Instance object in \"resized\" status from the target"},{"line_number":892,"context_line":"            cell"},{"line_number":893,"context_line":"        :param migration: Migration object from the target cell for the resize"},{"line_number":894,"context_line":"            operation expected to have status \"finished\""},{"line_number":895,"context_line":"        :param legacy_notifier: LegacyValidatingNotifier for sending legacy"},{"line_number":896,"context_line":"            unversioned notifications"},{"line_number":897,"context_line":"        :param compute_rpcapi: instance of nova.compute.rpcapi.ComputeAPI"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_ee49438e","line":894,"range":{"start_line":894,"start_character":47,"end_line":894,"end_character":55},"in_reply_to":"9fdfeff1_549263a1","updated":"2019-02-19 20:08:07.000000000","message":"Done","commit_id":"c0ed884d4430b2eb56d0b71917300bbdae095d76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4fc7f2dd406aa9ad1a27aceb07b95ed215e0136","unresolved":false,"context_lines":[{"line_number":938,"context_line":"        # targeted to the source cell database."},{"line_number":939,"context_line":"        return objects.Instance.get_by_uuid("},{"line_number":940,"context_line":"            source_cell_context, self.instance.uuid,"},{"line_number":941,"context_line":"            expected_attrs\u003d[\u0027info_cache\u0027, \u0027flavor\u0027])"},{"line_number":942,"context_line":""},{"line_number":943,"context_line":"    def _cleanup_source_host(self, source_instance):"},{"line_number":944,"context_line":"        \"\"\"Cleans up the instance from the source host."}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_8b08a92d","line":941,"updated":"2019-02-19 19:25:53.000000000","message":"Should also have system_metadata in it.","commit_id":"c0ed884d4430b2eb56d0b71917300bbdae095d76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2192b88b8223e8952b7b465e1c67573229719084","unresolved":false,"context_lines":[{"line_number":938,"context_line":"        # targeted to the source cell database."},{"line_number":939,"context_line":"        return objects.Instance.get_by_uuid("},{"line_number":940,"context_line":"            source_cell_context, self.instance.uuid,"},{"line_number":941,"context_line":"            expected_attrs\u003d[\u0027info_cache\u0027, \u0027flavor\u0027])"},{"line_number":942,"context_line":""},{"line_number":943,"context_line":"    def _cleanup_source_host(self, source_instance):"},{"line_number":944,"context_line":"        \"\"\"Cleans up the instance from the source host."}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_0e4fe792","line":941,"in_reply_to":"9fdfeff1_8b08a92d","updated":"2019-02-19 20:08:07.000000000","message":"Done","commit_id":"c0ed884d4430b2eb56d0b71917300bbdae095d76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cb6696225b5894feda2b0fc3048efaf9321aa22d","unresolved":false,"context_lines":[{"line_number":985,"context_line":"        # _confirm_resize_on_deleting then the instance is being deleted."},{"line_number":986,"context_line":"        self.instance.save(expected_task_state\u003d["},{"line_number":987,"context_line":"            None, task_states.DELETING, task_states.SOFT_DELETING])"},{"line_number":988,"context_line":"        self.instance.drop_migration_context()"},{"line_number":989,"context_line":""},{"line_number":990,"context_line":"    def _set_vm_and_task_state(self):"},{"line_number":991,"context_line":"        \"\"\"Sets the target cell instance vm_state based on the power_state."}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_645d90eb","line":988,"updated":"2019-02-18 20:27:48.000000000","message":"Should probably do this before calling instance.save()?","commit_id":"c0ed884d4430b2eb56d0b71917300bbdae095d76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2192b88b8223e8952b7b465e1c67573229719084","unresolved":false,"context_lines":[{"line_number":985,"context_line":"        # _confirm_resize_on_deleting then the instance is being deleted."},{"line_number":986,"context_line":"        self.instance.save(expected_task_state\u003d["},{"line_number":987,"context_line":"            None, task_states.DELETING, task_states.SOFT_DELETING])"},{"line_number":988,"context_line":"        self.instance.drop_migration_context()"},{"line_number":989,"context_line":""},{"line_number":990,"context_line":"    def _set_vm_and_task_state(self):"},{"line_number":991,"context_line":"        \"\"\"Sets the target cell instance vm_state based on the power_state."}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_8e5af74d","line":988,"in_reply_to":"9fdfeff1_645d90eb","updated":"2019-02-19 20:08:07.000000000","message":"Done","commit_id":"c0ed884d4430b2eb56d0b71917300bbdae095d76"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"04802e994d31e130922afecbda776f91bdb71921","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"        # RPC call the source compute to cleanup."},{"line_number":1051,"context_line":"        self._cleanup_source_host(source_cell_instance)"},{"line_number":1052,"context_line":"        # Now we can delete the instance in the source cell database."},{"line_number":1053,"context_line":"        LOG.info(\u0027Deleting instance record from source cell %s\u0027,"},{"line_number":1054,"context_line":"                 source_cell_instance._context.cell_uuid,"},{"line_number":1055,"context_line":"                 instance\u003dsource_cell_instance)"},{"line_number":1056,"context_line":"        # This needs to be a hard delete because we want to be able to resize"}],"source_content_type":"text/x-python","patch_set":28,"id":"bfb3d3c7_04d44347","line":1053,"updated":"2019-05-24 20:34:49.000000000","message":"This failed in the gate job with a referential fkey constraint on bdms:\n\nhttp://paste.openstack.org/show/752057/\n\nI\u0027m not sure why, we hard delete the bdms before we try to destroy the instance. Could there be some kind of race?","commit_id":"a2c3515fafa8844cf20fdc5a2c5a6730b5cf0941"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bfa938b02bd4e4740f090b0ff2b6019490b21d5d","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"        # RPC call the source compute to cleanup."},{"line_number":1051,"context_line":"        self._cleanup_source_host(source_cell_instance)"},{"line_number":1052,"context_line":"        # Now we can delete the instance in the source cell database."},{"line_number":1053,"context_line":"        LOG.info(\u0027Deleting instance record from source cell %s\u0027,"},{"line_number":1054,"context_line":"                 source_cell_instance._context.cell_uuid,"},{"line_number":1055,"context_line":"                 instance\u003dsource_cell_instance)"},{"line_number":1056,"context_line":"        # This needs to be a hard delete because we want to be able to resize"}],"source_content_type":"text/x-python","patch_set":28,"id":"bfb3d3c7_e4432f12","line":1053,"in_reply_to":"bfb3d3c7_04d44347","updated":"2019-05-24 20:38:15.000000000","message":"Maybe the problem is there are soft-deleted BDMs and we\u0027re not cleaning those up in the model query call here?\n\nhttps://github.com/openstack/nova/blob/8f00b5d345d636f3fe875267bdfb02d8e7ffeede/nova/db/sqlalchemy/api.py#L1795","commit_id":"a2c3515fafa8844cf20fdc5a2c5a6730b5cf0941"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a2926b1e88fd471820587093a6f3783f78d554a5","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"        # RPC call the source compute to cleanup."},{"line_number":1051,"context_line":"        self._cleanup_source_host(source_cell_instance)"},{"line_number":1052,"context_line":"        # Now we can delete the instance in the source cell database."},{"line_number":1053,"context_line":"        LOG.info(\u0027Deleting instance record from source cell %s\u0027,"},{"line_number":1054,"context_line":"                 source_cell_instance._context.cell_uuid,"},{"line_number":1055,"context_line":"                 instance\u003dsource_cell_instance)"},{"line_number":1056,"context_line":"        # This needs to be a hard delete because we want to be able to resize"}],"source_content_type":"text/x-python","patch_set":28,"id":"bfb3d3c7_84dcb3e4","line":1053,"in_reply_to":"bfb3d3c7_e4432f12","updated":"2019-05-24 21:12:16.000000000","message":"Need to rebase the series on top of this:\n\nhttps://review.opendev.org/#/c/661398/","commit_id":"a2c3515fafa8844cf20fdc5a2c5a6730b5cf0941"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"27ca0b8b930e242cc8e52bcbf3d194b4f320e953","unresolved":false,"context_lines":[{"line_number":912,"context_line":"    # Clone the context targeted at the target cell and then target the"},{"line_number":913,"context_line":"    # clone at the source cell."},{"line_number":914,"context_line":"    source_cell_context \u003d copy.copy(target_cell_context)"},{"line_number":915,"context_line":"    nova_context.set_target_cell(source_cell_context, source_cell_mapping)"},{"line_number":916,"context_line":"    # Now get the instance from the source cell DB using the source"},{"line_number":917,"context_line":"    # cell context which will make the source cell instance permanently"},{"line_number":918,"context_line":"    # targeted to the source cell database."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_289aae5f","line":915,"updated":"2019-12-03 12:51:40.000000000","message":"shallow copy seems to be enough as as only top level fields (no nested structures) are changed by the set_target_cell call","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"27ca0b8b930e242cc8e52bcbf3d194b4f320e953","unresolved":false,"context_lines":[{"line_number":967,"context_line":"            self.legacy_notifier, ctxt, instance, \u0027resize.confirm.%s\u0027 % phase)"},{"line_number":968,"context_line":"        # Send the versioned notification."},{"line_number":969,"context_line":"        compute_utils.notify_about_instance_action("},{"line_number":970,"context_line":"            ctxt, instance, instance.host,  # TODO(mriedem): Use CONF.host?"},{"line_number":971,"context_line":"            action\u003dfields.NotificationAction.RESIZE_CONFIRM,"},{"line_number":972,"context_line":"            phase\u003dphase)"},{"line_number":973,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_88d96229","line":970,"range":{"start_line":970,"start_character":28,"end_line":970,"end_character":75},"updated":"2019-12-03 12:51:40.000000000","message":"in the non cross cell resize case it is sent from the source host this is the one that happens here now. I guess it doesn\u0027t matter much but the more correct information would be CONF.host here as that is the real source. If you worry about signalling somehow the semantic change of the notification then I think we already made a semantic change by sending this from the conductor instead of the compute as the compute might configured to emit notifications to a different message bus than the super conductor due to cell separation and I\u0027m meh about that change either.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0f18c1baae640ed193974f1d5247b36cf8f27aa2","unresolved":false,"context_lines":[{"line_number":967,"context_line":"            self.legacy_notifier, ctxt, instance, \u0027resize.confirm.%s\u0027 % phase)"},{"line_number":968,"context_line":"        # Send the versioned notification."},{"line_number":969,"context_line":"        compute_utils.notify_about_instance_action("},{"line_number":970,"context_line":"            ctxt, instance, instance.host,  # TODO(mriedem): Use CONF.host?"},{"line_number":971,"context_line":"            action\u003dfields.NotificationAction.RESIZE_CONFIRM,"},{"line_number":972,"context_line":"            phase\u003dphase)"},{"line_number":973,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_e3de700e","line":970,"range":{"start_line":970,"start_character":28,"end_line":970,"end_character":75},"in_reply_to":"3fa7e38b_04cae76c","updated":"2019-12-12 08:25:42.000000000","message":"Sounds like a plan. Thanks for the FUP, I will check that soon.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c5edd01c69b60f504efde28aa9586c12234abe13","unresolved":false,"context_lines":[{"line_number":967,"context_line":"            self.legacy_notifier, ctxt, instance, \u0027resize.confirm.%s\u0027 % phase)"},{"line_number":968,"context_line":"        # Send the versioned notification."},{"line_number":969,"context_line":"        compute_utils.notify_about_instance_action("},{"line_number":970,"context_line":"            ctxt, instance, instance.host,  # TODO(mriedem): Use CONF.host?"},{"line_number":971,"context_line":"            action\u003dfields.NotificationAction.RESIZE_CONFIRM,"},{"line_number":972,"context_line":"            phase\u003dphase)"},{"line_number":973,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_04cae76c","line":970,"range":{"start_line":970,"start_character":28,"end_line":970,"end_character":75},"in_reply_to":"3fa7e38b_490d5ae5","updated":"2019-12-09 15:18:33.000000000","message":"Done in a FUP: https://review.opendev.org/#/c/698028/","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2eef53c162c275c468d14e443a6a227eb8f3fbf8","unresolved":false,"context_lines":[{"line_number":967,"context_line":"            self.legacy_notifier, ctxt, instance, \u0027resize.confirm.%s\u0027 % phase)"},{"line_number":968,"context_line":"        # Send the versioned notification."},{"line_number":969,"context_line":"        compute_utils.notify_about_instance_action("},{"line_number":970,"context_line":"            ctxt, instance, instance.host,  # TODO(mriedem): Use CONF.host?"},{"line_number":971,"context_line":"            action\u003dfields.NotificationAction.RESIZE_CONFIRM,"},{"line_number":972,"context_line":"            phase\u003dphase)"},{"line_number":973,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_490d5ae5","line":970,"range":{"start_line":970,"start_character":28,"end_line":970,"end_character":75},"in_reply_to":"3fa7e38b_88d96229","updated":"2019-12-09 14:26:39.000000000","message":"\u003e If you worry about signalling somehow the\n \u003e semantic change of the notification then I think we already made a\n \u003e semantic change by sending this from the conductor instead of the\n \u003e compute as the compute might configured to emit notifications to a\n \u003e different message bus than the super conductor due to cell\n \u003e separation and I\u0027m meh about that change either.\n\nYeah I think that\u0027s what I was thinking so I\u0027ll likely follow up to change this to use CONF.host. And that coincides with how it works during confirm for same-cell resize:\n\nhttps://github.com/openstack/nova/blob/e937c5c6c47658e695b1e934b3d6e660dc6514ed/nova/compute/manager.py#L4343\n\nBecause in that case the instance.host is pointing at the dest and that notification using self.host is happening on the source host, so yeah this should be CONF.host for conductor.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"27ca0b8b930e242cc8e52bcbf3d194b4f320e953","unresolved":false,"context_lines":[{"line_number":983,"context_line":"        \"\"\""},{"line_number":984,"context_line":"        ctxt \u003d source_instance._context"},{"line_number":985,"context_line":"        # The confirmResize instance action has to be created in the source"},{"line_number":986,"context_line":"        # cell database before calling the compute service to properly"},{"line_number":987,"context_line":"        # track action events. Note that the API created the same action"},{"line_number":988,"context_line":"        # record but on the target cell instance."},{"line_number":989,"context_line":"        objects.InstanceAction.action_start("},{"line_number":990,"context_line":"            ctxt, source_instance.uuid, instance_actions.CONFIRM_RESIZE,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_48312a59","line":987,"range":{"start_line":986,"start_character":43,"end_line":987,"end_character":30},"updated":"2019-12-03 12:51:40.000000000","message":"Is there a way that this even is visible to the end user instead of the one in the target cell? I guess this instance cannot reverted back to the source cell any more.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2eef53c162c275c468d14e443a6a227eb8f3fbf8","unresolved":false,"context_lines":[{"line_number":983,"context_line":"        \"\"\""},{"line_number":984,"context_line":"        ctxt \u003d source_instance._context"},{"line_number":985,"context_line":"        # The confirmResize instance action has to be created in the source"},{"line_number":986,"context_line":"        # cell database before calling the compute service to properly"},{"line_number":987,"context_line":"        # track action events. Note that the API created the same action"},{"line_number":988,"context_line":"        # record but on the target cell instance."},{"line_number":989,"context_line":"        objects.InstanceAction.action_start("},{"line_number":990,"context_line":"            ctxt, source_instance.uuid, instance_actions.CONFIRM_RESIZE,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_89a352b1","line":987,"range":{"start_line":986,"start_character":43,"end_line":987,"end_character":30},"in_reply_to":"3fa7e38b_48312a59","updated":"2019-12-09 14:26:39.000000000","message":"This isn\u0027t for the user. At this point the instance is mapped to the target cell and that\u0027s where the confirmResize action was created by the API:\n\nhttps://github.com/openstack/nova/blob/e937c5c6c47658e695b1e934b3d6e660dc6514ed/nova/compute/api.py#L3637\n\nSo up to this point we have an action for this request ID in the target cell DB but when we call confirm_snapshot_based_resize_at_source in the source cell it uses the @wrap_instance_event decorator so it needs to be able to find an action in the source cell db for the given request ID to track the event.\n\nThinking back on this now, I wrote the compute method with the wrap_instance_event decorator before I refactored this code to use the EventReporter locally in conductor so I wouldn\u0027t have to copy and insert the compute_confirm_snapshot_based_resize_at_source event from the source to the target cell DB, so we could probably get away with dropping the wrap_instance_event decorator from confirm_snapshot_based_resize_at_source in the compute manager, but it\u0027s probably fine to leave it for auditing in case something fails in the compute and someone is trying to dig back out the source cell records.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0f18c1baae640ed193974f1d5247b36cf8f27aa2","unresolved":false,"context_lines":[{"line_number":983,"context_line":"        \"\"\""},{"line_number":984,"context_line":"        ctxt \u003d source_instance._context"},{"line_number":985,"context_line":"        # The confirmResize instance action has to be created in the source"},{"line_number":986,"context_line":"        # cell database before calling the compute service to properly"},{"line_number":987,"context_line":"        # track action events. Note that the API created the same action"},{"line_number":988,"context_line":"        # record but on the target cell instance."},{"line_number":989,"context_line":"        objects.InstanceAction.action_start("},{"line_number":990,"context_line":"            ctxt, source_instance.uuid, instance_actions.CONFIRM_RESIZE,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_832f7cf3","line":987,"range":{"start_line":986,"start_character":43,"end_line":987,"end_character":30},"in_reply_to":"3fa7e38b_89a352b1","updated":"2019-12-12 08:25:42.000000000","message":"Thanks for the detailed answer. I\u0027m OK to keep the decorator there.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"27ca0b8b930e242cc8e52bcbf3d194b4f320e953","unresolved":false,"context_lines":[{"line_number":996,"context_line":"                  source_migration.source_compute, instance\u003dsource_instance)"},{"line_number":997,"context_line":"        # The instance.old_flavor field needs to be set before the source"},{"line_number":998,"context_line":"        # host drops the MoveClaim in the ResourceTracker."},{"line_number":999,"context_line":"        source_instance.old_flavor \u003d source_instance.flavor"},{"line_number":1000,"context_line":"        # Use the EventReport context manager to create the same event that"},{"line_number":1001,"context_line":"        # the source compute will create but in the target cell DB so we do not"},{"line_number":1002,"context_line":"        # have to explicitly copy it over from source to target DB."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_a861be3a","line":999,"updated":"2019-12-03 12:51:40.000000000","message":"source instance will be hard deleted so it is not a problem to not doing this as a temporary mutation","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2eef53c162c275c468d14e443a6a227eb8f3fbf8","unresolved":false,"context_lines":[{"line_number":996,"context_line":"                  source_migration.source_compute, instance\u003dsource_instance)"},{"line_number":997,"context_line":"        # The instance.old_flavor field needs to be set before the source"},{"line_number":998,"context_line":"        # host drops the MoveClaim in the ResourceTracker."},{"line_number":999,"context_line":"        source_instance.old_flavor \u003d source_instance.flavor"},{"line_number":1000,"context_line":"        # Use the EventReport context manager to create the same event that"},{"line_number":1001,"context_line":"        # the source compute will create but in the target cell DB so we do not"},{"line_number":1002,"context_line":"        # have to explicitly copy it over from source to target DB."}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_6987f613","line":999,"in_reply_to":"3fa7e38b_a861be3a","updated":"2019-12-09 14:26:39.000000000","message":"Yup. And I realize this is a bit of gross tight coupling but I thought it might be weird to just use instance.flavor (as the old_flavor) directly in confirm_snapshot_based_resize_at_source when dropping the move claim on the source host.\n\nThis logic actually comes from finish_resize in the same-cell case:\n\nhttps://github.com/openstack/nova/blob/e937c5c6c47658e695b1e934b3d6e660dc6514ed/nova/compute/manager.py#L5453\n\nSo if we wanted to avoid this weirdness we could have the FinishResizeAtDestTask set and save this on the source cell instance so we don\u0027t have to do it in the confirm task.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"27ca0b8b930e242cc8e52bcbf3d194b4f320e953","unresolved":false,"context_lines":[{"line_number":999,"context_line":"        source_instance.old_flavor \u003d source_instance.flavor"},{"line_number":1000,"context_line":"        # Use the EventReport context manager to create the same event that"},{"line_number":1001,"context_line":"        # the source compute will create but in the target cell DB so we do not"},{"line_number":1002,"context_line":"        # have to explicitly copy it over from source to target DB."},{"line_number":1003,"context_line":"        event_name \u003d \u0027compute_confirm_snapshot_based_resize_at_source\u0027"},{"line_number":1004,"context_line":"        with compute_utils.EventReporter("},{"line_number":1005,"context_line":"                self.context, event_name, source_migration.source_compute,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_c8f99a4e","line":1002,"updated":"2019-12-03 12:51:40.000000000","message":"Does it now only create in the dest cell or in both? If the former then don\u0027t we need to copy it to the source as well like in case of L989?","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2eef53c162c275c468d14e443a6a227eb8f3fbf8","unresolved":false,"context_lines":[{"line_number":999,"context_line":"        source_instance.old_flavor \u003d source_instance.flavor"},{"line_number":1000,"context_line":"        # Use the EventReport context manager to create the same event that"},{"line_number":1001,"context_line":"        # the source compute will create but in the target cell DB so we do not"},{"line_number":1002,"context_line":"        # have to explicitly copy it over from source to target DB."},{"line_number":1003,"context_line":"        event_name \u003d \u0027compute_confirm_snapshot_based_resize_at_source\u0027"},{"line_number":1004,"context_line":"        with compute_utils.EventReporter("},{"line_number":1005,"context_line":"                self.context, event_name, source_migration.source_compute,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3fa7e38b_c96dca67","line":1002,"in_reply_to":"3fa7e38b_c8f99a4e","updated":"2019-12-09 14:26:39.000000000","message":"I think I answered this above.","commit_id":"6d8f3fb438d39c96213f1d1e0b1fed40dc0d20fa"}]}
