)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b58485c55f278813d6158e388d10eb799d5794a3","unresolved":false,"context_lines":[{"line_number":5987,"context_line":"    @wrap_exception()"},{"line_number":5988,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":5989,"context_line":"    @wrap_instance_fault"},{"line_number":5990,"context_line":"    def prep_cross_cell_resize_at_dest(self, ctxt, instance, flavor, nodename,"},{"line_number":5991,"context_line":"                                       migration, limits):"},{"line_number":5992,"context_line":"        \"\"\"Performs pre-cross-cell resize checks on the targeted destination"},{"line_number":5993,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_300e963b","line":5990,"updated":"2019-01-02 16:21:41.000000000","message":"This won\u0027t work at this point because the instance doesn\u0027t exist in the target cell database and the source cell targeting on the context is lost over rpc, so the resize_claim and such will blow up.","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1490d710acbdb582364ac5c7971bcbedb6f816d2","unresolved":false,"context_lines":[{"line_number":5987,"context_line":"    @wrap_exception()"},{"line_number":5988,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":5989,"context_line":"    @wrap_instance_fault"},{"line_number":5990,"context_line":"    def prep_cross_cell_resize_at_dest(self, ctxt, instance, flavor, nodename,"},{"line_number":5991,"context_line":"                                       migration, limits):"},{"line_number":5992,"context_line":"        \"\"\"Performs pre-cross-cell resize checks on the targeted destination"},{"line_number":5993,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bfdaf3ff_b5482dcc","line":5990,"in_reply_to":"1f769fc5_300e963b","updated":"2019-01-15 23:57:12.000000000","message":"Added a FIXME in the conductor code.","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c1826af0229a9cdb35107073f018450ce9e19719","unresolved":false,"context_lines":[{"line_number":5997,"context_line":"        This method should take care to rollback any resources it creates in"},{"line_number":5998,"context_line":"        case of failure."},{"line_number":5999,"context_line":""},{"line_number":6000,"context_line":"        :param ctxt: user auth request context"},{"line_number":6001,"context_line":"        :param instance: the instance being resized"},{"line_number":6002,"context_line":"        :param flavor: the flavor being resized to (unchanged for cold migrate)"},{"line_number":6003,"context_line":"        :param nodename: Name of the target compute node"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_86bc2106","line":6000,"updated":"2019-01-01 17:49:48.000000000","message":"Document that while this runs on the target host in the target cell, the context is targeted to the source cell - that\u0027s how any changes to the instance get persisted back in the source cell (check with Dan to make sure that will actually work).","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1490d710acbdb582364ac5c7971bcbedb6f816d2","unresolved":false,"context_lines":[{"line_number":5997,"context_line":"        This method should take care to rollback any resources it creates in"},{"line_number":5998,"context_line":"        case of failure."},{"line_number":5999,"context_line":""},{"line_number":6000,"context_line":"        :param ctxt: user auth request context"},{"line_number":6001,"context_line":"        :param instance: the instance being resized"},{"line_number":6002,"context_line":"        :param flavor: the flavor being resized to (unchanged for cold migrate)"},{"line_number":6003,"context_line":"        :param nodename: Name of the target compute node"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfdaf3ff_751405a1","line":6000,"in_reply_to":"1f769fc5_4aada32f","updated":"2019-01-15 23:57:12.000000000","message":"See above, this isn\u0027t right.","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56cd921ced9d7983885a0fea6b87eb115ace5143","unresolved":false,"context_lines":[{"line_number":5997,"context_line":"        This method should take care to rollback any resources it creates in"},{"line_number":5998,"context_line":"        case of failure."},{"line_number":5999,"context_line":""},{"line_number":6000,"context_line":"        :param ctxt: user auth request context"},{"line_number":6001,"context_line":"        :param instance: the instance being resized"},{"line_number":6002,"context_line":"        :param flavor: the flavor being resized to (unchanged for cold migrate)"},{"line_number":6003,"context_line":"        :param nodename: Name of the target compute node"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_4aada32f","line":6000,"in_reply_to":"1f769fc5_86bc2106","updated":"2019-01-02 14:36:28.000000000","message":"Done","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c1826af0229a9cdb35107073f018450ce9e19719","unresolved":false,"context_lines":[{"line_number":6006,"context_line":"        :raises: nova.exception.MigrationPreCheckError if the pre-check"},{"line_number":6007,"context_line":"            validation fails for the given host selection"},{"line_number":6008,"context_line":"        \"\"\""},{"line_number":6009,"context_line":"        LOG.debug(\u0027Checking if we can cross-cell migrate instance to this \u0027"},{"line_number":6010,"context_line":"                  \u0027host.\u0027, instance\u003dinstance)"},{"line_number":6011,"context_line":"        # Keep track of what we created so we can rollback if needed."},{"line_number":6012,"context_line":"        bindings_by_port_id \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_c6c21986","line":6009,"updated":"2019-01-01 17:49:48.000000000","message":"TODO: need to send same start/end notifications as prep_resize","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56cd921ced9d7983885a0fea6b87eb115ace5143","unresolved":false,"context_lines":[{"line_number":6006,"context_line":"        :raises: nova.exception.MigrationPreCheckError if the pre-check"},{"line_number":6007,"context_line":"            validation fails for the given host selection"},{"line_number":6008,"context_line":"        \"\"\""},{"line_number":6009,"context_line":"        LOG.debug(\u0027Checking if we can cross-cell migrate instance to this \u0027"},{"line_number":6010,"context_line":"                  \u0027host.\u0027, instance\u003dinstance)"},{"line_number":6011,"context_line":"        # Keep track of what we created so we can rollback if needed."},{"line_number":6012,"context_line":"        bindings_by_port_id \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_6a6dff02","line":6009,"in_reply_to":"1f769fc5_c6c21986","updated":"2019-01-02 14:36:28.000000000","message":"Done","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c1826af0229a9cdb35107073f018450ce9e19719","unresolved":false,"context_lines":[{"line_number":6011,"context_line":"        # Keep track of what we created so we can rollback if needed."},{"line_number":6012,"context_line":"        bindings_by_port_id \u003d {}"},{"line_number":6013,"context_line":"        volume_attachments \u003d []"},{"line_number":6014,"context_line":"        # TODO(mriedem): Thread out the port and volume validation so they"},{"line_number":6015,"context_line":"        # can run concurrently?"},{"line_number":6016,"context_line":"        try:"},{"line_number":6017,"context_line":"            # Claim resources on this target host using the new flavor which"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_66bf85fb","line":6014,"updated":"2019-01-01 17:49:48.000000000","message":"Can remove this TODO","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56cd921ced9d7983885a0fea6b87eb115ace5143","unresolved":false,"context_lines":[{"line_number":6011,"context_line":"        # Keep track of what we created so we can rollback if needed."},{"line_number":6012,"context_line":"        bindings_by_port_id \u003d {}"},{"line_number":6013,"context_line":"        volume_attachments \u003d []"},{"line_number":6014,"context_line":"        # TODO(mriedem): Thread out the port and volume validation so they"},{"line_number":6015,"context_line":"        # can run concurrently?"},{"line_number":6016,"context_line":"        try:"},{"line_number":6017,"context_line":"            # Claim resources on this target host using the new flavor which"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_ca66932a","line":6014,"in_reply_to":"1f769fc5_66bf85fb","updated":"2019-01-02 14:36:28.000000000","message":"Done","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4b7d4cfd8adf3fe6af1f4a00341bcb0cafc5a26f","unresolved":false,"context_lines":[{"line_number":5986,"context_line":"    @wrap_exception()"},{"line_number":5987,"context_line":"    @wrap_instance_event(prefix\u003d\u0027compute\u0027)"},{"line_number":5988,"context_line":"    @wrap_instance_fault"},{"line_number":5989,"context_line":"    def prep_snapshot_based_resize_at_dest("},{"line_number":5990,"context_line":"            self, ctxt, instance, flavor, nodename, migration, limits):"},{"line_number":5991,"context_line":"        \"\"\"Performs pre-cross-cell resize checks on the targeted destination"},{"line_number":5992,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_94286f34","line":5989,"range":{"start_line":5989,"start_character":8,"end_line":5989,"end_character":42},"updated":"2019-01-25 19:51:21.000000000","message":"Move this by the existing prep_resize.","commit_id":"89dd1323e4e155b50e4e64f0facf81e8b86e8a96"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c1826af0229a9cdb35107073f018450ce9e19719","unresolved":false,"context_lines":[{"line_number":748,"context_line":"                                       migration, limits, destination):"},{"line_number":749,"context_line":"        \"\"\"Performs pre-cross-cell resize checks on the targeted destination"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        :param ctxt: user auth request context"},{"line_number":752,"context_line":"        :param instance: the instance being resized"},{"line_number":753,"context_line":"        :param flavor: the flavor being resized to (unchanged for cold migrate)"},{"line_number":754,"context_line":"        :param nodename: Name of the target compute node"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_463cc992","line":751,"updated":"2019-01-01 17:49:48.000000000","message":"Document that the context is targeted to the source cell because that\u0027s where the instance is.","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56cd921ced9d7983885a0fea6b87eb115ace5143","unresolved":false,"context_lines":[{"line_number":748,"context_line":"                                       migration, limits, destination):"},{"line_number":749,"context_line":"        \"\"\"Performs pre-cross-cell resize checks on the targeted destination"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        :param ctxt: user auth request context"},{"line_number":752,"context_line":"        :param instance: the instance being resized"},{"line_number":753,"context_line":"        :param flavor: the flavor being resized to (unchanged for cold migrate)"},{"line_number":754,"context_line":"        :param nodename: Name of the target compute node"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_2a606701","line":751,"in_reply_to":"1f769fc5_463cc992","updated":"2019-01-02 14:36:28.000000000","message":"Done","commit_id":"a78c8419cc58cd1c67aa16fff2155c3598b071a4"}],"nova/conductor/tasks/cross_cell_migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"67bb008ff2790d9de619c0f0609f71be497ed1d7","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        # TODO(mriedem): Technically this isn\u0027t host specific and we could do"},{"line_number":280,"context_line":"        # this outside of the PrepResizeAtDestTask sub-task (unless we make"},{"line_number":281,"context_line":"        # this task handle alternates and is not just per selection, in which"},{"line_number":282,"context_line":"        # case we can move _perform_external_api_checks to this sub-task)."},{"line_number":283,"context_line":"        volume_bdms \u003d self._create_volume_attachments()"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_cddd0a15","line":282,"range":{"start_line":282,"start_character":27,"end_line":282,"end_character":55},"updated":"2019-01-26 00:01:12.000000000","message":"We don\u0027t want to move that here since we want to do that check before copying records to the target cell DB.","commit_id":"b42a9d88ddc5d165ac8202e288c5054592bdacf4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7894a0266254a7ef6a46010d0d942e859d736fa6","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        # TODO(mriedem): Technically this isn\u0027t host specific and we could do"},{"line_number":280,"context_line":"        # this outside of the PrepResizeAtDestTask sub-task (unless we make"},{"line_number":281,"context_line":"        # this task handle alternates and is not just per selection, in which"},{"line_number":282,"context_line":"        # case we can move _perform_external_api_checks to this sub-task)."},{"line_number":283,"context_line":"        volume_bdms \u003d self._create_volume_attachments()"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_2d729612","line":282,"range":{"start_line":282,"start_character":27,"end_line":282,"end_character":55},"in_reply_to":"9fdfeff1_cddd0a15","updated":"2019-01-26 00:15:03.000000000","message":"Done","commit_id":"b42a9d88ddc5d165ac8202e288c5054592bdacf4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"96702defc2c56b15089bf30b8cd235b9117a85b7","unresolved":false,"context_lines":[{"line_number":392,"context_line":"        self._target_cell_instance \u003d task.execute()"},{"line_number":393,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def _prep_resize(self):"},{"line_number":396,"context_line":"        # TODO(mriedem): Check alternates if the primary selected host fails;"},{"line_number":397,"context_line":"        # note that alternates are always in the same cell as the selected host"},{"line_number":398,"context_line":"        # so if the primary fails pre-checks, the alternates may also fail. We"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_ed8d6e31","line":395,"range":{"start_line":395,"start_character":8,"end_line":395,"end_character":20},"updated":"2019-01-25 23:55:45.000000000","message":"Rename this to _prep_resize_at_dest.","commit_id":"b42a9d88ddc5d165ac8202e288c5054592bdacf4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7894a0266254a7ef6a46010d0d942e859d736fa6","unresolved":false,"context_lines":[{"line_number":392,"context_line":"        self._target_cell_instance \u003d task.execute()"},{"line_number":393,"context_line":"        self._completed_tasks[\u0027TargetDBSetupTask\u0027] \u003d task"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def _prep_resize(self):"},{"line_number":396,"context_line":"        # TODO(mriedem): Check alternates if the primary selected host fails;"},{"line_number":397,"context_line":"        # note that alternates are always in the same cell as the selected host"},{"line_number":398,"context_line":"        # so if the primary fails pre-checks, the alternates may also fail. We"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_cd62ea3e","line":395,"range":{"start_line":395,"start_character":8,"end_line":395,"end_character":20},"in_reply_to":"9fdfeff1_ed8d6e31","updated":"2019-01-26 00:15:03.000000000","message":"Done","commit_id":"b42a9d88ddc5d165ac8202e288c5054592bdacf4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"96702defc2c56b15089bf30b8cd235b9117a85b7","unresolved":false,"context_lines":[{"line_number":440,"context_line":"    def _execute(self):"},{"line_number":441,"context_line":"        \"\"\"Execute high-level orchestration of the cross-cell resize\"\"\""},{"line_number":442,"context_line":"        # Make sure neutron and cinder APIs we need are available."},{"line_number":443,"context_line":"        self._perform_external_api_checks()"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        # Before preparing the target host create the instance record data"},{"line_number":446,"context_line":"        # in the target cell database since we cannot do anything in the"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_8d84e20d","line":443,"range":{"start_line":443,"start_character":13,"end_line":443,"end_character":41},"updated":"2019-01-25 23:55:45.000000000","message":"Should probably do this earlier in the series.","commit_id":"b42a9d88ddc5d165ac8202e288c5054592bdacf4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7894a0266254a7ef6a46010d0d942e859d736fa6","unresolved":false,"context_lines":[{"line_number":440,"context_line":"    def _execute(self):"},{"line_number":441,"context_line":"        \"\"\"Execute high-level orchestration of the cross-cell resize\"\"\""},{"line_number":442,"context_line":"        # Make sure neutron and cinder APIs we need are available."},{"line_number":443,"context_line":"        self._perform_external_api_checks()"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        # Before preparing the target host create the instance record data"},{"line_number":446,"context_line":"        # in the target cell database since we cannot do anything in the"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fdfeff1_8d5ce27e","line":443,"range":{"start_line":443,"start_character":13,"end_line":443,"end_character":41},"in_reply_to":"9fdfeff1_8d84e20d","updated":"2019-01-26 00:15:03.000000000","message":"Added TODO.","commit_id":"b42a9d88ddc5d165ac8202e288c5054592bdacf4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"826ad8ce1b2930d0d187f685254f27f05b674995","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    Upon successful completion, port bindings and volume attachments"},{"line_number":198,"context_line":"    should be created for the target host in the target cell and resources"},{"line_number":199,"context_line":"    should be claimed on the target host for the resize. Also, the instance"},{"line_number":200,"context_line":"    task_state should be ``resize_prep``."},{"line_number":201,"context_line":"    \"\"\""},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def __init__(self, context, instance, flavor, migration, compute_rpcapi,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_8d46227c","line":200,"range":{"start_line":200,"start_character":27,"end_line":200,"end_character":38},"updated":"2019-01-26 00:32:54.000000000","message":"What sets this? Oh the API does before we even get here, so I\u0027m not sure why I called it out here (I guess since subsequent tasks need to know so when they save updates to the instance they can pass expected_task_state).\n\nhttps://github.com/openstack/nova/blob/e3fc005e4e4a1bba9e888b7c50fb515fa4b560ab/nova/compute/api.py#L3593","commit_id":"d1e014d65c51e5eadc3dddd06623f057a361d039"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a3939c7bf581c8a0606b35b32b877d37f394bdc","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        self.host_selection \u003d host_selection"},{"line_number":373,"context_line":"        self.alternate_hosts \u003d alternate_hosts"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"        self.image_api \u003d nova_image.API()"},{"line_number":376,"context_line":"        self.network_api \u003d network.API()"},{"line_number":377,"context_line":"        self.volume_api \u003d cinder.API()"},{"line_number":378,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_9054c4ff","line":375,"range":{"start_line":375,"start_character":13,"end_line":375,"end_character":22},"updated":"2019-01-29 23:15:15.000000000","message":"This isn\u0027t used yet so I\u0027m not sure why I added it in here.","commit_id":"d1e014d65c51e5eadc3dddd06623f057a361d039"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"826ad8ce1b2930d0d187f685254f27f05b674995","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            self.network_api, self.volume_api)"},{"line_number":431,"context_line":"        verify_task.execute()"},{"line_number":432,"context_line":"        self._completed_tasks[\u0027PrepResizeAtDestTask\u0027] \u003d verify_task"},{"line_number":433,"context_line":"        # TODO(mriedem): Somewhere in here we need to mirror the migration"},{"line_number":434,"context_line":"        # context, created in the target cell DB, back into the source cell."},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"    def _perform_external_api_checks(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_0d5a324e","line":433,"updated":"2019-01-26 00:32:54.000000000","message":"The instance.migration_context gets created in the resize_claim flow on the target host in the target cell:\n\nhttps://github.com/openstack/nova/blob/e3fc005e4e4a1bba9e888b7c50fb515fa4b560ab/nova/compute/resource_tracker.py#L346","commit_id":"d1e014d65c51e5eadc3dddd06623f057a361d039"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"10e0db7ecbd69cac22396f78e20da7bb4240b329","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        volume BDM processed. Remember that these BDM records are from the"},{"line_number":263,"context_line":"        target cell database so the changes will only go there."},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"        :return: list of volume BDMs with an updated attachment_id field for"},{"line_number":266,"context_line":"            the newly created empty attachment for that BDM"},{"line_number":267,"context_line":"        \"\"\""},{"line_number":268,"context_line":"        volume_bdms \u003d ["},{"line_number":269,"context_line":"            bdm for bdm in self.instance.get_bdms() if bdm.is_volume"},{"line_number":270,"context_line":"        ]"},{"line_number":271,"context_line":"        for bdm in volume_bdms:"},{"line_number":272,"context_line":"            # Create the empty (no host connector) attachment."},{"line_number":273,"context_line":"            attach_ref \u003d self.volume_api.attachment_create("}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_9e7caf72","line":270,"range":{"start_line":265,"start_character":8,"end_line":270,"end_character":9},"updated":"2019-01-31 16:35:14.000000000","message":"This needs to be a BlockDeviceMappingList for the prep_snapshot_based_resize_at_dest call.","commit_id":"779989d2e267dec1cc57541b5cdbf3c84fc67be1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"22feb5b1f2be0046369839ef07c45fda04b37d0e","unresolved":false,"context_lines":[{"line_number":334,"context_line":"        except Exception:"},{"line_number":335,"context_line":"            # Don\u0027t raise if we fail to cleanup, just log it."},{"line_number":336,"context_line":"            LOG.exception(\u0027An error occurred while cleaning up port binding.\u0027,"},{"line_number":337,"context_line":"                          host, port_id, instance\u003dself.instance)"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"        try:"},{"line_number":340,"context_line":"            # Cleanup any destination host volume attachments."}],"source_content_type":"text/x-python","patch_set":10,"id":"9fdfeff1_88c9bd26","line":337,"range":{"start_line":337,"start_character":26,"end_line":337,"end_character":39},"updated":"2019-02-01 23:18:00.000000000","message":"unused","commit_id":"2c66b43c9a82461d08ada999c2894a70be06ec02"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4ffdc78c735243ad3245e157c6cdeff5deaad51","unresolved":false,"context_lines":[{"line_number":455,"context_line":"                reason\u003dex.format_message())"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"    def _prep_resize_at_dest(self, target_cell_migration):"},{"line_number":458,"context_line":"        # TODO(mriedem): Check alternates if the primary selected host fails;"},{"line_number":459,"context_line":"        # note that alternates are always in the same cell as the selected host"},{"line_number":460,"context_line":"        # so if the primary fails pre-checks, the alternates may also fail. We"},{"line_number":461,"context_line":"        # could reschedule but the scheduler doesn\u0027t yet have an ignore_cells"},{"line_number":462,"context_line":"        # capability like ignore_hosts. It might be easiest to just have"},{"line_number":463,"context_line":"        # PrepResizeAtDestTask iterate the hosts looking for one that works and"},{"line_number":464,"context_line":"        # return the results."},{"line_number":465,"context_line":"        verify_task \u003d PrepResizeAtDestTask("},{"line_number":466,"context_line":"            self._target_cell_context, self._target_cell_instance, self.flavor,"},{"line_number":467,"context_line":"            target_cell_migration, self.compute_rpcapi, self.host_selection,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_d4172e51","line":464,"range":{"start_line":458,"start_character":8,"end_line":464,"end_character":29},"updated":"2019-02-05 22:33:49.000000000","message":"Make sure that if we pick an alternate that we update the migration.dest_compute. For that matter, we should probably update the migration.dest_compute in the source database.","commit_id":"0de8349ffbce0657ddcb9437e4e7540a4e1463df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eb4e99b63e4dffe74f00de71465a327aaf8f8fd6","unresolved":false,"context_lines":[{"line_number":455,"context_line":"                reason\u003dex.format_message())"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"    def _prep_resize_at_dest(self, target_cell_migration):"},{"line_number":458,"context_line":"        # TODO(mriedem): Check alternates if the primary selected host fails;"},{"line_number":459,"context_line":"        # note that alternates are always in the same cell as the selected host"},{"line_number":460,"context_line":"        # so if the primary fails pre-checks, the alternates may also fail. We"},{"line_number":461,"context_line":"        # could reschedule but the scheduler doesn\u0027t yet have an ignore_cells"},{"line_number":462,"context_line":"        # capability like ignore_hosts. It might be easiest to just have"},{"line_number":463,"context_line":"        # PrepResizeAtDestTask iterate the hosts looking for one that works and"},{"line_number":464,"context_line":"        # return the results."},{"line_number":465,"context_line":"        verify_task \u003d PrepResizeAtDestTask("},{"line_number":466,"context_line":"            self._target_cell_context, self._target_cell_instance, self.flavor,"},{"line_number":467,"context_line":"            target_cell_migration, self.compute_rpcapi, self.host_selection,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_dab995e9","line":464,"range":{"start_line":458,"start_character":8,"end_line":464,"end_character":29},"in_reply_to":"9fdfeff1_d4172e51","updated":"2019-02-06 00:15:44.000000000","message":"The resize_claim should update the dest_compute on the migration record per alternate host we try, we just need to make sure to update the migration record in the source cell.","commit_id":"0de8349ffbce0657ddcb9437e4e7540a4e1463df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4ffdc78c735243ad3245e157c6cdeff5deaad51","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        # resize, the confirm/revert operation in the API will be acting on"},{"line_number":505,"context_line":"        # the records in the target cell database once the instance mapping"},{"line_number":506,"context_line":"        # is updated."},{"line_number":507,"context_line":"        self.migration.cross_cell_move \u003d True"},{"line_number":508,"context_line":"        self.migration.save()"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"        # TODO(mriedem): Keep track of original power state in the migration"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_9409a632","line":507,"updated":"2019-02-05 22:33:49.000000000","message":"Update dest_compute information here.","commit_id":"0de8349ffbce0657ddcb9437e4e7540a4e1463df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eb4e99b63e4dffe74f00de71465a327aaf8f8fd6","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        # resize, the confirm/revert operation in the API will be acting on"},{"line_number":505,"context_line":"        # the records in the target cell database once the instance mapping"},{"line_number":506,"context_line":"        # is updated."},{"line_number":507,"context_line":"        self.migration.cross_cell_move \u003d True"},{"line_number":508,"context_line":"        self.migration.save()"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"        # TODO(mriedem): Keep track of original power state in the migration"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_3a9d4166","line":507,"in_reply_to":"9fdfeff1_9409a632","updated":"2019-02-06 00:15:44.000000000","message":"Done","commit_id":"0de8349ffbce0657ddcb9437e4e7540a4e1463df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b0863b7fb47a89ab3ee5f69e6b4115a10035fc2","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        volume_bdms \u003d self._create_volume_attachments()"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        try:"},{"line_number":323,"context_line":"            return self.compute_rpcapi.prep_snapshot_based_resize_at_dest("},{"line_number":324,"context_line":"                self.context, self.instance, self.flavor,"},{"line_number":325,"context_line":"                self.host_selection.nodename, self.migration,"},{"line_number":326,"context_line":"                self.host_selection.limits, self._bindings_by_port_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9fdfeff1_b5835b56","line":323,"updated":"2019-02-07 21:03:29.000000000","message":"Need to update the instance AZ:\n\nself.instance.availability_zone \u003d (\n            availability_zones.get_host_availability_zone(\n                self.context, destination))","commit_id":"445b1e2e48efdda18d09f73e5b7a73fd0416f900"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"009042cef98255633e43357c5f0c6860e19a1e33","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        volume_bdms \u003d self._create_volume_attachments()"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        try:"},{"line_number":323,"context_line":"            return self.compute_rpcapi.prep_snapshot_based_resize_at_dest("},{"line_number":324,"context_line":"                self.context, self.instance, self.flavor,"},{"line_number":325,"context_line":"                self.host_selection.nodename, self.migration,"},{"line_number":326,"context_line":"                self.host_selection.limits, self._bindings_by_port_id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9fdfeff1_2372a74a","line":323,"updated":"2019-02-11 21:32:30.000000000","message":"Need to update instance AZ:\n\nself.instance.availability_zone \u003d (\n            availability_zones.get_host_availability_zone(\n                self.context, destination))","commit_id":"3a9d73b1340359f2f53529b526483574f16c293e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31cea0e177b37ac8f8b536f06e82135c562d9ba2","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        volume_bdms \u003d self._create_volume_attachments()"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        try:"},{"line_number":323,"context_line":"            return self.compute_rpcapi.prep_snapshot_based_resize_at_dest("},{"line_number":324,"context_line":"                self.context, self.instance, self.flavor,"},{"line_number":325,"context_line":"                self.host_selection.nodename, self.migration,"},{"line_number":326,"context_line":"                self.host_selection.limits, self._bindings_by_port_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_ccd703bf","line":323,"updated":"2019-02-14 16:11:19.000000000","message":"Need to update instance AZ:\n\nself.instance.availability_zone \u003d (\n            availability_zones.get_host_availability_zone(\n                self.context, destination))","commit_id":"1586941115ca9a35c6cafe3695e488d14c0d34a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"85757fd7117add7e621ef91d11d978a9081c7e03","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        volume_bdms \u003d self._create_volume_attachments()"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"        try:"},{"line_number":323,"context_line":"            return self.compute_rpcapi.prep_snapshot_based_resize_at_dest("},{"line_number":324,"context_line":"                self.context, self.instance, self.flavor,"},{"line_number":325,"context_line":"                self.host_selection.nodename, self.migration,"},{"line_number":326,"context_line":"                self.host_selection.limits, self._bindings_by_port_id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_e31e950a","line":323,"in_reply_to":"9fdfeff1_ccd703bf","updated":"2019-02-14 17:17:00.000000000","message":"Done","commit_id":"1586941115ca9a35c6cafe3695e488d14c0d34a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"46b0d32a5b984eb74b050028b6473825a05f39f6","unresolved":false,"context_lines":[{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        # We set the target cell instance new_flavor attribute now since the"},{"line_number":473,"context_line":"        # ResourceTracker.resize_claim on the destination host uses it."},{"line_number":474,"context_line":"        self._target_cell_instance.new_flavor \u003d self.flavor"},{"line_number":475,"context_line":"        verify_task \u003d PrepResizeAtDestTask("},{"line_number":476,"context_line":"            self._target_cell_context, self._target_cell_instance, self.flavor,"},{"line_number":477,"context_line":"            target_cell_migration, self.compute_rpcapi, self.host_selection,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_cc3b8335","line":474,"updated":"2019-02-14 16:07:29.000000000","message":"Stash the old_vm_state here as well like in _prep_resize in compute.","commit_id":"1586941115ca9a35c6cafe3695e488d14c0d34a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"85757fd7117add7e621ef91d11d978a9081c7e03","unresolved":false,"context_lines":[{"line_number":471,"context_line":""},{"line_number":472,"context_line":"        # We set the target cell instance new_flavor attribute now since the"},{"line_number":473,"context_line":"        # ResourceTracker.resize_claim on the destination host uses it."},{"line_number":474,"context_line":"        self._target_cell_instance.new_flavor \u003d self.flavor"},{"line_number":475,"context_line":"        verify_task \u003d PrepResizeAtDestTask("},{"line_number":476,"context_line":"            self._target_cell_context, self._target_cell_instance, self.flavor,"},{"line_number":477,"context_line":"            target_cell_migration, self.compute_rpcapi, self.host_selection,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fdfeff1_83b6a93d","line":474,"in_reply_to":"9fdfeff1_cc3b8335","updated":"2019-02-14 17:17:00.000000000","message":"Remember that this will have to be set on the source cell instance when reverting the resize in the source cell.","commit_id":"1586941115ca9a35c6cafe3695e488d14c0d34a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c5003ab0bb5bd58490dd81ce87f0f9be9136222","unresolved":false,"context_lines":[{"line_number":520,"context_line":"        :returns: Refreshed Migration record from the target cell DB after the"},{"line_number":521,"context_line":"            resize_claim on the destination host has updated the record."},{"line_number":522,"context_line":"        \"\"\""},{"line_number":523,"context_line":"        # TODO(mriedem): We\u0027re going to have to copy this back into the target"},{"line_number":524,"context_line":"        # cell migration record when changing the instance mapping to point"},{"line_number":525,"context_line":"        # at the target cell, so we might as well just set this *before* we"},{"line_number":526,"context_line":"        # even run the TargetDBSetupTask which creates the migration record"},{"line_number":527,"context_line":"        # in the target cell. Once we\u0027ve entered CrossCellMigrationTask we\u0027re"},{"line_number":528,"context_line":"        # committed to the cross-cell move anyway."},{"line_number":529,"context_line":"        self.migration.cross_cell_move \u003d True"},{"line_number":530,"context_line":"        # Copy information about the dest compute that was set on the dest"},{"line_number":531,"context_line":"        # migration record during the resize claim on the dest host."},{"line_number":532,"context_line":"        # We have to get a fresh copy of the target cell migration record to"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_03459e15","line":529,"range":{"start_line":523,"start_character":8,"end_line":529,"end_character":45},"updated":"2019-02-18 17:36:38.000000000","message":"Done.","commit_id":"f08443dbd49c1fe29c3845cf686e78073d1831a5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b7f217619c8ad26dc01e8f64db6e277df4c76ee","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            bdm.save()"},{"line_number":284,"context_line":"        return volume_bdms"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def _execute(self):"},{"line_number":287,"context_line":"        \"\"\"Performs pre-cross-cell resize checks/claims on the targeted host"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        This ensures things like networking (ports) and storage (volumes) will"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_2404c713","line":286,"updated":"2019-02-26 19:10:34.000000000","message":"Log what this task is doing.","commit_id":"4f658a1cbab14b8810eaf38985cb13ccceaa6bc1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0a37876e58d243b8204009edf213bf21b56b8baa","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            bdm.save()"},{"line_number":284,"context_line":"        return volume_bdms"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def _execute(self):"},{"line_number":287,"context_line":"        \"\"\"Performs pre-cross-cell resize checks/claims on the targeted host"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        This ensures things like networking (ports) and storage (volumes) will"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_fa3734e2","line":286,"in_reply_to":"9fdfeff1_2404c713","updated":"2019-02-26 21:07:44.000000000","message":"Done","commit_id":"4f658a1cbab14b8810eaf38985cb13ccceaa6bc1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b7f217619c8ad26dc01e8f64db6e277df4c76ee","unresolved":false,"context_lines":[{"line_number":321,"context_line":"            return self.compute_rpcapi.prep_snapshot_based_resize_at_dest("},{"line_number":322,"context_line":"                self.context, self.instance, self.flavor,"},{"line_number":323,"context_line":"                self.host_selection.nodename, self.migration,"},{"line_number":324,"context_line":"                self.host_selection.limits, self._bindings_by_port_id,"},{"line_number":325,"context_line":"                volume_bdms, destination)"},{"line_number":326,"context_line":"        except messaging.MessagingTimeout:"},{"line_number":327,"context_line":"            msg \u003d _(\u0027RPC timeout while checking if we can cross-cell migrate \u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_e411df54","line":324,"range":{"start_line":324,"start_character":49,"end_line":324,"end_character":69},"updated":"2019-02-26 19:10:34.000000000","message":"This parameter is no longer on the method.","commit_id":"4f658a1cbab14b8810eaf38985cb13ccceaa6bc1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0a37876e58d243b8204009edf213bf21b56b8baa","unresolved":false,"context_lines":[{"line_number":321,"context_line":"            return self.compute_rpcapi.prep_snapshot_based_resize_at_dest("},{"line_number":322,"context_line":"                self.context, self.instance, self.flavor,"},{"line_number":323,"context_line":"                self.host_selection.nodename, self.migration,"},{"line_number":324,"context_line":"                self.host_selection.limits, self._bindings_by_port_id,"},{"line_number":325,"context_line":"                volume_bdms, destination)"},{"line_number":326,"context_line":"        except messaging.MessagingTimeout:"},{"line_number":327,"context_line":"            msg \u003d _(\u0027RPC timeout while checking if we can cross-cell migrate \u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_ba2d2c90","line":324,"range":{"start_line":324,"start_character":49,"end_line":324,"end_character":69},"in_reply_to":"9fdfeff1_e411df54","updated":"2019-02-26 21:07:44.000000000","message":"Done","commit_id":"4f658a1cbab14b8810eaf38985cb13ccceaa6bc1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8deb5786ebde4321fa098eebb1eef937ab37bd79","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        :raises: nova.exception.MigrationPreCheckError if the pre-check"},{"line_number":303,"context_line":"            validation fails for the given host selection; this indicates an"},{"line_number":304,"context_line":"            alternative host *may* work but this one does not."},{"line_number":305,"context_line":"        :raises: NeutronRequiredExtensionNotFound if the neutron API does not"},{"line_number":306,"context_line":"            support the port bindings-extended extension; this indicates an"},{"line_number":307,"context_line":"            alternative host will not work and the resize operation must fail."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":45,"id":"9fb8cfa7_427bdc8a","line":305,"updated":"2019-06-27 15:19:58.000000000","message":"Is it raised through _create_port_bindings() -\u003e  bind_ports_to_host() ? I don\u0027t see when that call path raises  NeutronRequiredExtensionNotFound","commit_id":"20f66162b62fa3cfb2e9188c5f0eb3059b0a8dc3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b2116e3c204ae535265a1338b90511ebab6caf5","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        :raises: nova.exception.MigrationPreCheckError if the pre-check"},{"line_number":303,"context_line":"            validation fails for the given host selection; this indicates an"},{"line_number":304,"context_line":"            alternative host *may* work but this one does not."},{"line_number":305,"context_line":"        :raises: NeutronRequiredExtensionNotFound if the neutron API does not"},{"line_number":306,"context_line":"            support the port bindings-extended extension; this indicates an"},{"line_number":307,"context_line":"            alternative host will not work and the resize operation must fail."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":45,"id":"9fb8cfa7_8d7a37ee","line":305,"in_reply_to":"9fb8cfa7_427bdc8a","updated":"2019-07-01 16:51:24.000000000","message":"Good catch, this must be leftover from before I split out _perform_external_api_checks. Will remove this.","commit_id":"20f66162b62fa3cfb2e9188c5f0eb3059b0a8dc3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5fef92060c42988bbbd339a014ac5a5a2c890344","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        :raises: nova.exception.MigrationPreCheckError if the pre-check"},{"line_number":303,"context_line":"            validation fails for the given host selection; this indicates an"},{"line_number":304,"context_line":"            alternative host *may* work but this one does not."},{"line_number":305,"context_line":"        :raises: NeutronRequiredExtensionNotFound if the neutron API does not"},{"line_number":306,"context_line":"            support the port bindings-extended extension; this indicates an"},{"line_number":307,"context_line":"            alternative host will not work and the resize operation must fail."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":45,"id":"7faddb67_9a1a5d15","line":305,"in_reply_to":"9fb8cfa7_8d7a37ee","updated":"2019-07-03 20:23:48.000000000","message":"Done","commit_id":"20f66162b62fa3cfb2e9188c5f0eb3059b0a8dc3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8deb5786ebde4321fa098eebb1eef937ab37bd79","unresolved":false,"context_lines":[{"line_number":565,"context_line":"        target_cell_migration \u003d self._prep_resize_at_dest("},{"line_number":566,"context_line":"            target_cell_migration)"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        # TODO(mriedem): Keep track of original power state in the migration"},{"line_number":569,"context_line":"        # context so we need if we need to keep the server stopped after it"},{"line_number":570,"context_line":"        # is resized."},{"line_number":571,"context_line":"        # TODO(mriedem): If image-backed, snapshot the server from source host"}],"source_content_type":"text/x-python","patch_set":45,"id":"9fb8cfa7_bfae6f2b","line":568,"range":{"start_line":568,"start_character":39,"end_line":568,"end_character":59},"updated":"2019-06-27 15:19:58.000000000","message":"Do we need to track both the vm_state (L495) and the power state separately? Or this TODO is already resolved by the code at L495?","commit_id":"20f66162b62fa3cfb2e9188c5f0eb3059b0a8dc3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b2116e3c204ae535265a1338b90511ebab6caf5","unresolved":false,"context_lines":[{"line_number":565,"context_line":"        target_cell_migration \u003d self._prep_resize_at_dest("},{"line_number":566,"context_line":"            target_cell_migration)"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        # TODO(mriedem): Keep track of original power state in the migration"},{"line_number":569,"context_line":"        # context so we need if we need to keep the server stopped after it"},{"line_number":570,"context_line":"        # is resized."},{"line_number":571,"context_line":"        # TODO(mriedem): If image-backed, snapshot the server from source host"}],"source_content_type":"text/x-python","patch_set":45,"id":"9fb8cfa7_cd734f15","line":568,"range":{"start_line":568,"start_character":39,"end_line":568,"end_character":59},"in_reply_to":"9fb8cfa7_bfae6f2b","updated":"2019-07-01 16:51:24.000000000","message":"This TODO is also old so I\u0027ll remove this as well.","commit_id":"20f66162b62fa3cfb2e9188c5f0eb3059b0a8dc3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5fef92060c42988bbbd339a014ac5a5a2c890344","unresolved":false,"context_lines":[{"line_number":565,"context_line":"        target_cell_migration \u003d self._prep_resize_at_dest("},{"line_number":566,"context_line":"            target_cell_migration)"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        # TODO(mriedem): Keep track of original power state in the migration"},{"line_number":569,"context_line":"        # context so we need if we need to keep the server stopped after it"},{"line_number":570,"context_line":"        # is resized."},{"line_number":571,"context_line":"        # TODO(mriedem): If image-backed, snapshot the server from source host"}],"source_content_type":"text/x-python","patch_set":45,"id":"7faddb67_ba1719ee","line":568,"range":{"start_line":568,"start_character":39,"end_line":568,"end_character":59},"in_reply_to":"9fb8cfa7_cd734f15","updated":"2019-07-03 20:23:48.000000000","message":"Done","commit_id":"20f66162b62fa3cfb2e9188c5f0eb3059b0a8dc3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4b6674f3b6365f8bab70e69989007a48f5af6bb9","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        :raises: MigrationPreCheckError if port binding failed"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        LOG.debug(\u0027Creating port bindings for destination host %s\u0027,"},{"line_number":248,"context_line":"                  self.host_selection.service_host)"},{"line_number":249,"context_line":"        try:"},{"line_number":250,"context_line":"            self._bindings_by_port_id \u003d self.network_api.bind_ports_to_host("},{"line_number":251,"context_line":"                self.context, self.instance, self.host_selection.service_host)"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_bc4fb2bc","line":248,"range":{"start_line":248,"start_character":50,"end_line":248,"end_character":51},"updated":"2019-08-13 15:33:03.000000000","message":"worth including the instance in this log?","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8d65ff04833ac4ef4f6c5592df7fe7a178fca9b4","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        :raises: MigrationPreCheckError if port binding failed"},{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        LOG.debug(\u0027Creating port bindings for destination host %s\u0027,"},{"line_number":248,"context_line":"                  self.host_selection.service_host)"},{"line_number":249,"context_line":"        try:"},{"line_number":250,"context_line":"            self._bindings_by_port_id \u003d self.network_api.bind_ports_to_host("},{"line_number":251,"context_line":"                self.context, self.instance, self.host_selection.service_host)"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_107ecce3","line":248,"range":{"start_line":248,"start_character":50,"end_line":248,"end_character":51},"in_reply_to":"7faddb67_bc4fb2bc","updated":"2019-08-14 21:08:34.000000000","message":"Can do in a follow up.","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4b6674f3b6365f8bab70e69989007a48f5af6bb9","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        LOG.debug(\u0027Creating port bindings for destination host %s\u0027,"},{"line_number":248,"context_line":"                  self.host_selection.service_host)"},{"line_number":249,"context_line":"        try:"},{"line_number":250,"context_line":"            self._bindings_by_port_id \u003d self.network_api.bind_ports_to_host("},{"line_number":251,"context_line":"                self.context, self.instance, self.host_selection.service_host)"},{"line_number":252,"context_line":"        except exception.PortBindingFailed:"},{"line_number":253,"context_line":"            raise exception.MigrationPreCheckError(reason\u003d_("},{"line_number":254,"context_line":"                \u0027Failed to create port bindings for host %s\u0027) %"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_cf074e18","line":251,"range":{"start_line":250,"start_character":40,"end_line":251,"end_character":78},"updated":"2019-08-13 15:33:03.000000000","message":"You\u0027re storing the returned dict here (dict of port bindings keyed by port ID), when all you seem to need to is the port IDs. Might be a little simpler to just store those IDs","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8d65ff04833ac4ef4f6c5592df7fe7a178fca9b4","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        LOG.debug(\u0027Creating port bindings for destination host %s\u0027,"},{"line_number":248,"context_line":"                  self.host_selection.service_host)"},{"line_number":249,"context_line":"        try:"},{"line_number":250,"context_line":"            self._bindings_by_port_id \u003d self.network_api.bind_ports_to_host("},{"line_number":251,"context_line":"                self.context, self.instance, self.host_selection.service_host)"},{"line_number":252,"context_line":"        except exception.PortBindingFailed:"},{"line_number":253,"context_line":"            raise exception.MigrationPreCheckError(reason\u003d_("},{"line_number":254,"context_line":"                \u0027Failed to create port bindings for host %s\u0027) %"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_706ce035","line":251,"range":{"start_line":250,"start_character":40,"end_line":251,"end_character":78},"in_reply_to":"7faddb67_cf074e18","updated":"2019-08-14 21:08:34.000000000","message":"Yeah I\u0027m not sure if I planned on needing the port binding details at some point or not. For now storing this doesn\u0027t hurt in case we do need the values later, e.g. to pass down to the dest compute or something.","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4b6674f3b6365f8bab70e69989007a48f5af6bb9","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            that BDM"},{"line_number":268,"context_line":"        \"\"\""},{"line_number":269,"context_line":"        LOG.debug(\u0027Creating volume attachments for destination host %s\u0027,"},{"line_number":270,"context_line":"                  self.host_selection.service_host)"},{"line_number":271,"context_line":"        volume_bdms \u003d objects.BlockDeviceMappingList(objects\u003d["},{"line_number":272,"context_line":"            bdm for bdm in self.instance.get_bdms() if bdm.is_volume])"},{"line_number":273,"context_line":"        for bdm in volume_bdms:"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_5c4ebec1","line":270,"range":{"start_line":270,"start_character":50,"end_line":270,"end_character":51},"updated":"2019-08-13 15:33:03.000000000","message":"ditto","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8d65ff04833ac4ef4f6c5592df7fe7a178fca9b4","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            that BDM"},{"line_number":268,"context_line":"        \"\"\""},{"line_number":269,"context_line":"        LOG.debug(\u0027Creating volume attachments for destination host %s\u0027,"},{"line_number":270,"context_line":"                  self.host_selection.service_host)"},{"line_number":271,"context_line":"        volume_bdms \u003d objects.BlockDeviceMappingList(objects\u003d["},{"line_number":272,"context_line":"            bdm for bdm in self.instance.get_bdms() if bdm.is_volume])"},{"line_number":273,"context_line":"        for bdm in volume_bdms:"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_3072e813","line":270,"range":{"start_line":270,"start_character":50,"end_line":270,"end_character":51},"in_reply_to":"7faddb67_5c4ebec1","updated":"2019-08-14 21:08:34.000000000","message":"Can FUP.","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4b6674f3b6365f8bab70e69989007a48f5af6bb9","unresolved":false,"context_lines":[{"line_number":334,"context_line":"        # Rollback anything we created."},{"line_number":335,"context_line":"        host \u003d self.host_selection.service_host"},{"line_number":336,"context_line":"        # Cleanup any destination host port bindings."},{"line_number":337,"context_line":"        LOG.debug(\u0027Cleaning up port bindings for destination host %s\u0027, host)"},{"line_number":338,"context_line":"        for port_id in self._bindings_by_port_id:"},{"line_number":339,"context_line":"            try:"},{"line_number":340,"context_line":"                self.network_api.delete_port_binding("},{"line_number":341,"context_line":"                    self.context, port_id, host)"},{"line_number":342,"context_line":"            except Exception:"},{"line_number":343,"context_line":"                # Don\u0027t raise if we fail to cleanup, just log it."},{"line_number":344,"context_line":"                LOG.exception(\u0027An error occurred while cleaning up binding \u0027"},{"line_number":345,"context_line":"                              \u0027for port %s on host %s.\u0027, port_id, host,"},{"line_number":346,"context_line":"                              instance\u003dself.instance)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"        # Cleanup any destination host volume attachments."},{"line_number":349,"context_line":"        LOG.debug("}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_cf20ae9e","line":346,"range":{"start_line":337,"start_character":0,"end_line":346,"end_character":53},"updated":"2019-08-13 15:33:03.000000000","message":"nit: wonder if a \u0027_delete_port_bindings\u0027 helper would be useful. Ditto for below. Guess there isn\u0027t a whole lot here though","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4b6674f3b6365f8bab70e69989007a48f5af6bb9","unresolved":false,"context_lines":[{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        return self._update_migration_from_dest_after_claim("},{"line_number":516,"context_line":"            target_cell_migration)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def _update_migration_from_dest_after_claim(self, target_cell_migration):"},{"line_number":519,"context_line":"        \"\"\"Update the source cell migration record with target cell info."},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"        The PrepResizeAtDestTask runs a resize_claim on the target compute"},{"line_number":522,"context_line":"        host service in the target cell which sets fields about the destination"},{"line_number":523,"context_line":"        in the migration record in the target cell. We need to reflect those"},{"line_number":524,"context_line":"        changes back into the migration record in the source cell."},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"        :param target_cell_migration: Migration record from the target cell DB"},{"line_number":527,"context_line":"        :returns: Refreshed Migration record from the target cell DB after the"},{"line_number":528,"context_line":"            resize_claim on the destination host has updated the record."},{"line_number":529,"context_line":"        \"\"\""},{"line_number":530,"context_line":"        # Copy information about the dest compute that was set on the dest"},{"line_number":531,"context_line":"        # migration record during the resize claim on the dest host."},{"line_number":532,"context_line":"        # We have to get a fresh copy of the target cell migration record to"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_8f6876ba","line":529,"range":{"start_line":515,"start_character":0,"end_line":529,"end_character":11},"updated":"2019-08-13 15:33:03.000000000","message":"nit: Given how similar this stuff is to the above, I don\u0027t know if separating this out is worth it. It\u0027s nearly easier as one function with the comments","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8d65ff04833ac4ef4f6c5592df7fe7a178fca9b4","unresolved":false,"context_lines":[{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        return self._update_migration_from_dest_after_claim("},{"line_number":516,"context_line":"            target_cell_migration)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def _update_migration_from_dest_after_claim(self, target_cell_migration):"},{"line_number":519,"context_line":"        \"\"\"Update the source cell migration record with target cell info."},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"        The PrepResizeAtDestTask runs a resize_claim on the target compute"},{"line_number":522,"context_line":"        host service in the target cell which sets fields about the destination"},{"line_number":523,"context_line":"        in the migration record in the target cell. We need to reflect those"},{"line_number":524,"context_line":"        changes back into the migration record in the source cell."},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"        :param target_cell_migration: Migration record from the target cell DB"},{"line_number":527,"context_line":"        :returns: Refreshed Migration record from the target cell DB after the"},{"line_number":528,"context_line":"            resize_claim on the destination host has updated the record."},{"line_number":529,"context_line":"        \"\"\""},{"line_number":530,"context_line":"        # Copy information about the dest compute that was set on the dest"},{"line_number":531,"context_line":"        # migration record during the resize claim on the dest host."},{"line_number":532,"context_line":"        # We have to get a fresh copy of the target cell migration record to"}],"source_content_type":"text/x-python","patch_set":52,"id":"7faddb67_b057b85a","line":529,"range":{"start_line":515,"start_character":0,"end_line":529,"end_character":11},"in_reply_to":"7faddb67_8f6876ba","updated":"2019-08-14 21:08:34.000000000","message":"Yeah, it\u0027s all pretty tightly coupled. I think I tried to split things down when possible because of knowing how big and gross the other conductor methods are over time, plus it\u0027s easier to unit test with separate methods.","commit_id":"5ce67d8397970f3878a5b107922a0d380051dc3d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"462e0bcbf06c42a6b4c6db03b86bc3ee8e977a5c","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # hosts."},{"line_number":509,"context_line":"        self.instance.migration_context \u003d ("},{"line_number":510,"context_line":"            target_cell_migration_context.obj_clone())"},{"line_number":511,"context_line":"        self.instance.migration_context.migration_id \u003d self.migration.id"},{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_7e9f9c01","line":511,"range":{"start_line":511,"start_character":8,"end_line":511,"end_character":72},"updated":"2019-08-19 14:50:07.000000000","message":"This is an id of a row in the target database, that you\u0027re setting in the source database right? That seems icky to me... Anything that goes to do that lookup will fail. I think your comment above says it needs to be set for neutron event routing, but I\u0027m not sure the details of that or why it just being set to anything is fine...\n\n*later*\n\nEr, wait, this is actually the migration that was created in the source cell and updated in L539 below, right? I think it would probably help a lot to name all of the resources with a target_ or source_ prefix as it\u0027s rather confusing to me at least. So these two lines above are mirroring the contents of the migration_context, but fixing up the migration_id to point to the one in the same database, yeah?","commit_id":"a9da02c4abf9b7e9395ab6d19c862c6340f8077f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c654f5f879c22c25a8e688581aaccad5c74dd29a","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # hosts."},{"line_number":509,"context_line":"        self.instance.migration_context \u003d ("},{"line_number":510,"context_line":"            target_cell_migration_context.obj_clone())"},{"line_number":511,"context_line":"        self.instance.migration_context.migration_id \u003d self.migration.id"},{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_b98e8e2b","line":511,"range":{"start_line":511,"start_character":8,"end_line":511,"end_character":72},"in_reply_to":"7faddb67_7e9f9c01","updated":"2019-08-19 15:06:09.000000000","message":"Yes, we\u0027re cloning the migration_context from the target cell DB into the source cell instance but correcting the migration_id on the source cell instance copy to point at the source cell migration record.\n\nFor the most part I try to prefix with target_ for things, but some stuff like self.migration I\u0027m clearly not. And self.instance and self.context are stored in the base task so I\u0027d have to create copies of those variables to rename them in the task, which is probably why I didn\u0027t. I\u0027d be OK with renaming self.migration to self.source_migration in a follow up since it\u0027s already merged.","commit_id":"a9da02c4abf9b7e9395ab6d19c862c6340f8077f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cebbd2b5b88cac270534ff5de023d5b1240e1561","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        # hosts."},{"line_number":509,"context_line":"        self.instance.migration_context \u003d ("},{"line_number":510,"context_line":"            target_cell_migration_context.obj_clone())"},{"line_number":511,"context_line":"        self.instance.migration_context.migration_id \u003d self.migration.id"},{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_2beaab73","line":511,"range":{"start_line":511,"start_character":8,"end_line":511,"end_character":72},"in_reply_to":"7faddb67_b98e8e2b","updated":"2019-08-27 19:51:02.000000000","message":"Renamed the migration instance variables in this follow up:\n\nhttps://review.opendev.org/#/c/678951/","commit_id":"a9da02c4abf9b7e9395ab6d19c862c6340f8077f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"462e0bcbf06c42a6b4c6db03b86bc3ee8e977a5c","unresolved":false,"context_lines":[{"line_number":509,"context_line":"        self.instance.migration_context \u003d ("},{"line_number":510,"context_line":"            target_cell_migration_context.obj_clone())"},{"line_number":511,"context_line":"        self.instance.migration_context.migration_id \u003d self.migration.id"},{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        return self._update_migration_from_dest_after_claim("}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_de549024","line":512,"updated":"2019-08-19 14:50:07.000000000","message":"Is this necessary? I would expect we\u0027d start the operation with instance._context and since migration_context is part of the save (IIRC), I wouldn\u0027t think this needs to be set...","commit_id":"a9da02c4abf9b7e9395ab6d19c862c6340f8077f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c654f5f879c22c25a8e688581aaccad5c74dd29a","unresolved":false,"context_lines":[{"line_number":509,"context_line":"        self.instance.migration_context \u003d ("},{"line_number":510,"context_line":"            target_cell_migration_context.obj_clone())"},{"line_number":511,"context_line":"        self.instance.migration_context.migration_id \u003d self.migration.id"},{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        return self._update_migration_from_dest_after_claim("}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_f94086a4","line":512,"in_reply_to":"7faddb67_de549024","updated":"2019-08-19 15:06:09.000000000","message":"Looking at Instance.save again I think you\u0027re right, migration_context should be saved as part of _extra_values_to_save since there is no explicit Instance._save_migration_context method.\n\nIf it\u0027s OK with you I\u0027ll remove this in a follow up so I don\u0027t lose gibi\u0027s +2 and have to rebase the series to fix this (which isn\u0027t hurting anything otherwise).","commit_id":"a9da02c4abf9b7e9395ab6d19c862c6340f8077f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cebbd2b5b88cac270534ff5de023d5b1240e1561","unresolved":false,"context_lines":[{"line_number":509,"context_line":"        self.instance.migration_context \u003d ("},{"line_number":510,"context_line":"            target_cell_migration_context.obj_clone())"},{"line_number":511,"context_line":"        self.instance.migration_context.migration_id \u003d self.migration.id"},{"line_number":512,"context_line":"        self.instance.migration_context._context \u003d self.context"},{"line_number":513,"context_line":"        self.instance.save()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"        return self._update_migration_from_dest_after_claim("}],"source_content_type":"text/x-python","patch_set":53,"id":"7faddb67_ebfb3345","line":512,"in_reply_to":"7faddb67_f94086a4","updated":"2019-08-27 19:51:02.000000000","message":"Removed here: https://review.opendev.org/#/c/678951/","commit_id":"a9da02c4abf9b7e9395ab6d19c862c6340f8077f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"892071722ceef8153997bb60c549c907f773fdc7","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_adb87a10","line":495,"updated":"2019-10-14 19:35:06.000000000","message":"What happens if I delete the instance while this is going on? We\u0027ll abort here and start rolling things back, but will all of those ports and allocations get cleaned up without choking on the deleted instance? Thinking about this, it\u0027s a pretty precarious situation to be in.. We\u0027ve got instances and migrations in both cells right now, allocations all over the place, and if we abort in the middle due to a deleted instance and don\u0027t clean all that up properly we\u0027re leaving quite a mess.\n\nIs there a test somewhere further up the stack that hits this scenario?","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"414be72d35f5669183f34de1694e6e1529e108e1","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_94e7b0ac","line":495,"in_reply_to":"3fa7e38b_149c2068","updated":"2019-10-15 23:11:03.000000000","message":"Here is the WIP patch that recreates the bug:\n\nhttps://review.opendev.org/688832","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"551ef7db2ce80cc17221e51ff0af31b4680af638","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_149c2068","line":495,"in_reply_to":"3fa7e38b_74e31406","updated":"2019-10-15 22:44:20.000000000","message":"The migration.save() doesn\u0027t fail even though it\u0027s deleted in the source cell DB because the DB API code for migration.save() unconditionally reads deleted records:\n\nhttps://github.com/openstack/nova/blob/0238cf431b021c8aa779848bb771222d7d8539cf/nova/db/sqlalchemy/api.py#L4334\n\nhttps://github.com/openstack/nova/blob/0238cf431b021c8aa779848bb771222d7d8539cf/nova/db/sqlalchemy/api.py#L4343\n\nSo that\u0027s fun.","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8c0a2e50d8734b7828e9dc2cdf044df16045dee2","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_ab0ff82b","line":495,"in_reply_to":"3fa7e38b_8d9c9e6a","updated":"2019-10-15 13:04:55.000000000","message":"Per our IRC discussion I will add a negative test later in the series to hit this scenario and we can hold this patch until that test change is available.","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"513acbe4bcbd1541c6f904d6d292a227e4298751","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_f40944dc","line":495,"in_reply_to":"3fa7e38b_ab0ff82b","updated":"2019-10-15 22:27:38.000000000","message":"OK I\u0027ve got a test and it shows a latent bug in our rollback handling in the existing MigraitionTask in conductor. Note this is a problem for same-cell resize as well, it would just fail in compute rather than conductor in that case I think (as long as conductor has RPC cast off to prep_resize anyway).\n\nIf the instance is deleted during prep_snapshot_based_resize_at_dest the MigrationTask rollback may fail here depending on timing:\n\nhttps://github.com/openstack/nova/blob/0238cf431b021c8aa779848bb771222d7d8539cf/nova/conductor/tasks/migrate.py#L450\n\nBecause the migration.save will fail if it was deleted when the server was deleted (though maybe that migration.save doesn\u0027t fail and just updates a stale record in the source cell DB).\n\nAnyway, if migration.save() doesn\u0027t fail we call revert_allocation_for_migration:\n\nhttps://github.com/openstack/nova/blob/0238cf431b021c8aa779848bb771222d7d8539cf/nova/conductor/tasks/migrate.py#L461\n\nAnd that will swap the allocations held by the migration consumer on the source host back to the instance consumer which may already be deleted. We do use consumer generations for POST /allocations but it looks like we might pass consumer_generation\u003dNone if the target consumer (the instance in this case) does not exist:\n\nhttps://github.com/openstack/nova/blob/0238cf431b021c8aa779848bb771222d7d8539cf/nova/scheduler/client/report.py#L1886\n\nThat will recreate the allocations for the instance on the source host using the allocations held by the migration consumer. And that\u0027s what I\u0027m seeing in my recreate test - the server is gone from the source and target cell DBs but the source host still has allocations for the instance consumer because the migration task rollback swapped them back rather than just deleting them.","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2e2f6b2981fc5c67b49660fb57580f130f673701","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_8d9c9e6a","line":495,"in_reply_to":"3fa7e38b_adb87a10","updated":"2019-10-14 19:49:01.000000000","message":"\u003e What happens if I delete the instance while this is going on? We\u0027ll\n \u003e abort here and start rolling things back, but will all of those\n \u003e ports and allocations get cleaned up without choking on the deleted\n \u003e instance? Thinking about this, it\u0027s a pretty precarious situation\n \u003e to be in.. We\u0027ve got instances and migrations in both cells right\n \u003e now, allocations all over the place, and if we abort in the middle\n \u003e due to a deleted instance and don\u0027t clean all that up properly\n \u003e we\u0027re leaving quite a mess.\n\nAt this point the instance mapping still points at the instance in the source cell db so if the user deletes the instance concurrently it\u0027s going to delete the instance from the source cell DB along with cleaning up its ports/volumes/allocations as tracked in the source cell DB (and placement centrally for allocations).\n\nOn this specific line nothing will blow up because we\u0027re updating the target cell DB instance. We should blow up on L507 though since that is the instance in the source cell database, but I would have to test that since we\u0027re not specifying expected_task_state. I would expect save() to fail with InstanceNotFound or UnexpectedDeletingTaskStateError.\n\nIf this fails then we should rollback and cleanup the instance from the target cell DB and eventually MigrationTask should also try to revert the allocations, created by the scheduler, on the dest host.\n\n \u003e \n \u003e Is there a test somewhere further up the stack that hits this\n \u003e scenario?\n\nI don\u0027t think I have a specific test for deleting the instance from the source while we\u0027re prepping on the dest, I do have some negative tests for things failing during the resize to the target cell and verifying that rebooting on the source fixes the status:\n\nhttps://review.opendev.org/#/c/643451/\n\nhttps://review.opendev.org/#/c/669013/\n\nI could add a negative test on top of those that does something like stub out the dest host resize_claim to delete the instance in the source cell (via the API so everything is kosher wrt DB handling) so that when we get back here in conductor and try to update the instance in the source cell it blows up and then assert we\u0027ve cleaned up properly, e.g. no leaked allocations.","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6302aed2cba14204f2fbd2adfd60c0f32930fdd8","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._target_cell_instance.availability_zone \u003d ("},{"line_number":493,"context_line":"            availability_zones.get_host_availability_zone("},{"line_number":494,"context_line":"                self.context, self.host_selection.service_host))"},{"line_number":495,"context_line":"        self._target_cell_instance.save()"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"        # We need to mirror the MigrationContext, created in the target cell"},{"line_number":498,"context_line":"        # database, into the source cell database. Keep in mind that the"}],"source_content_type":"text/x-python","patch_set":60,"id":"3fa7e38b_74e31406","line":495,"in_reply_to":"3fa7e38b_f40944dc","updated":"2019-10-15 22:37:18.000000000","message":"Yup I verified that the instance target consumer doesn\u0027t exist and we get a KeyError here when moving allocations back:\n\nhttps://github.com/openstack/nova/blob/0238cf431b021c8aa779848bb771222d7d8539cf/nova/scheduler/client/report.py#L1886\n\n    b\"2019-10-15 18:35:26,881 WARNING [nova.scheduler.utils] Failed to compute_task_migrate_server: \u0027consumer_generation\u0027\"\n    b\u00272019-10-15 18:35:26,882 WARNING [nova.scheduler.utils] Setting instance to ACTIVE state.\u0027\n    b\u00272019-10-15 18:35:26,947 ERROR [oslo_messaging.rpc.server] Exception during message handling\u0027\n    b\u0027Traceback (most recent call last):\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_messaging/rpc/server.py\", line 165, in _process_incoming\u0027\n    b\u0027    res \u003d self.dispatcher.dispatch(message)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_messaging/rpc/dispatcher.py\", line 274, in dispatch\u0027\n    b\u0027    return self._do_dispatch(endpoint, method, ctxt, args)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_messaging/rpc/dispatcher.py\", line 194, in _do_dispatch\u0027\n    b\u0027    result \u003d func(ctxt, **new_args)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_messaging/rpc/server.py\", line 235, in inner\u0027\n    b\u0027    return func(*args, **kwargs)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/manager.py\", line 96, in wrapper\u0027\n    b\u0027    return fn(self, context, *args, **kwargs)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/compute/utils.py\", line 1372, in decorated_function\u0027\n    b\u0027    return function(self, context, *args, **kwargs)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/manager.py\", line 300, in migrate_server\u0027\n    b\u0027    host_list)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/manager.py\", line 394, in _cold_migrate\u0027\n    b\"    else \u0027cold migrate\u0027, instance\u003dinstance)\"\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_utils/excutils.py\", line 220, in __exit__\u0027\n    b\u0027    self.force_reraise()\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_utils/excutils.py\", line 196, in force_reraise\u0027\n    b\u0027    six.reraise(self.type_, self.value, self.tb)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/six.py\", line 693, in reraise\u0027\n    b\u0027    raise value\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/manager.py\", line 351, in _cold_migrate\u0027\n    b\u0027    task.execute()\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/tasks/base.py\", line 27, in wrap\u0027\n    b\u0027    self.rollback()\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_utils/excutils.py\", line 220, in __exit__\u0027\n    b\u0027    self.force_reraise()\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_utils/excutils.py\", line 196, in force_reraise\u0027\n    b\u0027    six.reraise(self.type_, self.value, self.tb)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/six.py\", line 693, in reraise\u0027\n    b\u0027    raise value\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/tasks/base.py\", line 24, in wrap\u0027\n    b\u0027    return original(self)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/tasks/base.py\", line 42, in execute\u0027\n    b\u0027    return self._execute()\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/tasks/migrate.py\", line 365, in _execute\u0027\n    b\u0027    migration \u003d self._preallocate_migration()\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/tasks/migrate.py\", line 161, in _preallocate_migration\u0027\n    b\u0027    self._migration))\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/conductor/tasks/migrate.py\", line 73, in replace_allocation_with_migration\u0027\n    b\u0027    migration.uuid)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/scheduler/client/report.py\", line 72, in wrapper\u0027\n    b\u0027    return f(self, *a, **k)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/scheduler/client/report.py\", line 114, in wrapper\u0027\n    b\u0027    return f(self, *a, **k)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/scheduler/client/report.py\", line 1886, in move_allocations\u0027\n    b\"    \u0027consumer_generation\u0027: target_alloc[\u0027consumer_generation\u0027]\"\n    b\"KeyError: \u0027consumer_generation\u0027\"","commit_id":"b1d2d47101de5e23874bf3699e8f2acba47a5ee5"}],"nova/objects/service.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4b7d4cfd8adf3fe6af1f4a00341bcb0cafc5a26f","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    {\u0027compute_rpc\u0027: \u00275.0\u0027},"},{"line_number":152,"context_line":"    # Version 37: prep_resize takes a RequestSpec object"},{"line_number":153,"context_line":"    {\u0027compute_rpc\u0027: \u00275.1\u0027},"},{"line_number":154,"context_line":"    # Version 37: Compute RPC version 5.1; +prep_snapshot_based_resize_at_dest"},{"line_number":155,"context_line":"    {\u0027compute_rpc\u0027: \u00275.2\u0027},"},{"line_number":156,"context_line":")"},{"line_number":157,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9fdfeff1_14031fba","line":154,"range":{"start_line":154,"start_character":14,"end_line":154,"end_character":16},"updated":"2019-01-25 19:51:21.000000000","message":"38","commit_id":"89dd1323e4e155b50e4e64f0facf81e8b86e8a96"}]}
