)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds support for rebuilding instances that failed to be"},{"line_number":10,"context_line":"scheduled and were mapped to cell0. Specifically, the instance is"},{"line_number":11,"context_line":"hard deleted from the cell0 and then goes through scheduling again."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I9a1a14f604c5f369fdb671a6f71f124f06f2beab"},{"line_number":14,"context_line":"Implements: blueprint enable-rebuild-for-instances-in-cell0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9fdfeff1_ee2dc3ae","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":12},"updated":"2019-03-04 17:51:31.000000000","message":"I\u0027ve lost track of why we hard delete the instance record in cell0, can you explain that in the commit message?\n\nI don\u0027t understand the need for the hard delete because wouldn\u0027t we do something like this?\n\n1. create server - instance record is created in cell0 with id\u003d1 and instance mapping points at cell0\n\n2. rebuild server from cell0:\n- reschedule and create an instance record in cell1 with id\u003d1\n- update instance mapping to point at cell1\n- delete instance record in cell0 (not hard delete)\n\nWouldn\u0027t that essentially have the same effect? Or are you worried about some case like an admin listing deleted servers and seeing the same server show up from both cell0 and cell1?\n\nIf we had my instance.hidden stuff we could just mark the instance in cell0 as hidden:\n\nhttps://review.openstack.org/#/c/631123/","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"d5301c8e44aff2acf63c76d28aec4d449ef0a75c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds support for rebuilding instances that failed to be"},{"line_number":10,"context_line":"scheduled and were mapped to cell0. Specifically, the instance is"},{"line_number":11,"context_line":"hard deleted from the cell0 and then goes through scheduling again."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I9a1a14f604c5f369fdb671a6f71f124f06f2beab"},{"line_number":14,"context_line":"Implements: blueprint enable-rebuild-for-instances-in-cell0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5fc1f717_04f7a35b","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":12},"in_reply_to":"5fc1f717_0e6827b8","updated":"2019-04-03 12:20:27.000000000","message":"Cool I\u0027m all for it. I can restore the hard delete patch. It will make rebuilding from cell0 much more straight-forward too.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds support for rebuilding instances that failed to be"},{"line_number":10,"context_line":"scheduled and were mapped to cell0. Specifically, the instance is"},{"line_number":11,"context_line":"hard deleted from the cell0 and then goes through scheduling again."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I9a1a14f604c5f369fdb671a6f71f124f06f2beab"},{"line_number":14,"context_line":"Implements: blueprint enable-rebuild-for-instances-in-cell0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9fdfeff1_a0ea5ad5","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":12},"in_reply_to":"9fdfeff1_7170d474","updated":"2019-03-05 16:13:03.000000000","message":"Oh.. It was forgotten here.. After the concerns you expressed in https://review.openstack.org/#/c/570202/4, I changed the patch to use soft delete instead and I tried to handle the DBDuplicateEntry in bury_in_cell0.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"24d1fd190f0a8c8de2bb6342e65ca0197ddf3fd9","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds support for rebuilding instances that failed to be"},{"line_number":10,"context_line":"scheduled and were mapped to cell0. Specifically, the instance is"},{"line_number":11,"context_line":"hard deleted from the cell0 and then goes through scheduling again."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I9a1a14f604c5f369fdb671a6f71f124f06f2beab"},{"line_number":14,"context_line":"Implements: blueprint enable-rebuild-for-instances-in-cell0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5fc1f717_0e6827b8","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":12},"in_reply_to":"9fdfeff1_a0ea5ad5","updated":"2019-04-03 02:01:04.000000000","message":"Damn I might need that hard delete code after all, because in my cross-cell resize testing I just hit the same thing:\n\nhttps://review.openstack.org/#/c/627892/20/nova/conductor/tasks/cross_cell_migrate.py@141\n\ni.e. if you resize from cell1 to cell2 and confirm, we call instance.destroy() on the instance in cell1 so it\u0027s soft-deleted, but then if we resize back from cell2 to cell1 it fails creating the instances record in cell1 because of the unique constraint on the instances.uuid column.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"16bfbaef4afea7bfd83197335741c100e62cb636","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This adds support for rebuilding instances that failed to be"},{"line_number":10,"context_line":"scheduled and were mapped to cell0. Specifically, the instance is"},{"line_number":11,"context_line":"hard deleted from the cell0 and then goes through scheduling again."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I9a1a14f604c5f369fdb671a6f71f124f06f2beab"},{"line_number":14,"context_line":"Implements: blueprint enable-rebuild-for-instances-in-cell0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9fdfeff1_7170d474","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":12},"in_reply_to":"9fdfeff1_ee2dc3ae","updated":"2019-03-04 17:51:53.000000000","message":"Actually after going through the code I see you\u0027re not hard-deleting the instance now?","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"}],"nova/api/openstack/api_version_request.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":164,"context_line":"             os-migrations API."},{"line_number":165,"context_line":"    * 2.67 - Adds the optional ``volume_type`` field to the"},{"line_number":166,"context_line":"             ``block_device_mapping_v2`` parameter when creating a server."},{"line_number":167,"context_line":"    * 2.68 - Add support for rebuilding instances in mapped to cell0."},{"line_number":168,"context_line":"\"\"\""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"# The minimum and maximum versions of the API supported"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_ab87a2d7","line":167,"range":{"start_line":167,"start_character":50,"end_line":167,"end_character":52},"updated":"2019-01-04 21:24:11.000000000","message":"nix","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"}],"nova/api/openstack/compute/rest_api_version_history.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":913,"context_line":"----"},{"line_number":914,"context_line":""},{"line_number":915,"context_line":"Adds support for rebuilding instances buried in cell0. This means that"},{"line_number":916,"context_line":"instances which failed to be scheduled, can be successfully rebuilt without the"},{"line_number":917,"context_line":"API raising an ``InstanceInvalidState`` exception. The API affected by this"},{"line_number":918,"context_line":"change is:"},{"line_number":919,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"9fdfeff1_eebaa36f","line":916,"range":{"start_line":916,"start_character":38,"end_line":916,"end_character":39},"updated":"2019-03-04 17:51:31.000000000","message":"nix","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":913,"context_line":"----"},{"line_number":914,"context_line":""},{"line_number":915,"context_line":"Adds support for rebuilding instances buried in cell0. This means that"},{"line_number":916,"context_line":"instances which failed to be scheduled, can be successfully rebuilt without the"},{"line_number":917,"context_line":"API raising an ``InstanceInvalidState`` exception. The API affected by this"},{"line_number":918,"context_line":"change is:"},{"line_number":919,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"9fdfeff1_a0c33a57","line":916,"range":{"start_line":916,"start_character":38,"end_line":916,"end_character":39},"in_reply_to":"9fdfeff1_eebaa36f","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"bc4309ba963883987c472818debc7bae54bc2860","unresolved":false,"context_lines":[{"line_number":936,"context_line":""},{"line_number":937,"context_line":"Adds support for rebuilding instances buried in cell0. This means that"},{"line_number":938,"context_line":"instances which failed to be scheduled can be successfully rebuilt without the"},{"line_number":939,"context_line":"API raising an ``InstanceInvalidState`` exception. The API affected by this"},{"line_number":940,"context_line":"change is:"},{"line_number":941,"context_line":""},{"line_number":942,"context_line":"* ``POST /servers/{server_id}/action (rebuild)``"}],"source_content_type":"text/x-rst","patch_set":11,"id":"5fc1f717_e51e2c0b","line":939,"range":{"start_line":939,"start_character":15,"end_line":939,"end_character":49},"updated":"2019-03-07 13:30:29.000000000","message":"It should be \"409 error\".","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":955,"context_line":"                pass"},{"line_number":956,"context_line":""},{"line_number":957,"context_line":"        try:"},{"line_number":958,"context_line":"            if not CONF.cells.enable:"},{"line_number":959,"context_line":"                mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":960,"context_line":"                    context, instance.uuid)"},{"line_number":961,"context_line":"                # Restrict rebuild in cell0 only to requests after this"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_cb61c63b","line":958,"range":{"start_line":958,"start_character":12,"end_line":958,"end_character":37},"updated":"2019-01-04 21:24:11.000000000","message":"Why do we need this? We don\u0027t care about cells v1 for new features. Regardless, instances have mappings in cells v1 as well.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":956,"context_line":""},{"line_number":957,"context_line":"        try:"},{"line_number":958,"context_line":"            if not CONF.cells.enable:"},{"line_number":959,"context_line":"                mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":960,"context_line":"                    context, instance.uuid)"},{"line_number":961,"context_line":"                # Restrict rebuild in cell0 only to requests after this"},{"line_number":962,"context_line":"                # microversion. For all previous microversions the request"},{"line_number":963,"context_line":"                # fails with InstanceInvalidState."}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_0b4fcebd","line":960,"range":{"start_line":959,"start_character":16,"end_line":960,"end_character":43},"updated":"2019-01-04 21:24:11.000000000","message":"You could delay this until after the version check.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":967,"context_line":"                    raise exception.InstanceInvalidState("},{"line_number":968,"context_line":"                       attr\u003d\u0027cell_name\u0027,"},{"line_number":969,"context_line":"                       instance_uuid\u003dinstance.uuid,"},{"line_number":970,"context_line":"                       state\u003dinstance.cell_name,"},{"line_number":971,"context_line":"                       method\u003d\u0027_action_rebuild\u0027)"},{"line_number":972,"context_line":""},{"line_number":973,"context_line":"            instance \u003d self.compute_api.rebuild(context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_8bd09ecb","line":970,"range":{"start_line":970,"start_character":29,"end_line":970,"end_character":47},"updated":"2019-01-04 21:24:11.000000000","message":"This isn\u0027t set unless you\u0027re using cells v1. This would be \u0027cell0\u0027 I\u0027d think.\n\nAlternatively just don\u0027t try to shoe-horn this exception message and add something specific:\n\nraise exception.InstanceInvalidState(\n    _(\u0027Microversion 2.68 or greater is required to rebuild servers which failed to schedule.\u0027))\n\nThat\u0027s more user friendly and doesn\u0027t leak information about cells.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":968,"context_line":"                       attr\u003d\u0027cell_name\u0027,"},{"line_number":969,"context_line":"                       instance_uuid\u003dinstance.uuid,"},{"line_number":970,"context_line":"                       state\u003dinstance.cell_name,"},{"line_number":971,"context_line":"                       method\u003d\u0027_action_rebuild\u0027)"},{"line_number":972,"context_line":""},{"line_number":973,"context_line":"            instance \u003d self.compute_api.rebuild(context,"},{"line_number":974,"context_line":"                                                instance,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_0be4aeab","line":971,"range":{"start_line":971,"start_character":31,"end_line":971,"end_character":46},"updated":"2019-01-04 21:24:11.000000000","message":"Just \u0027rebuild\u0027.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"        # In case of rebuild from cell0, there is a race condition. The"},{"line_number":1007,"context_line":"        # instance that is being rebuilt, is actually hard deleted from the"},{"line_number":1008,"context_line":"        # cell0 DB, so the following _get_server fails with InstanceNotFound."},{"line_number":1009,"context_line":"        # To bypass this problem"},{"line_number":1010,"context_line":"        if not instance:"},{"line_number":1011,"context_line":"            instance \u003d self._get_server(context, req, id, is_detail\u003dTrue)"},{"line_number":1012,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_eb992a1f","line":1009,"range":{"start_line":1009,"start_character":10,"end_line":1009,"end_character":32},"updated":"2019-01-04 21:24:11.000000000","message":"...?","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"}],"nova/compute/api.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"8587a45affc2bbd56ff1fcc7bb3f60089a57e5b1","unresolved":false,"context_lines":[{"line_number":115,"context_line":"CELLS \u003d []"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def check_instance_state(vm_state\u003dNone, task_state\u003d(None,),"},{"line_number":119,"context_line":"                         must_have_launched\u003dTrue):"},{"line_number":120,"context_line":"    \"\"\"Decorator to check VM and/or task state before entry to API functions."},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    If the instance is in the wrong state, or has not been successfully"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f769fc5_9691eaf4","line":119,"range":{"start_line":118,"start_character":57,"end_line":119,"end_character":50},"updated":"2018-12-22 07:06:21.000000000","message":"could we just remove this? seems it was added to forbid rebuild an instance that are not able to boot initially:\nhttps://review.openstack.org/#/c/32145/\nsince you are now proposing to relax this limit, maybe we can get rid of it. Or do you want to control the behavior with microversion?","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":115,"context_line":"CELLS \u003d []"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"def check_instance_state(vm_state\u003dNone, task_state\u003d(None,),"},{"line_number":119,"context_line":"                         must_have_launched\u003dTrue):"},{"line_number":120,"context_line":"    \"\"\"Decorator to check VM and/or task state before entry to API functions."},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    If the instance is in the wrong state, or has not been successfully"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_eb7daae7","line":119,"range":{"start_line":118,"start_character":57,"end_line":119,"end_character":50},"in_reply_to":"1f769fc5_9691eaf4","updated":"2019-01-04 21:24:11.000000000","message":"It needs to be a new microversion so no this can\u0027t be removed and I would think a new parameter needs to be passed to check for cell0 in the case that it\u0027s (a) a rebuild and (b) using the new microversion. I guess the problem is you can\u0027t really pass a new variable to the decorator....which is why you\u0027re duplicating this check in the REST API controller code.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def outer(f):"},{"line_number":132,"context_line":"        @six.wraps(f)"},{"line_number":133,"context_line":"        def inner(self, context, instance, *args, **kw):"},{"line_number":134,"context_line":"            if vm_state is not None and instance.vm_state not in vm_state:"},{"line_number":135,"context_line":"                raise exception.InstanceInvalidState("},{"line_number":136,"context_line":"                    attr\u003d\u0027vm_state\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_2ba8921d","line":133,"range":{"start_line":133,"start_character":50,"end_line":133,"end_character":55},"updated":"2019-01-04 21:24:11.000000000","message":"Rather than mess with the cell0 check in the REST API controller code and make up for passing must_have_launched\u003dFalse from rebuild but still needing to check it for non-cell0 instances, couldn\u0027t the REST API controller code pass a new kwarg to the compute_api.rebuild method and you could check for that here? Something like:\n\nallow_rebuild_from_cell0 \u003d kw.get(\u0027allow_rebuild_from_cell0\u0027, False)\n\nAnd then under \"if must_have_launched and not instance.launched_at:\", you could do:\n\nif allow_rebuild_from_cell0 and not instane_mapping.is_cell0():\n   raise InstanceInvalidState(...)\n\nMeaning we could control that logic within the decorator per a special kwarg and then we don\u0027t need to duplicate the validation in two other places.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":3216,"context_line":"    @check_instance_cell"},{"line_number":3217,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.ACTIVE, vm_states.STOPPED,"},{"line_number":3218,"context_line":"                                    vm_states.ERROR],"},{"line_number":3219,"context_line":"                          must_have_launched\u003dFalse)"},{"line_number":3220,"context_line":"    def rebuild(self, context, instance, image_href, admin_password,"},{"line_number":3221,"context_line":"                files_to_inject\u003dNone, **kwargs):"},{"line_number":3222,"context_line":"        \"\"\"Rebuild the given instance with the provided attributes.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_4b8876c5","line":3219,"updated":"2019-01-04 21:24:11.000000000","message":"Should add a comment here about microversion 2.68.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":3230,"context_line":"                               context, [instance.uuid])"},{"line_number":3231,"context_line":"            if not inst_mapping.cell_mapping.is_cell0():"},{"line_number":3232,"context_line":"                # Continue to fail if the instance never has launched and is"},{"line_number":3233,"context_line":"                # in cell0."},{"line_number":3234,"context_line":"                raise exception.InstanceInvalidState("},{"line_number":3235,"context_line":"                    attr\u003d\u0027launched_at\u0027,"},{"line_number":3236,"context_line":"                    instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_8bb73e87","line":3233,"updated":"2019-01-04 21:24:11.000000000","message":"In this case the instance is not in cell0. This is making up for the fact that you\u0027re passing must_have_launched\u003dFalse above.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":3412,"context_line":"            # to them, we need to support the old way"},{"line_number":3413,"context_line":"            request_spec \u003d None"},{"line_number":3414,"context_line":""},{"line_number":3415,"context_line":"        if not instance.launched_at:"},{"line_number":3416,"context_line":""},{"line_number":3417,"context_line":"            if request_spec is None:"},{"line_number":3418,"context_line":"                # NOTE(ttsiouts): we should fail here. No way to know about"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_8b6c1e09","line":3415,"updated":"2019-01-04 21:24:11.000000000","message":"This rebuild() method is already huge (this would make it ~245 LOC), so can we move this into a new private method (_rebuild_from_cell0)?","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":3414,"context_line":""},{"line_number":3415,"context_line":"        if not instance.launched_at:"},{"line_number":3416,"context_line":""},{"line_number":3417,"context_line":"            if request_spec is None:"},{"line_number":3418,"context_line":"                # NOTE(ttsiouts): we should fail here. No way to know about"},{"line_number":3419,"context_line":"                # the RequestedNetworks"},{"line_number":3420,"context_line":"                raise exception.NovaException("},{"line_number":3421,"context_line":"                    _(\u0027Unable to rebuild an instance in cell0 without the \u0027"},{"line_number":3422,"context_line":"                      \u0027RequestSpec.\u0027))"},{"line_number":3423,"context_line":""},{"line_number":3424,"context_line":"            # Delete the instance from cell0"},{"line_number":3425,"context_line":"            self._remove_instance_from_cell(context, instance, bdms)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_4b7636db","line":3422,"range":{"start_line":3417,"start_character":0,"end_line":3422,"end_character":38},"updated":"2019-01-04 21:24:11.000000000","message":"Shouldn\u0027t need this anymore - rebase your change because we require RequestSpec now.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":3428,"context_line":"            instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3429,"context_line":"            instance.deleted \u003d False"},{"line_number":3430,"context_line":""},{"line_number":3431,"context_line":"            # Create a new build request for the instance"},{"line_number":3432,"context_line":"            build_request \u003d objects.BuildRequest(context,"},{"line_number":3433,"context_line":"                    instance\u003dinstance, instance_uuid\u003dinstance.uuid,"},{"line_number":3434,"context_line":"                    project_id\u003dinstance.project_id,"},{"line_number":3435,"context_line":"                    block_device_mappings\u003dbdms,"},{"line_number":3436,"context_line":"                    tags\u003dinstance.tags)"},{"line_number":3437,"context_line":"            build_request.create()"},{"line_number":3438,"context_line":""},{"line_number":3439,"context_line":"            # Fetch the requsested networks from the RequestSpec"},{"line_number":3440,"context_line":"            requested_networks \u003d request_spec.requested_networks"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_0b590e59","line":3437,"range":{"start_line":3431,"start_character":12,"end_line":3437,"end_character":34},"updated":"2019-01-04 21:24:11.000000000","message":"This needs to happen before we delete the instance in cell0, otherwise we have a window where the instance is not mapped to any cell, it\u0027s not in cell0, and there is no build request for it, so if someone were polling the API or listing servers the server could be gone for a short amount of time. The build request should come first because _get_instance will only use the build request if the instance mapping isn\u0027t mapped to a cell or the instance isn\u0027t found in a cell.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":3473,"context_line":"        inst_mapping.cell_mapping \u003d None"},{"line_number":3474,"context_line":"        inst_mapping.save()"},{"line_number":3475,"context_line":""},{"line_number":3476,"context_line":"        # Destroy instance\u0027s block device mappings"},{"line_number":3477,"context_line":"        for bdm in bdms:"},{"line_number":3478,"context_line":"            backup_device_name \u003d bdm.device_name"},{"line_number":3479,"context_line":"            bdm.destroy()"},{"line_number":3480,"context_line":"            bdm.deleted \u003d False"},{"line_number":3481,"context_line":"            bdm.device_name \u003d backup_device_name"},{"line_number":3482,"context_line":""},{"line_number":3483,"context_line":"        backup_tags \u003d instance.tags"},{"line_number":3484,"context_line":"        instance.destroy_hard()"},{"line_number":3485,"context_line":"        instance.tags \u003d backup_tags"},{"line_number":3486,"context_line":""},{"line_number":3487,"context_line":"    @staticmethod"},{"line_number":3488,"context_line":"    def _check_quota_for_upsize(context, instance, current_flavor, new_flavor):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_eb504a35","line":3485,"range":{"start_line":3476,"start_character":8,"end_line":3485,"end_character":35},"updated":"2019-01-04 21:24:11.000000000","message":"We shouldn\u0027t need to explicitly destroy bdms and tags because the DB API instance_destroy takes care of those for us.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"005d933fb87785b79ff362a998cd0b887c5caad8","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                # Check if this is the case here."},{"line_number":152,"context_line":"                allowed \u003d kw.pop(\u0027allow_rebuild_in_cell0\u0027, False)"},{"line_number":153,"context_line":"                if not (allowed and _rebuild_from_cell0_supported(context) and"},{"line_number":154,"context_line":"                                _is_instance_in_cell0(context, instance.uuid)):"},{"line_number":155,"context_line":"                    raise exception.InstanceInvalidState("},{"line_number":156,"context_line":"                        attr\u003d\u0027launched_at\u0027,"},{"line_number":157,"context_line":"                        instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_163cbac6","line":154,"updated":"2019-01-23 12:06:38.000000000","message":"This was done to prioritize the checks. Also the compatibility (version) check was added here instead of leaking cell information later during rebuild","commit_id":"0848f6df74fa44f16e3fa6cefaad5a8eb2493c6d"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"005d933fb87785b79ff362a998cd0b887c5caad8","unresolved":false,"context_lines":[{"line_number":3430,"context_line":"        # we try to create the instance and the bdms again. This is why we"},{"line_number":3431,"context_line":"        # \"clone\" the instance and the bdms (without id and deleted flag) to"},{"line_number":3432,"context_line":"        # create the build request before actually deleting the instance."},{"line_number":3433,"context_line":"        new_instance \u003d instance.obj_clone()"},{"line_number":3434,"context_line":"        del new_instance.id"},{"line_number":3435,"context_line":"        new_instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3436,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_f65ed610","line":3433,"updated":"2019-01-23 12:06:38.000000000","message":"If we persist the build_request using the same instance and before deleting it we cannot create it later after scheduling since it has an id. This is why the instance is cloned. The same applies to the bdms.","commit_id":"0848f6df74fa44f16e3fa6cefaad5a8eb2493c6d"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"005d933fb87785b79ff362a998cd0b887c5caad8","unresolved":false,"context_lines":[{"line_number":3483,"context_line":"        # NOTE(ttsiouts): Hmm, setting the cell_mapping of the instance_mapping"},{"line_number":3484,"context_line":"        # to None doesn\u0027t work because of InstanceMapping._update_with_cell_id,"},{"line_number":3485,"context_line":"        # which leads to an InstanceNotFound when the api controller tries to"},{"line_number":3486,"context_line":"        # get the instance. As a workaround return a reference to the instance."},{"line_number":3487,"context_line":"        return new_instance"},{"line_number":3488,"context_line":""},{"line_number":3489,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_5657a203","line":3486,"updated":"2019-01-23 12:06:38.000000000","message":"I tried to change InstanceMapping._update_with_cell_id to allow updating the InstanceMapping with a None cell_mapping but I had more problems. I\u0027m not sure why it was implemented this way.","commit_id":"0848f6df74fa44f16e3fa6cefaad5a8eb2493c6d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"933390ff897d097ec1e2062ec07940667f1b2199","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # This checks if minimum nova-compute service version across"},{"line_number":167,"context_line":"    # the deployment is new enough to support rebuilding instances"},{"line_number":168,"context_line":"    # burried in cell0"},{"line_number":169,"context_line":"    min_compute_version \u003d objects.service.get_minimum_version_all_cells("},{"line_number":170,"context_line":"        context, [\u0027nova-compute\u0027])"},{"line_number":171,"context_line":"    return min_compute_version \u003e\u003d MIN_COMPUTE_REBUILD_IN_CELL0"},{"line_number":172,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_06ced9b3","line":169,"updated":"2019-03-05 14:59:28.000000000","message":"See my comment in https://review.openstack.org/#/c/570203/9/nova/compute/manager.py but this is (1) wrong and (2) potentially avoidable.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":3411,"context_line":"        for bdm in bdms:"},{"line_number":3412,"context_line":"            new_bdm \u003d bdm.obj_clone()"},{"line_number":3413,"context_line":"            del new_bdm.id"},{"line_number":3414,"context_line":"            new_bdm.device_name \u003d bdm.device_name"},{"line_number":3415,"context_line":"            _bdms.append(new_bdm)"},{"line_number":3416,"context_line":""},{"line_number":3417,"context_line":"        new_bdms \u003d objects.BlockDeviceMappingList(objects\u003d_bdms)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_b11e3c5d","line":3414,"range":{"start_line":3414,"start_character":12,"end_line":3414,"end_character":49},"updated":"2019-03-04 17:51:31.000000000","message":"Why is this needed if we just cloned it?","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":3411,"context_line":"        for bdm in bdms:"},{"line_number":3412,"context_line":"            new_bdm \u003d bdm.obj_clone()"},{"line_number":3413,"context_line":"            del new_bdm.id"},{"line_number":3414,"context_line":"            new_bdm.device_name \u003d bdm.device_name"},{"line_number":3415,"context_line":"            _bdms.append(new_bdm)"},{"line_number":3416,"context_line":""},{"line_number":3417,"context_line":"        new_bdms \u003d objects.BlockDeviceMappingList(objects\u003d_bdms)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_d1fdee3b","line":3414,"range":{"start_line":3414,"start_character":12,"end_line":3414,"end_character":49},"in_reply_to":"9fdfeff1_b11e3c5d","updated":"2019-03-05 16:13:03.000000000","message":"It seems that \u0027device_name\u0027 is not returned by obj_get_changes and this leads to a KeyError here:\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L3769. I don\u0027t understand why this happens.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":3421,"context_line":"                instance\u003dnew_instance, instance_uuid\u003dnew_instance.uuid,"},{"line_number":3422,"context_line":"                project_id\u003dnew_instance.project_id,"},{"line_number":3423,"context_line":"                block_device_mappings\u003dnew_bdms,"},{"line_number":3424,"context_line":"                tags\u003dnew_instance.tags)"},{"line_number":3425,"context_line":"        build_request.create()"},{"line_number":3426,"context_line":""},{"line_number":3427,"context_line":"        # Delete the instance in cell0"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_f1492466","line":3424,"range":{"start_line":3424,"start_character":21,"end_line":3424,"end_character":38},"updated":"2019-03-04 17:51:31.000000000","message":"Hmm, does this work? I\u0027ve had some issues with recreating records in another cell like this in the cross-cell resize series:\n\nhttps://review.openstack.org/#/c/627892/\n\nIt would be good to modify your functional test to create the server with tags and make sure that on rebuild from error the tags are still present (in the API) from the server.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":3421,"context_line":"                instance\u003dnew_instance, instance_uuid\u003dnew_instance.uuid,"},{"line_number":3422,"context_line":"                project_id\u003dnew_instance.project_id,"},{"line_number":3423,"context_line":"                block_device_mappings\u003dnew_bdms,"},{"line_number":3424,"context_line":"                tags\u003dnew_instance.tags)"},{"line_number":3425,"context_line":"        build_request.create()"},{"line_number":3426,"context_line":""},{"line_number":3427,"context_line":"        # Delete the instance in cell0"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_6c60e9d0","line":3424,"range":{"start_line":3424,"start_character":21,"end_line":3424,"end_character":38},"in_reply_to":"9fdfeff1_f1492466","updated":"2019-03-05 16:13:03.000000000","message":"I added tags in the post request in the functional tests. Looks it\u0027s working properly","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":3424,"context_line":"                tags\u003dnew_instance.tags)"},{"line_number":3425,"context_line":"        build_request.create()"},{"line_number":3426,"context_line":""},{"line_number":3427,"context_line":"        # Delete the instance in cell0"},{"line_number":3428,"context_line":"        instance.destroy()"},{"line_number":3429,"context_line":""},{"line_number":3430,"context_line":"        # Fetch the requested networks from the RequestSpec and then"},{"line_number":3431,"context_line":"        # delete the attribute."}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_1178688d","line":3428,"range":{"start_line":3427,"start_character":8,"end_line":3428,"end_character":26},"updated":"2019-03-04 17:51:31.000000000","message":"Would be good to note that we need to do this *after* creating the build request otherwise there could be a window of time where the instance is not returned from GET /servers results.\n\nYou could also note that this means there is a window of time where a GET /servers request could pull both a BuildRequest and instance from cell0 in get_all(), however, duplicates will be filtered out so only one copy of the instance record would be returned from the API.\n\n--\n\nAlso, I guess you\u0027re *not* hard deleting the instance now?","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":3424,"context_line":"                tags\u003dnew_instance.tags)"},{"line_number":3425,"context_line":"        build_request.create()"},{"line_number":3426,"context_line":""},{"line_number":3427,"context_line":"        # Delete the instance in cell0"},{"line_number":3428,"context_line":"        instance.destroy()"},{"line_number":3429,"context_line":""},{"line_number":3430,"context_line":"        # Fetch the requested networks from the RequestSpec and then"},{"line_number":3431,"context_line":"        # delete the attribute."}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_c03bde36","line":3428,"range":{"start_line":3427,"start_character":8,"end_line":3428,"end_character":26},"in_reply_to":"9fdfeff1_1178688d","updated":"2019-03-05 16:13:03.000000000","message":"\u003e Would be good to note that we need to do this *after* creating the\n \u003e build request otherwise there could be a window of time where the\n \u003e instance is not returned from GET /servers results.\n \u003e \n \u003e You could also note that this means there is a window of time where\n \u003e a GET /servers request could pull both a BuildRequest and instance\n \u003e from cell0 in get_all(), however, duplicates will be filtered out\n \u003e so only one copy of the instance record would be returned from the\n \u003e API.\n \nDone.\n \n \u003e Also, I guess you\u0027re *not* hard deleting the instance now?\n\nYes. A soft-delete is enough as long as we handle the DBDuplicateEntry that could be raised when burying in cell0 in case we fail to schedule an instance that is already buried there.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"a2ab9e620dd2f10f4de97bfe42ee9f6a884650fa","unresolved":false,"context_lines":[{"line_number":145,"context_line":"                    state\u003dinstance.task_state,"},{"line_number":146,"context_line":"                    method\u003df.__name__)"},{"line_number":147,"context_line":"            if must_have_launched and not instance.launched_at:"},{"line_number":148,"context_line":"                # From microversion 2.73 and above, we allow rebuilding"},{"line_number":149,"context_line":"                # instances burried in cell0 that were never launched."},{"line_number":150,"context_line":"                # Check if this is the case here."},{"line_number":151,"context_line":"                allowed \u003d kw.pop(\u0027allow_rebuild_in_cell0\u0027, False)"},{"line_number":152,"context_line":"                if not (allowed and _is_instance_in_cell0(context,"},{"line_number":153,"context_line":"                                                          instance.uuid)):"},{"line_number":154,"context_line":"                    raise exception.InstanceInvalidState("},{"line_number":155,"context_line":"                        attr\u003d\u0027launched_at\u0027,"},{"line_number":156,"context_line":"                        instance_uuid\u003dinstance.uuid,"},{"line_number":157,"context_line":"                        state\u003dinstance.launched_at,"},{"line_number":158,"context_line":"                        method\u003df.__name__)"},{"line_number":159,"context_line":"            return f(self, context, instance, *args, **kw)"},{"line_number":160,"context_line":"        return inner"},{"line_number":161,"context_line":"    return outer"}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_6421e34d","line":158,"range":{"start_line":148,"start_character":16,"end_line":158,"end_character":42},"updated":"2019-03-07 10:12:03.000000000","message":"why not just make ``must_have_launched`` equal to false if version\u003e2.73? seems doing the same thing, or do we have other cases that will lead to instance.launched_at is not set? seems I cannot think of any. Or is it just impossible to make ``must_have_launched`` change according to version?","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"62e362da514c6f7016b9fce9451f6176a321587e","unresolved":false,"context_lines":[{"line_number":145,"context_line":"                    state\u003dinstance.task_state,"},{"line_number":146,"context_line":"                    method\u003df.__name__)"},{"line_number":147,"context_line":"            if must_have_launched and not instance.launched_at:"},{"line_number":148,"context_line":"                # From microversion 2.73 and above, we allow rebuilding"},{"line_number":149,"context_line":"                # instances burried in cell0 that were never launched."},{"line_number":150,"context_line":"                # Check if this is the case here."},{"line_number":151,"context_line":"                allowed \u003d kw.pop(\u0027allow_rebuild_in_cell0\u0027, False)"},{"line_number":152,"context_line":"                if not (allowed and _is_instance_in_cell0(context,"},{"line_number":153,"context_line":"                                                          instance.uuid)):"},{"line_number":154,"context_line":"                    raise exception.InstanceInvalidState("},{"line_number":155,"context_line":"                        attr\u003d\u0027launched_at\u0027,"},{"line_number":156,"context_line":"                        instance_uuid\u003dinstance.uuid,"},{"line_number":157,"context_line":"                        state\u003dinstance.launched_at,"},{"line_number":158,"context_line":"                        method\u003df.__name__)"},{"line_number":159,"context_line":"            return f(self, context, instance, *args, **kw)"},{"line_number":160,"context_line":"        return inner"},{"line_number":161,"context_line":"    return outer"}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_3fbe8565","line":158,"range":{"start_line":148,"start_character":16,"end_line":158,"end_character":42},"in_reply_to":"5fc1f717_6421e34d","updated":"2019-03-07 12:08:58.000000000","message":"This shouldn\u0027t be done per microversion. The microversion just gives us the hint that rebuilding from cell0 is allowed. Then we have to make sure that the instance is in cell0 to proceed.","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"97c6a342871875c77614b853383a23fd6d21ab22","unresolved":false,"context_lines":[{"line_number":3476,"context_line":"            # prepared during the initial boot for the instance. If"},{"line_number":3477,"context_line":"            # we create a new one without unreserving the volume in"},{"line_number":3478,"context_line":"            # between, cinder will leave the volume reserved after deleting"},{"line_number":3479,"context_line":"            # the instance."},{"line_number":3480,"context_line":"            _bdms.append(new_bdm)"},{"line_number":3481,"context_line":""},{"line_number":3482,"context_line":"        new_bdms \u003d objects.BlockDeviceMappingList(objects\u003d_bdms)"}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_736f7dc5","line":3479,"updated":"2019-03-06 17:24:09.000000000","message":"When the instance goes in cell0 the, volume remains as reserved. So we shouldn\u0027t change the attachment_id in the BDM.","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"fce64f325eb338c1a8e8146f7a9ae377941af75c","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"        new_instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3465,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"},{"line_number":3466,"context_line":""},{"line_number":3467,"context_line":"        _bdms \u003d []"},{"line_number":3468,"context_line":"        for bdm in bdms:"},{"line_number":3469,"context_line":"            new_bdm \u003d objects.BlockDeviceMapping()"},{"line_number":3470,"context_line":"            for field in bdm.fields:"},{"line_number":3471,"context_line":"                if field in [\u0027id\u0027, \u0027uuid\u0027, \u0027instance\u0027, \u0027created_at\u0027]:"},{"line_number":3472,"context_line":"                    continue"},{"line_number":3473,"context_line":"                value \u003d getattr(bdm, field)"},{"line_number":3474,"context_line":"                setattr(new_bdm, field, value)"},{"line_number":3475,"context_line":"            # Here we are re-using the attachment that was already"},{"line_number":3476,"context_line":"            # prepared during the initial boot for the instance. If"},{"line_number":3477,"context_line":"            # we create a new one without unreserving the volume in"},{"line_number":3478,"context_line":"            # between, cinder will leave the volume reserved after deleting"},{"line_number":3479,"context_line":"            # the instance."},{"line_number":3480,"context_line":"            _bdms.append(new_bdm)"},{"line_number":3481,"context_line":""},{"line_number":3482,"context_line":"        new_bdms \u003d objects.BlockDeviceMappingList(objects\u003d_bdms)"},{"line_number":3483,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_24f3dba0","line":3480,"range":{"start_line":3467,"start_character":8,"end_line":3480,"end_character":33},"updated":"2019-03-07 10:19:12.000000000","message":"should you delete the bdms in cell0?","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"62e362da514c6f7016b9fce9451f6176a321587e","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"        new_instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3465,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"},{"line_number":3466,"context_line":""},{"line_number":3467,"context_line":"        _bdms \u003d []"},{"line_number":3468,"context_line":"        for bdm in bdms:"},{"line_number":3469,"context_line":"            new_bdm \u003d objects.BlockDeviceMapping()"},{"line_number":3470,"context_line":"            for field in bdm.fields:"},{"line_number":3471,"context_line":"                if field in [\u0027id\u0027, \u0027uuid\u0027, \u0027instance\u0027, \u0027created_at\u0027]:"},{"line_number":3472,"context_line":"                    continue"},{"line_number":3473,"context_line":"                value \u003d getattr(bdm, field)"},{"line_number":3474,"context_line":"                setattr(new_bdm, field, value)"},{"line_number":3475,"context_line":"            # Here we are re-using the attachment that was already"},{"line_number":3476,"context_line":"            # prepared during the initial boot for the instance. If"},{"line_number":3477,"context_line":"            # we create a new one without unreserving the volume in"},{"line_number":3478,"context_line":"            # between, cinder will leave the volume reserved after deleting"},{"line_number":3479,"context_line":"            # the instance."},{"line_number":3480,"context_line":"            _bdms.append(new_bdm)"},{"line_number":3481,"context_line":""},{"line_number":3482,"context_line":"        new_bdms \u003d objects.BlockDeviceMappingList(objects\u003d_bdms)"},{"line_number":3483,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_5fccb134","line":3480,"range":{"start_line":3467,"start_character":8,"end_line":3480,"end_character":33},"in_reply_to":"5fc1f717_24f3dba0","updated":"2019-03-07 12:08:58.000000000","message":"instance.destroy() called in L3498 takes care of that: https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L1818","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"97c6a342871875c77614b853383a23fd6d21ab22","unresolved":false,"context_lines":[{"line_number":3496,"context_line":"        # from cell0 in get_all(). However duplicates will be filtered out so"},{"line_number":3497,"context_line":"        # only one copy of the instance record will be returned."},{"line_number":3498,"context_line":"        instance.destroy()"},{"line_number":3499,"context_line":""},{"line_number":3500,"context_line":"        # Fetch the requested networks from the RequestSpec and then"},{"line_number":3501,"context_line":"        # delete the attribute."},{"line_number":3502,"context_line":"        requested_networks \u003d request_spec.requested_networks"}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_1332b9f2","line":3499,"updated":"2019-03-06 17:24:09.000000000","message":"The instance_mapping should be updated with None as cell_id but this cannot be done because of this: https://github.com/openstack/nova/blob/master/nova/objects/instance_mapping.py#L52","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3977f508d6ec920a83ee24498d5146f8ec97b7ef","unresolved":false,"context_lines":[{"line_number":3480,"context_line":"        # create the build request before actually deleting the instance."},{"line_number":3481,"context_line":"        new_instance \u003d instance.obj_clone()"},{"line_number":3482,"context_line":"        del new_instance.id"},{"line_number":3483,"context_line":"        new_instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3484,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"},{"line_number":3485,"context_line":""},{"line_number":3486,"context_line":"        _bdms \u003d []"}],"source_content_type":"text/x-python","patch_set":12,"id":"5fc1f717_4a00f666","line":3483,"updated":"2019-04-08 18:16:01.000000000","message":"This could just be:\n\nnew_instance.task_state \u003d task_states.REBUILDING","commit_id":"be4b481d43fed49da95fa6aee5cf59b646cbcfd8"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"e543791ee96cb15719aeaadfaaa084cf3e3f4736","unresolved":false,"context_lines":[{"line_number":3480,"context_line":"        # create the build request before actually deleting the instance."},{"line_number":3481,"context_line":"        new_instance \u003d instance.obj_clone()"},{"line_number":3482,"context_line":"        del new_instance.id"},{"line_number":3483,"context_line":"        new_instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3484,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"},{"line_number":3485,"context_line":""},{"line_number":3486,"context_line":"        _bdms \u003d []"}],"source_content_type":"text/x-python","patch_set":12,"id":"5fc1f717_99f4fa5c","line":3483,"in_reply_to":"5fc1f717_4a00f666","updated":"2019-04-09 21:40:00.000000000","message":"Done","commit_id":"be4b481d43fed49da95fa6aee5cf59b646cbcfd8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3977f508d6ec920a83ee24498d5146f8ec97b7ef","unresolved":false,"context_lines":[{"line_number":3481,"context_line":"        new_instance \u003d instance.obj_clone()"},{"line_number":3482,"context_line":"        del new_instance.id"},{"line_number":3483,"context_line":"        new_instance.update({\u0027task_state\u0027: task_states.REBUILDING})"},{"line_number":3484,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"},{"line_number":3485,"context_line":""},{"line_number":3486,"context_line":"        _bdms \u003d []"},{"line_number":3487,"context_line":"        for bdm in bdms:"}],"source_content_type":"text/x-python","patch_set":12,"id":"5fc1f717_2a09ea82","line":3484,"updated":"2019-04-08 18:16:01.000000000","message":"Why are trusted_certs copied back like this? IOW why aren\u0027t they part of the clone above? I\u0027m guessing maybe they aren\u0027t copied if the trusted_certs field wasn\u0027t loaded on instance yet? If so, we could maybe have other fields like that couldn\u0027t we? I\u0027ve tried testing for something like that here:\n\nhttps://review.openstack.org/#/c/627892/22/nova/tests/unit/conductor/tasks/test_cross_cell_migrate.py@188","commit_id":"be4b481d43fed49da95fa6aee5cf59b646cbcfd8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a6a266ff5a47c55f416a61d3e9f75f9955fb96c0","unresolved":false,"context_lines":[{"line_number":3472,"context_line":"                kwargs\u003dkwargs)"},{"line_number":3473,"context_line":""},{"line_number":3474,"context_line":"    def _rebuild_from_cell0(self, context, instance, bdms, image,"},{"line_number":3475,"context_line":"                            admin_password, request_spec, files_to_inject):"},{"line_number":3476,"context_line":"        # NOTE(ttsiouts): The problem here is that, if we persist the build"},{"line_number":3477,"context_line":"        # request before deleting the instance we have problems later when"},{"line_number":3478,"context_line":"        # we try to create the instance and the bdms again. This is why we"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fce034c_f27319b0","line":3475,"range":{"start_line":3475,"start_character":58,"end_line":3475,"end_character":73},"updated":"2019-04-16 21:50:50.000000000","message":"I don\u0027t think this will ever be not None because personality files were deprecated and removed from the rebuild API in 2.57 and to get this new code you have to use a newer microversion than that.","commit_id":"2f77bdbd17537f1801800d3ae90e3bade1da2259"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a6a266ff5a47c55f416a61d3e9f75f9955fb96c0","unresolved":false,"context_lines":[{"line_number":3484,"context_line":""},{"line_number":3485,"context_line":"        # FIXME(ttsiouts): Find the remaining fields that need to be copied"},{"line_number":3486,"context_line":"        # over to the new_instance."},{"line_number":3487,"context_line":"        new_instance.trusted_certs \u003d instance.trusted_certs"},{"line_number":3488,"context_line":""},{"line_number":3489,"context_line":"        _bdms \u003d []"},{"line_number":3490,"context_line":"        for bdm in bdms:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fce034c_725f290e","line":3487,"updated":"2019-04-16 21:50:50.000000000","message":"Hmm, we updated the instance.trusted_certs field in the rebuild_instance method if it changed, so wouldn\u0027t it already be set here in new_instance because of obj_clone?\n\nSimilar with instance.key_name/keypairs.","commit_id":"2f77bdbd17537f1801800d3ae90e3bade1da2259"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"28d1e3afe92517cc8b61ce02a48dd128842e9e51","unresolved":false,"context_lines":[{"line_number":3527,"context_line":"        # Call conductor to rebuild in cell0"},{"line_number":3528,"context_line":"        self.compute_task_api.rebuild_instance_in_cell0("},{"line_number":3529,"context_line":"            context,"},{"line_number":3530,"context_line":"            build_request\u003dbuild_request,"},{"line_number":3531,"context_line":"            request_spec\u003d[request_spec],"},{"line_number":3532,"context_line":"            image\u003dimage,"},{"line_number":3533,"context_line":"            admin_password\u003dadmin_password,"},{"line_number":3534,"context_line":"            injected_files\u003dfiles_to_inject,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fce034c_5d500333","line":3531,"range":{"start_line":3530,"start_character":12,"end_line":3531,"end_character":40},"updated":"2019-04-16 20:29:42.000000000","message":"This is weird, why do we pass a single build_request just to turn it into a list in conductor but then pass a list of a single request spec - can\u0027t we just call schedule_and_build_instances directly like conductor is doing?","commit_id":"2f77bdbd17537f1801800d3ae90e3bade1da2259"}],"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":1916,"context_line":"            instance.vm_state \u003d vm_states.BUILDING"},{"line_number":1917,"context_line":"            instance.task_state \u003d None"},{"line_number":1918,"context_line":"            instance.save(expected_task_state\u003d"},{"line_number":1919,"context_line":"                    (task_states.SCHEDULING, None, task_states.REBUILDING))"},{"line_number":1920,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1921,"context_line":"            msg \u003d \u0027Instance disappeared before build.\u0027"},{"line_number":1922,"context_line":"            LOG.debug(msg, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_0b07ce1e","line":1919,"updated":"2019-01-04 21:24:11.000000000","message":"Should probably have a comment here - also note that this means this likely won\u0027t work if the scheduler picks an older compute host that doesn\u0027t have this code. We could add a service version check for that in the API to avoid trying to reschedule from cell0 while there are old computes, like this:\n\nhttps://github.com/openstack/nova/blob/8ef3d253a086e4f8575f5221d4515cda421abea2/nova/compute/api.py#L1379\n\nOtherwise you\u0027re going to hit UnexpectedTaskStateError here for old computes and the build will fail (see below).","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":1937,"context_line":"            instance.vm_state \u003d vm_states.BUILDING"},{"line_number":1938,"context_line":"            instance.task_state \u003d None"},{"line_number":1939,"context_line":"            # task_state.REBUILDING is added to the expected task states,"},{"line_number":1940,"context_line":"            # because instances burried in cell0 can be rebuilt and they"},{"line_number":1941,"context_line":"            # will arrive here in this task state. The rebuild procedure,"},{"line_number":1942,"context_line":"            # for instances burried in cell0, consists of these steps:"},{"line_number":1943,"context_line":"            # * delete from cell0"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_d17180aa","line":1940,"range":{"start_line":1940,"start_character":32,"end_line":1940,"end_character":39},"updated":"2019-03-04 17:51:31.000000000","message":"buried","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":1937,"context_line":"            instance.vm_state \u003d vm_states.BUILDING"},{"line_number":1938,"context_line":"            instance.task_state \u003d None"},{"line_number":1939,"context_line":"            # task_state.REBUILDING is added to the expected task states,"},{"line_number":1940,"context_line":"            # because instances burried in cell0 can be rebuilt and they"},{"line_number":1941,"context_line":"            # will arrive here in this task state. The rebuild procedure,"},{"line_number":1942,"context_line":"            # for instances burried in cell0, consists of these steps:"},{"line_number":1943,"context_line":"            # * delete from cell0"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_2010aaa8","line":1940,"range":{"start_line":1940,"start_character":32,"end_line":1940,"end_character":39},"in_reply_to":"9fdfeff1_d17180aa","updated":"2019-03-05 16:13:03.000000000","message":"Removed the whole comment... See the comment below","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"933390ff897d097ec1e2062ec07940667f1b2199","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            # * delete from cell0"},{"line_number":1944,"context_line":"            # * go through build procedure as if they were new instances"},{"line_number":1945,"context_line":"            instance.save(expected_task_state\u003d"},{"line_number":1946,"context_line":"                    (task_states.SCHEDULING, None, task_states.REBUILDING))"},{"line_number":1947,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1948,"context_line":"            msg \u003d \u0027Instance disappeared before build.\u0027"},{"line_number":1949,"context_line":"            LOG.debug(msg, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_66e32536","line":1946,"updated":"2019-03-05 14:59:28.000000000","message":"This is pretty gross and also means you have that compute service minimum version check in the API (which is actually wrong btw because the version you\u0027re using doesn\u0027t have this change technically). Can\u0027t you just change the task_state on the instance prior to RPC casting from conductor to compute if we\u0027re rebuilding from cell0?","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            # * delete from cell0"},{"line_number":1944,"context_line":"            # * go through build procedure as if they were new instances"},{"line_number":1945,"context_line":"            instance.save(expected_task_state\u003d"},{"line_number":1946,"context_line":"                    (task_states.SCHEDULING, None, task_states.REBUILDING))"},{"line_number":1947,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1948,"context_line":"            msg \u003d \u0027Instance disappeared before build.\u0027"},{"line_number":1949,"context_line":"            LOG.debug(msg, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_498cf234","line":1946,"in_reply_to":"9fdfeff1_66e32536","updated":"2019-03-05 16:13:03.000000000","message":"Yes you\u0027re right. changing it in conductor","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"}],"nova/conductor/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ec33ccc374f7af55c726f6c0096e7aef4a8b1ebf","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                host\u003dhost,"},{"line_number":160,"context_line":"                request_spec\u003drequest_spec)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def rebuild_instance_in_cell0(self, context, build_requests,"},{"line_number":163,"context_line":"                                  request_spec, image,"},{"line_number":164,"context_line":"                                  admin_password, injected_files,"},{"line_number":165,"context_line":"                                  requested_networks, block_device_mapping,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffd0ebdf_ae0d7038","line":162,"range":{"start_line":162,"start_character":49,"end_line":162,"end_character":63},"updated":"2019-01-04 21:24:11.000000000","message":"Does this need to be plural? It\u0027s confusing since you can only have one here, so I\u0027d make this singular for clarity.","commit_id":"2873b0ec5f93174ad459e1a7c14bb9da65dfdc6f"}],"nova/conductor/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        given instance in the targeted cell\u0027s database and returns a reference"},{"line_number":1330,"context_line":"        of the restored instance."},{"line_number":1331,"context_line":"        \"\"\""},{"line_number":1332,"context_line":"        context.read_deleted \u003d \u0027yes\u0027"},{"line_number":1333,"context_line":"        # Restore the deleted Instance Mapping in the API database"},{"line_number":1334,"context_line":"        inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":1335,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_91a8d8d9","line":1332,"range":{"start_line":1332,"start_character":8,"end_line":1332,"end_character":36},"updated":"2019-03-04 17:51:31.000000000","message":"Ew, rather than modify this and restore it later, you could use the utils.temporary_mutation method or clone the context and set read_deleted using context.get_admin_context(read_deleted\u003d\u0027yes\u0027).","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        given instance in the targeted cell\u0027s database and returns a reference"},{"line_number":1330,"context_line":"        of the restored instance."},{"line_number":1331,"context_line":"        \"\"\""},{"line_number":1332,"context_line":"        context.read_deleted \u003d \u0027yes\u0027"},{"line_number":1333,"context_line":"        # Restore the deleted Instance Mapping in the API database"},{"line_number":1334,"context_line":"        inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":1335,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_eceff91a","line":1332,"range":{"start_line":1332,"start_character":8,"end_line":1332,"end_character":36},"in_reply_to":"9fdfeff1_91a8d8d9","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"        # Restore the deleted Instance Mapping in the API database"},{"line_number":1334,"context_line":"        inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":1335,"context_line":"            context, instance.uuid)"},{"line_number":1336,"context_line":"        inst_mapping.deleted \u003d False"},{"line_number":1337,"context_line":"        inst_mapping.save()"},{"line_number":1338,"context_line":""},{"line_number":1339,"context_line":"        old_instance \u003d objects.Instance.get_by_uuid(context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_515d9013","line":1336,"range":{"start_line":1336,"start_character":8,"end_line":1336,"end_character":36},"updated":"2019-03-04 17:51:31.000000000","message":"This doesn\u0027t exist - InstanceMappings are not soft-deletable; once they are deleted, they are gone - and they are only deleted on db archive/purge. If the InstanceMapping were gone, you\u0027d get InstanceMappingNotFound when getting it above.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"        # Restore the deleted Instance Mapping in the API database"},{"line_number":1334,"context_line":"        inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":1335,"context_line":"            context, instance.uuid)"},{"line_number":1336,"context_line":"        inst_mapping.deleted \u003d False"},{"line_number":1337,"context_line":"        inst_mapping.save()"},{"line_number":1338,"context_line":""},{"line_number":1339,"context_line":"        old_instance \u003d objects.Instance.get_by_uuid(context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_ccd6b554","line":1336,"range":{"start_line":1336,"start_character":8,"end_line":1336,"end_character":36},"in_reply_to":"9fdfeff1_515d9013","updated":"2019-03-05 16:13:03.000000000","message":"You are right! Removed","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c7e2dec09ab214219674fe3451f87aff77e29c02","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        changed_fields \u003d instance.obj_what_changed()"},{"line_number":1341,"context_line":"        for changed_field in changed_fields:"},{"line_number":1342,"context_line":"            old_instance[changed_field] \u003d instance[changed_field]"},{"line_number":1343,"context_line":"        old_instance.deleted \u003d False"},{"line_number":1344,"context_line":"        old_instance.save()"},{"line_number":1345,"context_line":"        # Not sure how to handle this here. Should we somehow restore what we"},{"line_number":1346,"context_line":"        # soft-deleted in the API level?:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_b124fc61","line":1343,"updated":"2019-03-04 17:56:40.000000000","message":"There is also the deleted_at and terminated_at fields to handle.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        changed_fields \u003d instance.obj_what_changed()"},{"line_number":1341,"context_line":"        for changed_field in changed_fields:"},{"line_number":1342,"context_line":"            old_instance[changed_field] \u003d instance[changed_field]"},{"line_number":1343,"context_line":"        old_instance.deleted \u003d False"},{"line_number":1344,"context_line":"        old_instance.save()"},{"line_number":1345,"context_line":"        # Not sure how to handle this here. Should we somehow restore what we"},{"line_number":1346,"context_line":"        # soft-deleted in the API level?:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_8cb98d16","line":1343,"in_reply_to":"9fdfeff1_b124fc61","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":1336,"context_line":"        inst_mapping.deleted \u003d False"},{"line_number":1337,"context_line":"        inst_mapping.save()"},{"line_number":1338,"context_line":""},{"line_number":1339,"context_line":"        old_instance \u003d objects.Instance.get_by_uuid(context, instance.uuid)"},{"line_number":1340,"context_line":"        changed_fields \u003d instance.obj_what_changed()"},{"line_number":1341,"context_line":"        for changed_field in changed_fields:"},{"line_number":1342,"context_line":"            old_instance[changed_field] \u003d instance[changed_field]"},{"line_number":1343,"context_line":"        old_instance.deleted \u003d False"},{"line_number":1344,"context_line":"        old_instance.save()"},{"line_number":1345,"context_line":"        # Not sure how to handle this here. Should we somehow restore what we"},{"line_number":1346,"context_line":"        # soft-deleted in the API level?:"},{"line_number":1347,"context_line":"        # - models.SecurityGroupInstanceAssociation"},{"line_number":1348,"context_line":"        # - models.InstanceMetadata"},{"line_number":1349,"context_line":"        # - models.InstanceExtra"},{"line_number":1350,"context_line":"        # - models.InstanceSystemMetadata"},{"line_number":1351,"context_line":"        # - models.Migration"},{"line_number":1352,"context_line":"        # - models.InstanceInfoCache"},{"line_number":1353,"context_line":"        # No need to do something for BDMs and Tags since they are going to be"},{"line_number":1354,"context_line":"        # created in _bury_in_cell0."},{"line_number":1355,"context_line":"        context.read_deleted \u003d \u0027no\u0027"},{"line_number":1356,"context_line":""},{"line_number":1357,"context_line":"        return old_instance"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_31b56c33","line":1354,"range":{"start_line":1339,"start_character":8,"end_line":1354,"end_character":36},"updated":"2019-03-04 17:51:31.000000000","message":"Yeah see this is all the same stuff I\u0027ve had to deal with in https://review.openstack.org/#/c/627892/ - you could also be missing stuff like pci_requests and numa_topology...","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c7e2dec09ab214219674fe3451f87aff77e29c02","unresolved":false,"context_lines":[{"line_number":1336,"context_line":"        inst_mapping.deleted \u003d False"},{"line_number":1337,"context_line":"        inst_mapping.save()"},{"line_number":1338,"context_line":""},{"line_number":1339,"context_line":"        old_instance \u003d objects.Instance.get_by_uuid(context, instance.uuid)"},{"line_number":1340,"context_line":"        changed_fields \u003d instance.obj_what_changed()"},{"line_number":1341,"context_line":"        for changed_field in changed_fields:"},{"line_number":1342,"context_line":"            old_instance[changed_field] \u003d instance[changed_field]"},{"line_number":1343,"context_line":"        old_instance.deleted \u003d False"},{"line_number":1344,"context_line":"        old_instance.save()"},{"line_number":1345,"context_line":"        # Not sure how to handle this here. Should we somehow restore what we"},{"line_number":1346,"context_line":"        # soft-deleted in the API level?:"},{"line_number":1347,"context_line":"        # - models.SecurityGroupInstanceAssociation"},{"line_number":1348,"context_line":"        # - models.InstanceMetadata"},{"line_number":1349,"context_line":"        # - models.InstanceExtra"},{"line_number":1350,"context_line":"        # - models.InstanceSystemMetadata"},{"line_number":1351,"context_line":"        # - models.Migration"},{"line_number":1352,"context_line":"        # - models.InstanceInfoCache"},{"line_number":1353,"context_line":"        # No need to do something for BDMs and Tags since they are going to be"},{"line_number":1354,"context_line":"        # created in _bury_in_cell0."},{"line_number":1355,"context_line":"        context.read_deleted \u003d \u0027no\u0027"},{"line_number":1356,"context_line":""},{"line_number":1357,"context_line":"        return old_instance"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_711e940e","line":1354,"range":{"start_line":1339,"start_character":8,"end_line":1354,"end_character":36},"in_reply_to":"9fdfeff1_31b56c33","updated":"2019-03-04 17:56:40.000000000","message":"Oh by the way, tags are not soft-deletable, so when you delete the server in the API the tags are going to be gone:\n\nhttps://github.com/openstack/nova/blob/c7db20d140eb0d3ccf0fd107eda7e80275bdd7d4/nova/db/sqlalchemy/api.py#L1826\n\nAnd the tags used to create the server are not in the RequestSpec either, so it seems you have the same problem as preserving the original requested networks.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":1336,"context_line":"        inst_mapping.deleted \u003d False"},{"line_number":1337,"context_line":"        inst_mapping.save()"},{"line_number":1338,"context_line":""},{"line_number":1339,"context_line":"        old_instance \u003d objects.Instance.get_by_uuid(context, instance.uuid)"},{"line_number":1340,"context_line":"        changed_fields \u003d instance.obj_what_changed()"},{"line_number":1341,"context_line":"        for changed_field in changed_fields:"},{"line_number":1342,"context_line":"            old_instance[changed_field] \u003d instance[changed_field]"},{"line_number":1343,"context_line":"        old_instance.deleted \u003d False"},{"line_number":1344,"context_line":"        old_instance.save()"},{"line_number":1345,"context_line":"        # Not sure how to handle this here. Should we somehow restore what we"},{"line_number":1346,"context_line":"        # soft-deleted in the API level?:"},{"line_number":1347,"context_line":"        # - models.SecurityGroupInstanceAssociation"},{"line_number":1348,"context_line":"        # - models.InstanceMetadata"},{"line_number":1349,"context_line":"        # - models.InstanceExtra"},{"line_number":1350,"context_line":"        # - models.InstanceSystemMetadata"},{"line_number":1351,"context_line":"        # - models.Migration"},{"line_number":1352,"context_line":"        # - models.InstanceInfoCache"},{"line_number":1353,"context_line":"        # No need to do something for BDMs and Tags since they are going to be"},{"line_number":1354,"context_line":"        # created in _bury_in_cell0."},{"line_number":1355,"context_line":"        context.read_deleted \u003d \u0027no\u0027"},{"line_number":1356,"context_line":""},{"line_number":1357,"context_line":"        return old_instance"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_1c2b8633","line":1354,"range":{"start_line":1339,"start_character":8,"end_line":1354,"end_character":36},"in_reply_to":"9fdfeff1_711e940e","updated":"2019-03-05 16:13:03.000000000","message":"As for tags I think we are ok since they are pulled from the DB, persisted in the new build request and then deleted in cell0. So it\u0027s not the same as the requested_networks (they were not persisted at all).","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e87cb57bd76f3138244e1ac95bbea59e78616d2d","unresolved":false,"context_lines":[{"line_number":1243,"context_line":""},{"line_number":1244,"context_line":"                # NOTE(mnaser): In order to properly clean-up volumes after"},{"line_number":1245,"context_line":"                #               being buried in cell0, we need to store BDMs."},{"line_number":1246,"context_line":"                if block_device_mapping:"},{"line_number":1247,"context_line":"                    self._create_block_device_mapping("},{"line_number":1248,"context_line":"                       cell0, instance.flavor, instance.uuid,"},{"line_number":1249,"context_line":"                       block_device_mapping)"},{"line_number":1250,"context_line":""},{"line_number":1251,"context_line":"                self._create_tags(cctxt, instance.uuid, tags)"},{"line_number":1252,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_e16bae1c","line":1249,"range":{"start_line":1246,"start_character":16,"end_line":1249,"end_character":44},"updated":"2019-03-05 20:54:15.000000000","message":"Couldn\u0027t you hit similar \"already exists\" type failures here? Or maybe it\u0027s not because it\u0027s doing BlockDeviceMapping.update_or_create()?","commit_id":"6bd3f96a1f8cd23764e68fa29f8a7a1b843ddc7b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e87cb57bd76f3138244e1ac95bbea59e78616d2d","unresolved":false,"context_lines":[{"line_number":1509,"context_line":"                if instance.task_state \u003d\u003d task_states.REBUILDING:"},{"line_number":1510,"context_line":"                    # We ended up here because we are rebuilding from cell0."},{"line_number":1511,"context_line":"                    # Resetting the task_state to None"},{"line_number":1512,"context_line":"                    instance.task_state \u003d None"},{"line_number":1513,"context_line":"                    instance.save()"},{"line_number":1514,"context_line":""},{"line_number":1515,"context_line":"            # TODO(Kevin Zheng): clean this up once instance.create() handles"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_61c6de19","line":1512,"range":{"start_line":1512,"start_character":20,"end_line":1512,"end_character":46},"updated":"2019-03-05 20:54:15.000000000","message":"This is definitely not what we want - you want it to be the same task_state that a normal server create would use, which is SCHEDULING:\n\nhttps://review.openstack.org/#/c/570203/9/nova/compute/manager.py@1946","commit_id":"6bd3f96a1f8cd23764e68fa29f8a7a1b843ddc7b"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"97c6a342871875c77614b853383a23fd6d21ab22","unresolved":false,"context_lines":[{"line_number":1250,"context_line":"                #                 in cell0, we shouldn\u0027t update_or_create the"},{"line_number":1251,"context_line":"                #                 existing BDMs."},{"line_number":1252,"context_line":"                if block_device_mapping and not failed_rebuild_from_cell0:"},{"line_number":1253,"context_line":"                    self._create_block_device_mapping("},{"line_number":1254,"context_line":"                       cell0, instance.flavor, instance.uuid,"},{"line_number":1255,"context_line":"                       block_device_mapping)"},{"line_number":1256,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5fc1f717_93a9c9e0","line":1253,"updated":"2019-03-06 17:24:09.000000000","message":"We shouldn\u0027t do this if the instance is already in cell0.","commit_id":"8376cfc2afb0bb4173c6e3592ad9f678d9d9108a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3977f508d6ec920a83ee24498d5146f8ec97b7ef","unresolved":false,"context_lines":[{"line_number":1494,"context_line":"                instance_tags \u003d self._create_tags(cctxt, instance.uuid, tags)"},{"line_number":1495,"context_line":"                if instance.task_state \u003d\u003d task_states.REBUILDING:"},{"line_number":1496,"context_line":"                    # We ended up here because we are rebuilding from cell0."},{"line_number":1497,"context_line":"                    # Resetting the task_state to None"},{"line_number":1498,"context_line":"                    instance.task_state \u003d task_states.SCHEDULING"},{"line_number":1499,"context_line":"                    instance.save()"},{"line_number":1500,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5fc1f717_2ae24ad5","line":1497,"range":{"start_line":1497,"start_character":20,"end_line":1497,"end_character":54},"updated":"2019-04-08 18:16:01.000000000","message":"This doesn\u0027t match the code.","commit_id":"be4b481d43fed49da95fa6aee5cf59b646cbcfd8"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"e543791ee96cb15719aeaadfaaa084cf3e3f4736","unresolved":false,"context_lines":[{"line_number":1494,"context_line":"                instance_tags \u003d self._create_tags(cctxt, instance.uuid, tags)"},{"line_number":1495,"context_line":"                if instance.task_state \u003d\u003d task_states.REBUILDING:"},{"line_number":1496,"context_line":"                    # We ended up here because we are rebuilding from cell0."},{"line_number":1497,"context_line":"                    # Resetting the task_state to None"},{"line_number":1498,"context_line":"                    instance.task_state \u003d task_states.SCHEDULING"},{"line_number":1499,"context_line":"                    instance.save()"},{"line_number":1500,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5fc1f717_84232658","line":1497,"range":{"start_line":1497,"start_character":20,"end_line":1497,"end_character":54},"in_reply_to":"5fc1f717_2ae24ad5","updated":"2019-04-09 21:40:00.000000000","message":"Done","commit_id":"be4b481d43fed49da95fa6aee5cf59b646cbcfd8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"28d1e3afe92517cc8b61ce02a48dd128842e9e51","unresolved":false,"context_lines":[{"line_number":1339,"context_line":"        request_spec.map_requested_resources_to_providers("},{"line_number":1340,"context_line":"            allocs, provider_traits)"},{"line_number":1341,"context_line":""},{"line_number":1342,"context_line":"    def rebuild_instance_in_cell0(self, context, build_request,"},{"line_number":1343,"context_line":"                                  request_specs, image,"},{"line_number":1344,"context_line":"                                  admin_password, injected_files,"},{"line_number":1345,"context_line":"                                  requested_networks, block_device_mapping,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fce034c_dd72b3e3","line":1342,"range":{"start_line":1342,"start_character":8,"end_line":1342,"end_character":33},"updated":"2019-04-16 20:29:42.000000000","message":"I know this is in the spec, but I\u0027m not sure why you can\u0027t just call schedule_and_build_instances directly - the only difference is the number of build requests and such right, but we can just call schedule_and_build_instances from the API the same as as you\u0027re doing it here right?","commit_id":"2f77bdbd17537f1801800d3ae90e3bade1da2259"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"28d1e3afe92517cc8b61ce02a48dd128842e9e51","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"            allocs, provider_traits)"},{"line_number":1341,"context_line":""},{"line_number":1342,"context_line":"    def rebuild_instance_in_cell0(self, context, build_request,"},{"line_number":1343,"context_line":"                                  request_specs, image,"},{"line_number":1344,"context_line":"                                  admin_password, injected_files,"},{"line_number":1345,"context_line":"                                  requested_networks, block_device_mapping,"},{"line_number":1346,"context_line":"                                  tags\u003dNone):"}],"source_content_type":"text/x-python","patch_set":15,"id":"3fce034c_9d7c2bb6","line":1343,"range":{"start_line":1343,"start_character":34,"end_line":1343,"end_character":47},"updated":"2019-04-16 20:29:42.000000000","message":"Is this a list or a single RequestSpec (I\u0027d expect single). But then why do we have to turn build_request into a list as well? Something is off here.","commit_id":"2f77bdbd17537f1801800d3ae90e3bade1da2259"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6342,"context_line":"        self.assertNotIn(\u0027allocation\u0027, binding_profile)"},{"line_number":6343,"context_line":""},{"line_number":6344,"context_line":""},{"line_number":6345,"context_line":"class ServerRebuildInCell0TestCase(integrated_helpers._IntegratedTestBase,"},{"line_number":6346,"context_line":"                                   integrated_helpers.InstanceHelperMixin):"},{"line_number":6347,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":6348,"context_line":"    microversion \u003d \u00272.72\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_0e97e7ed","line":6345,"range":{"start_line":6345,"start_character":6,"end_line":6345,"end_character":34},"updated":"2019-03-04 17:51:31.000000000","message":"It would be good to have a test rebuilding a volume-backed server from cell0 as well (note you can\u0027t change the image on volume-backed server rebuild). I\u0027m interested in making sure the BDMs are processed correctly and that the volume attachments (which are tracked in the CinderFixtureNewAttachFlow fixture) are tracked properly, i.e. any volume attachments from the server create (which goes to ERROR state) are cleaned up properly, and on rebuild from ERROR new volume attachments are made when the server is successfully rebuilt.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6342,"context_line":"        self.assertNotIn(\u0027allocation\u0027, binding_profile)"},{"line_number":6343,"context_line":""},{"line_number":6344,"context_line":""},{"line_number":6345,"context_line":"class ServerRebuildInCell0TestCase(integrated_helpers._IntegratedTestBase,"},{"line_number":6346,"context_line":"                                   integrated_helpers.InstanceHelperMixin):"},{"line_number":6347,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"},{"line_number":6348,"context_line":"    microversion \u003d \u00272.72\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_fccd62b7","line":6345,"range":{"start_line":6345,"start_character":6,"end_line":6345,"end_character":34},"in_reply_to":"9fdfeff1_0e97e7ed","updated":"2019-03-05 16:13:03.000000000","message":"I added a new test case for BFV and it seems that there is something wrong there.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6360,"context_line":"        }"},{"line_number":6361,"context_line":"        return self.api.post_server(server_req_body)"},{"line_number":6362,"context_line":""},{"line_number":6363,"context_line":"    def _rebuild_instance(self, server, microversion, image\u003dNone):"},{"line_number":6364,"context_line":"        image \u003d image or \u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027"},{"line_number":6365,"context_line":"        rebuild_req_body \u003d {"},{"line_number":6366,"context_line":"            \u0027rebuild\u0027: {"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_cee8ffb4","line":6363,"range":{"start_line":6363,"start_character":40,"end_line":6363,"end_character":52},"updated":"2019-03-04 17:51:31.000000000","message":"You could make this optional to only override it since self.api already uses 2.72 because of the class level variable.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6360,"context_line":"        }"},{"line_number":6361,"context_line":"        return self.api.post_server(server_req_body)"},{"line_number":6362,"context_line":""},{"line_number":6363,"context_line":"    def _rebuild_instance(self, server, microversion, image\u003dNone):"},{"line_number":6364,"context_line":"        image \u003d image or \u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027"},{"line_number":6365,"context_line":"        rebuild_req_body \u003d {"},{"line_number":6366,"context_line":"            \u0027rebuild\u0027: {"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_bca83ad9","line":6363,"range":{"start_line":6363,"start_character":40,"end_line":6363,"end_character":52},"in_reply_to":"9fdfeff1_cee8ffb4","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6368,"context_line":"            }"},{"line_number":6369,"context_line":"        }"},{"line_number":6370,"context_line":""},{"line_number":6371,"context_line":"        self.api.microversion \u003d microversion"},{"line_number":6372,"context_line":"        self.api.api_post(\u0027/servers/%s/action\u0027 % server[\u0027id\u0027],"},{"line_number":6373,"context_line":"                          rebuild_req_body)"},{"line_number":6374,"context_line":""},{"line_number":6375,"context_line":"    def setUp(self):"},{"line_number":6376,"context_line":"        \"\"\"Disables the compute service and forces the instance in cell0\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_eeb4e3d6","line":6373,"range":{"start_line":6371,"start_character":8,"end_line":6373,"end_character":43},"updated":"2019-03-04 17:51:31.000000000","message":"Rather than have to restore the microversion later, just do this:\n\nwith utils.temporary_mutation(self.api, microversion\u003dmicroversion):\n   self.api.api_post(...)","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6368,"context_line":"            }"},{"line_number":6369,"context_line":"        }"},{"line_number":6370,"context_line":""},{"line_number":6371,"context_line":"        self.api.microversion \u003d microversion"},{"line_number":6372,"context_line":"        self.api.api_post(\u0027/servers/%s/action\u0027 % server[\u0027id\u0027],"},{"line_number":6373,"context_line":"                          rebuild_req_body)"},{"line_number":6374,"context_line":""},{"line_number":6375,"context_line":"    def setUp(self):"},{"line_number":6376,"context_line":"        \"\"\"Disables the compute service and forces the instance in cell0\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_5cb58e31","line":6373,"range":{"start_line":6371,"start_character":8,"end_line":6373,"end_character":43},"in_reply_to":"9fdfeff1_eeb4e3d6","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6412,"context_line":"                               microversion)"},{"line_number":6413,"context_line":""},{"line_number":6414,"context_line":"        self.assertEqual(409, ex.response.status_code)"},{"line_number":6415,"context_line":"        # Restore the microversion here"},{"line_number":6416,"context_line":"        self.api.microversion \u003d self.microversion"},{"line_number":6417,"context_line":""},{"line_number":6418,"context_line":"        # Ensure that the instance was not touched"},{"line_number":6419,"context_line":"        self.assertEqual(self.FAILED_STATE, self.server[\u0027status\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_ce9a3f61","line":6416,"range":{"start_line":6415,"start_character":8,"end_line":6416,"end_character":49},"updated":"2019-03-04 17:51:31.000000000","message":"See above but there is a cleaner way to do this.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6412,"context_line":"                               microversion)"},{"line_number":6413,"context_line":""},{"line_number":6414,"context_line":"        self.assertEqual(409, ex.response.status_code)"},{"line_number":6415,"context_line":"        # Restore the microversion here"},{"line_number":6416,"context_line":"        self.api.microversion \u003d self.microversion"},{"line_number":6417,"context_line":""},{"line_number":6418,"context_line":"        # Ensure that the instance was not touched"},{"line_number":6419,"context_line":"        self.assertEqual(self.FAILED_STATE, self.server[\u0027status\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_3c868a67","line":6416,"range":{"start_line":6415,"start_character":8,"end_line":6416,"end_character":49},"in_reply_to":"9fdfeff1_ce9a3f61","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6421,"context_line":"    def test_rebuild_from_cell0_failed_state(self):"},{"line_number":6422,"context_line":"        # Rebuild the server with microversion 2.72 and wait"},{"line_number":6423,"context_line":"        # until gets to ACTIVE."},{"line_number":6424,"context_line":"        self._rebuild_instance(self.server, self.microversion)"},{"line_number":6425,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":6426,"context_line":"            self.api, self.server, \u0027ACTIVE\u0027)"},{"line_number":6427,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_aefc9b72","line":6424,"range":{"start_line":6424,"start_character":44,"end_line":6424,"end_character":61},"updated":"2019-03-04 17:51:31.000000000","message":"See above but you shouldn\u0027t really need this since self.api.microversion is already set by the base class.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6421,"context_line":"    def test_rebuild_from_cell0_failed_state(self):"},{"line_number":6422,"context_line":"        # Rebuild the server with microversion 2.72 and wait"},{"line_number":6423,"context_line":"        # until gets to ACTIVE."},{"line_number":6424,"context_line":"        self._rebuild_instance(self.server, self.microversion)"},{"line_number":6425,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":6426,"context_line":"            self.api, self.server, \u0027ACTIVE\u0027)"},{"line_number":6427,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_1c81464e","line":6424,"range":{"start_line":6424,"start_character":44,"end_line":6424,"end_character":61},"in_reply_to":"9fdfeff1_aefc9b72","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6438,"context_line":""},{"line_number":6439,"context_line":"        # Rebuild the server with microversion 2.72 and wait"},{"line_number":6440,"context_line":"        # until gets to the FAILED_STATE."},{"line_number":6441,"context_line":"        self._rebuild_instance(self.server, self.microversion)"},{"line_number":6442,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":6443,"context_line":"            self.api, self.server, self.FAILED_STATE)"},{"line_number":6444,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_ce36bf52","line":6441,"range":{"start_line":6441,"start_character":44,"end_line":6441,"end_character":61},"updated":"2019-03-04 17:51:31.000000000","message":"same","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6438,"context_line":""},{"line_number":6439,"context_line":"        # Rebuild the server with microversion 2.72 and wait"},{"line_number":6440,"context_line":"        # until gets to the FAILED_STATE."},{"line_number":6441,"context_line":"        self._rebuild_instance(self.server, self.microversion)"},{"line_number":6442,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":6443,"context_line":"            self.api, self.server, self.FAILED_STATE)"},{"line_number":6444,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_dc7ade75","line":6441,"range":{"start_line":6441,"start_character":44,"end_line":6441,"end_character":61},"in_reply_to":"9fdfeff1_ce36bf52","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":6445,"context_line":"        # Re-enable the compute service"},{"line_number":6446,"context_line":"        self.api.put_service(self.compute_service_id, {\u0027status\u0027: \u0027enabled\u0027})"},{"line_number":6447,"context_line":""},{"line_number":6448,"context_line":"        # Rebuild the server with microversion 2.72 and wait"},{"line_number":6449,"context_line":"        # until gets to ACTIVE."},{"line_number":6450,"context_line":"        self._rebuild_instance(self.server, self.microversion)"},{"line_number":6451,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":6452,"context_line":"            self.api, self.server, \u0027ACTIVE\u0027)"},{"line_number":6453,"context_line":""},{"line_number":6454,"context_line":"        req_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":6455,"context_line":"            self.ctxt, self.server[\u0027id\u0027])"},{"line_number":6456,"context_line":""},{"line_number":6457,"context_line":"        # Make sure that we removed the requested networks from"},{"line_number":6458,"context_line":"        # the request spec."},{"line_number":6459,"context_line":"        self.assertEqual(0, len(req_spec.requested_networks))"},{"line_number":6460,"context_line":""},{"line_number":6461,"context_line":"    def test_rebuild_from_cell0_with_different_image(self):"},{"line_number":6462,"context_line":"        # Rebuild the server with microversion 2.72 and wait"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_6e24730f","line":6459,"range":{"start_line":6448,"start_character":8,"end_line":6459,"end_character":61},"updated":"2019-03-04 17:51:31.000000000","message":"You could just call self.test_rebuild_from_cell0_failed_state() here right? It\u0027s the same stuff.","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":6445,"context_line":"        # Re-enable the compute service"},{"line_number":6446,"context_line":"        self.api.put_service(self.compute_service_id, {\u0027status\u0027: \u0027enabled\u0027})"},{"line_number":6447,"context_line":""},{"line_number":6448,"context_line":"        # Rebuild the server with microversion 2.72 and wait"},{"line_number":6449,"context_line":"        # until gets to ACTIVE."},{"line_number":6450,"context_line":"        self._rebuild_instance(self.server, self.microversion)"},{"line_number":6451,"context_line":"        self.server \u003d self._wait_for_state_change("},{"line_number":6452,"context_line":"            self.api, self.server, \u0027ACTIVE\u0027)"},{"line_number":6453,"context_line":""},{"line_number":6454,"context_line":"        req_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":6455,"context_line":"            self.ctxt, self.server[\u0027id\u0027])"},{"line_number":6456,"context_line":""},{"line_number":6457,"context_line":"        # Make sure that we removed the requested networks from"},{"line_number":6458,"context_line":"        # the request spec."},{"line_number":6459,"context_line":"        self.assertEqual(0, len(req_spec.requested_networks))"},{"line_number":6460,"context_line":""},{"line_number":6461,"context_line":"    def test_rebuild_from_cell0_with_different_image(self):"},{"line_number":6462,"context_line":"        # Rebuild the server with microversion 2.72 and wait"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_9c94568e","line":6459,"range":{"start_line":6448,"start_character":8,"end_line":6459,"end_character":61},"in_reply_to":"9fdfeff1_6e24730f","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1a2e6c0e6ef293f48786114085db1cc339bf5a07","unresolved":false,"context_lines":[{"line_number":6748,"context_line":"        # Not valid for BFV"},{"line_number":6749,"context_line":"        pass"},{"line_number":6750,"context_line":""},{"line_number":6751,"context_line":"    def test_rebuild_and_fail_while_in_cell0(self):"},{"line_number":6752,"context_line":"        # This is failing now and it shouldn\u0027t."},{"line_number":6753,"context_line":"        # As soon as the instance lands in cell0 for the second time we lose"},{"line_number":6754,"context_line":"        # the attachments. This causes a NovaException in the next rebuild as"}],"source_content_type":"text/x-python","patch_set":10,"id":"9fdfeff1_ff479476","line":6751,"updated":"2019-03-05 17:04:09.000000000","message":"In this scenario the instance is in cell0 and and there is a scheduling failure causing it to remain in cell0. As soon as we try to rebuild there is a NovaException is raised because the API can\u0027t find the root BDM. I am missing something...","commit_id":"6bd3f96a1f8cd23764e68fa29f8a7a1b843ddc7b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"16647b63a475a891c1a32fdefe99ca77c8d55c75","unresolved":false,"context_lines":[{"line_number":6748,"context_line":"        # Not valid for BFV"},{"line_number":6749,"context_line":"        pass"},{"line_number":6750,"context_line":""},{"line_number":6751,"context_line":"    def test_rebuild_and_fail_while_in_cell0(self):"},{"line_number":6752,"context_line":"        # This is failing now and it shouldn\u0027t."},{"line_number":6753,"context_line":"        # As soon as the instance lands in cell0 for the second time we lose"},{"line_number":6754,"context_line":"        # the attachments. This causes a NovaException in the next rebuild as"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_61efbe87","line":6751,"in_reply_to":"5fc1f717_e1264e17","updated":"2019-03-05 20:55:37.000000000","message":"Anyway, see my comment in the conductor code, but my guess is you\u0027re not resurrecting the soft-deleted BDMs, you\u0027re just updating the already-deleted ones.","commit_id":"6bd3f96a1f8cd23764e68fa29f8a7a1b843ddc7b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e87cb57bd76f3138244e1ac95bbea59e78616d2d","unresolved":false,"context_lines":[{"line_number":6748,"context_line":"        # Not valid for BFV"},{"line_number":6749,"context_line":"        pass"},{"line_number":6750,"context_line":""},{"line_number":6751,"context_line":"    def test_rebuild_and_fail_while_in_cell0(self):"},{"line_number":6752,"context_line":"        # This is failing now and it shouldn\u0027t."},{"line_number":6753,"context_line":"        # As soon as the instance lands in cell0 for the second time we lose"},{"line_number":6754,"context_line":"        # the attachments. This causes a NovaException in the next rebuild as"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_e1264e17","line":6751,"in_reply_to":"9fdfeff1_ff479476","updated":"2019-03-05 20:54:15.000000000","message":"Remember that BDMs are not stored in the RequestSpec, so when we bury in cell0 we create the instance and it\u0027s BDMs there and when you rebuild from cell0, if you\u0027re soft-deleting the instance it\u0027s going to also soft-delete the BDMs, but when you try to \"resurrect\" the instance later, it might not be pulling the soft-deleted BDMs so they aren\u0027t getting resurrected either.","commit_id":"6bd3f96a1f8cd23764e68fa29f8a7a1b843ddc7b"}],"nova/tests/unit/api/openstack/compute/test_access_ips.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e9b88f94524a77491012e6d4082d941559c52026","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            },"},{"line_number":87,"context_line":"        }"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        def return_cell_mapping(obj, context, instance_uuid):"},{"line_number":90,"context_line":"            cell_mapping \u003d objects.CellMapping(uuid\u003duuidsentinel.cell1,"},{"line_number":91,"context_line":"                                               database_connection\u003d\"db1\")"},{"line_number":92,"context_line":"            return objects.InstanceMapping(cell_mapping\u003dcell_mapping,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_71477420","line":89,"updated":"2019-03-04 17:51:31.000000000","message":"This is copied in a few unit tests, could we generalize this into nova.tests.unit.api.openstack.fakes?","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"b52d41a71d60320f0b54f5ff3cfb2f0fcad8ae8e","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            },"},{"line_number":87,"context_line":"        }"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        def return_cell_mapping(obj, context, instance_uuid):"},{"line_number":90,"context_line":"            cell_mapping \u003d objects.CellMapping(uuid\u003duuidsentinel.cell1,"},{"line_number":91,"context_line":"                                               database_connection\u003d\"db1\")"},{"line_number":92,"context_line":"            return objects.InstanceMapping(cell_mapping\u003dcell_mapping,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9fdfeff1_3c9d2abb","line":89,"in_reply_to":"9fdfeff1_71477420","updated":"2019-03-05 16:13:03.000000000","message":"Done","commit_id":"0af6b76311351d39e30bde0f97b34afade387c45"}]}
