)]}'
{"nova/conductor/tasks/migrate.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"02e18a068c17eb26723053a53caa2f58261b0a4c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                      {\u0027host\u0027: self.instance.host, \u0027node\u0027: self.instance.node},"},{"line_number":74,"context_line":"                      instance\u003dself.instance)"},{"line_number":75,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":76,"context_line":"            # an do any rollback required"},{"line_number":77,"context_line":"            raise"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        # Stash this for the rollback routine"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_86d8387f","line":76,"range":{"start_line":76,"start_character":14,"end_line":76,"end_character":16},"updated":"2017-09-26 16:29:17.000000000","message":"and","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"02e18a068c17eb26723053a53caa2f58261b0a4c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            LOG.error(_(\u0027Unable to find existing allocations for instance\u0027),"},{"line_number":89,"context_line":"                      instance\u003dself.instance)"},{"line_number":90,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":91,"context_line":"            # an do any rollback required"},{"line_number":92,"context_line":"            raise exception.InstanceUnacceptable("},{"line_number":93,"context_line":"                instance_id\u003dself.instance.uuid,"},{"line_number":94,"context_line":"                reason\u003d_(\u0027Instance has no source node allocation\u0027))"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_46e24031","line":91,"range":{"start_line":91,"start_character":14,"end_line":91,"end_character":16},"updated":"2017-09-26 16:29:17.000000000","message":"and","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"02e18a068c17eb26723053a53caa2f58261b0a4c","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        if not self._held_allocations:"},{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        LOG.warning(\u0027DAN: Reverting new-style migration allocations\u0027)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":199,"context_line":"        reportclient \u003d schedclient.reportclient"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_066448b8","line":196,"updated":"2017-09-26 16:29:17.000000000","message":"HI DAN","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"02e18a068c17eb26723053a53caa2f58261b0a4c","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            LOG.debug(\u0027Created allocations for instance %(inst)s on %(rp)s\u0027,"},{"line_number":223,"context_line":"                      {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        reportclient.delete_allocation_for_instance(migration.uuid)"},{"line_number":226,"context_line":"        if not success:"},{"line_number":227,"context_line":"            # FIXME(danms): Try again to claim for the instance if we"},{"line_number":228,"context_line":"            # faile to do it before the delete above. This is just a"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_063208a8","line":225,"updated":"2017-09-26 16:29:17.000000000","message":"Looks like you could DRY this chunk up with the previous block if you were feeling so inclined?","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0a065ae00ac085f6ba1799d7d97c19660ddca20e","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            LOG.debug(\u0027Created allocations for instance %(inst)s on %(rp)s\u0027,"},{"line_number":223,"context_line":"                      {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        reportclient.delete_allocation_for_instance(migration.uuid)"},{"line_number":226,"context_line":"        if not success:"},{"line_number":227,"context_line":"            # FIXME(danms): Try again to claim for the instance if we"},{"line_number":228,"context_line":"            # faile to do it before the delete above. This is just a"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_26b984cb","line":225,"in_reply_to":"7f515b1d_063208a8","updated":"2017-09-26 16:35:21.000000000","message":"I could, but it will go away when we have your atomic allocation swap. So I figured I\u0027d just duplicate it here so we can nuke this when we have that instead of unrolling a loop.","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"02e18a068c17eb26723053a53caa2f58261b0a4c","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        reportclient.delete_allocation_for_instance(migration.uuid)"},{"line_number":226,"context_line":"        if not success:"},{"line_number":227,"context_line":"            # FIXME(danms): Try again to claim for the instance if we"},{"line_number":228,"context_line":"            # faile to do it before the delete above. This is just a"},{"line_number":229,"context_line":"            # racy attempt to be atomic and avoid stranding this"},{"line_number":230,"context_line":"            # instance without an allocation. When we have an atomic"},{"line_number":231,"context_line":"            # replace operation we should remove this."}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_c62bd02d","line":228,"range":{"start_line":228,"start_character":14,"end_line":228,"end_character":19},"updated":"2017-09-26 16:29:17.000000000","message":"failed","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4a8658aa2eeea572ff3ab31c5cd4c4fb68529a97","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # Stash this for the rollback routine"},{"line_number":81,"context_line":"        self._source_cn \u003d source_cn"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":84,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        orig_alloc \u003d reportclient.get_allocations_for_instance("}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_a974799a","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":56},"updated":"2017-10-10 19:35:13.000000000","message":"The task object has a scheduler_client attribute that you can use already. (see line 38)","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf3bad73a99bc8bf39098d6c34c81faf3d6125d9","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # Stash this for the rollback routine"},{"line_number":81,"context_line":"        self._source_cn \u003d source_cn"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":84,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        orig_alloc \u003d reportclient.get_allocations_for_instance("}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_36d0c61f","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":56},"in_reply_to":"5f4e5783_1646ea22","updated":"2017-10-11 17:01:00.000000000","message":"heh, ok, deal :)","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"72c6e3f1e0d4e0171ba7a649af4a793a8f6a28f0","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # Stash this for the rollback routine"},{"line_number":81,"context_line":"        self._source_cn \u003d source_cn"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":84,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        orig_alloc \u003d reportclient.get_allocations_for_instance("}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_1646ea22","line":83,"range":{"start_line":83,"start_character":8,"end_line":83,"end_character":56},"in_reply_to":"5f4e5783_a974799a","updated":"2017-10-11 16:58:16.000000000","message":"In the next patch I genericify this method outside of the task, where it needs this. I could remove this and re-add it there, but it\u0027s easier if you just let me slide on it :)","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4a8658aa2eeea572ff3ab31c5cd4c4fb68529a97","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            return"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":198,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":199,"context_line":"        source_cn \u003d self._source_cn"},{"line_number":200,"context_line":"        orig_alloc \u003d self._held_allocations"},{"line_number":201,"context_line":"        instance \u003d self.instance"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_c97d756f","line":198,"updated":"2017-10-10 19:35:13.000000000","message":"See note above about there being a scheduler_client attribute of the task object you can use here.","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4a8658aa2eeea572ff3ab31c5cd4c4fb68529a97","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            # claim. Try again to claim for the instance. This is just"},{"line_number":236,"context_line":"            # a racy attempt to be atomic and avoid stranding this"},{"line_number":237,"context_line":"            # instance without an allocation. When we have an atomic"},{"line_number":238,"context_line":"            # replace operation we should remove this."},{"line_number":239,"context_line":"            success \u003d reportclient.put_allocations(source_cn.uuid,"},{"line_number":240,"context_line":"                                                   instance.uuid,"},{"line_number":241,"context_line":"                                                   orig_alloc,"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_49e62547","line":238,"updated":"2017-10-10 19:35:13.000000000","message":"ack.","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"d61e8305e56f9852ac7cd9e93af129873bbf5f63","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            source_cn \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":70,"context_line":"                self.context, self.instance.host, self.instance.node)"},{"line_number":71,"context_line":"        except exception.ComputeHostNotFound:"},{"line_number":72,"context_line":"            LOG.error(_(\u0027Unable to find record for source \u0027"},{"line_number":73,"context_line":"                        \u0027node %(node)s on %(host)s\u0027),"},{"line_number":74,"context_line":"                      {\u0027host\u0027: self.instance.host, \u0027node\u0027: self.instance.node},"},{"line_number":75,"context_line":"                      instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_9b0f5c36","line":72,"range":{"start_line":72,"start_character":22,"end_line":72,"end_character":24},"updated":"2017-10-24 02:35:41.000000000","message":"It is unnecessary.","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ab3e9bfdb75bcfda0e871b886d5959c4e8ceddf9","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            source_cn \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":70,"context_line":"                self.context, self.instance.host, self.instance.node)"},{"line_number":71,"context_line":"        except exception.ComputeHostNotFound:"},{"line_number":72,"context_line":"            LOG.error(_(\u0027Unable to find record for source \u0027"},{"line_number":73,"context_line":"                        \u0027node %(node)s on %(host)s\u0027),"},{"line_number":74,"context_line":"                      {\u0027host\u0027: self.instance.host, \u0027node\u0027: self.instance.node},"},{"line_number":75,"context_line":"                      instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_5778818e","line":72,"range":{"start_line":72,"start_character":22,"end_line":72,"end_character":24},"in_reply_to":"3f4b6375_9b0f5c36","updated":"2017-10-24 16:11:44.000000000","message":"Unnecessary, but not harmful. Changing these causes a huge conflict with the next patch in the series, so fixing them here is just busy work.","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"d61e8305e56f9852ac7cd9e93af129873bbf5f63","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            source_cn.uuid, self.instance.uuid)"},{"line_number":88,"context_line":"        if not orig_alloc:"},{"line_number":89,"context_line":"            LOG.error(\u0027Unable to find existing allocations on source \u0027"},{"line_number":90,"context_line":"                        \u0027%(uuid)s for instance\u0027,"},{"line_number":91,"context_line":"                      instance\u003dself.instance)"},{"line_number":92,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":93,"context_line":"            # and do any rollback required"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_fe2e3e90","line":90,"range":{"start_line":90,"start_character":27,"end_line":90,"end_character":31},"updated":"2017-10-24 02:35:41.000000000","message":"\u0027uuid\u0027 is missing.\n\n  {\u0027uuid\u0027: source_cn.uuid}","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"d61e8305e56f9852ac7cd9e93af129873bbf5f63","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            source_cn.uuid, self.instance.uuid)"},{"line_number":88,"context_line":"        if not orig_alloc:"},{"line_number":89,"context_line":"            LOG.error(\u0027Unable to find existing allocations on source \u0027"},{"line_number":90,"context_line":"                        \u0027%(uuid)s for instance\u0027,"},{"line_number":91,"context_line":"                      instance\u003dself.instance)"},{"line_number":92,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":93,"context_line":"            # and do any rollback required"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_7b0ca040","line":90,"range":{"start_line":90,"start_character":22,"end_line":90,"end_character":24},"updated":"2017-10-24 02:35:41.000000000","message":"alignment","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ab3e9bfdb75bcfda0e871b886d5959c4e8ceddf9","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            source_cn.uuid, self.instance.uuid)"},{"line_number":88,"context_line":"        if not orig_alloc:"},{"line_number":89,"context_line":"            LOG.error(\u0027Unable to find existing allocations on source \u0027"},{"line_number":90,"context_line":"                        \u0027%(uuid)s for instance\u0027,"},{"line_number":91,"context_line":"                      instance\u003dself.instance)"},{"line_number":92,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":93,"context_line":"            # and do any rollback required"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_f772cdac","line":90,"range":{"start_line":90,"start_character":27,"end_line":90,"end_character":31},"in_reply_to":"3f4b6375_fe2e3e90","updated":"2017-10-24 16:11:44.000000000","message":"Again, both already fixed in the next patch and changes here just cause conflicts.","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"d61e8305e56f9852ac7cd9e93af129873bbf5f63","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                                               self.instance.project_id,"},{"line_number":107,"context_line":"                                               self.instance.user_id)"},{"line_number":108,"context_line":"        if not success:"},{"line_number":109,"context_line":"            LOG.error(_(\u0027Unable to replace resource claim on source \u0027"},{"line_number":110,"context_line":"                        \u0027host %(host)s node %(node)s for instance\u0027),"},{"line_number":111,"context_line":"                      {\u0027host\u0027: self.instance.host,"},{"line_number":112,"context_line":"                       \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_5b056413","line":109,"range":{"start_line":109,"start_character":22,"end_line":109,"end_character":24},"updated":"2017-10-24 02:35:41.000000000","message":"ditto","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"d61e8305e56f9852ac7cd9e93af129873bbf5f63","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                                               self.instance.project_id,"},{"line_number":214,"context_line":"                                               self.instance.user_id)"},{"line_number":215,"context_line":"        if not success:"},{"line_number":216,"context_line":"            LOG.error(_(\u0027Unable to replace resource claim on source \u0027"},{"line_number":217,"context_line":"                        \u0027host %(host)s node %(node)s for instance\u0027),"},{"line_number":218,"context_line":"                      {\u0027host\u0027: self.instance.host,"},{"line_number":219,"context_line":"                       \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_3b02a80c","line":216,"range":{"start_line":216,"start_character":22,"end_line":216,"end_character":24},"updated":"2017-10-24 02:35:41.000000000","message":"ditto","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"d61e8305e56f9852ac7cd9e93af129873bbf5f63","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                    \u0027Created allocations for instance %(inst)s on %(rp)s\u0027,"},{"line_number":248,"context_line":"                    {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":249,"context_line":"            else:"},{"line_number":250,"context_line":"                LOG.error(_(\u0027Unable to replace resource claim on source \u0027"},{"line_number":251,"context_line":"                        \u0027host %(host)s node %(node)s for instance\u0027),"},{"line_number":252,"context_line":"                          {\u0027host\u0027: self.instance.host,"},{"line_number":253,"context_line":"                           \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":25,"id":"3f4b6375_7e3a4ecc","line":250,"range":{"start_line":250,"start_character":26,"end_line":250,"end_character":28},"updated":"2017-10-24 02:35:41.000000000","message":"ditto","commit_id":"2537963d51865c3694b91dbd6b1068b3e9fd1f1b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":"from nova import objects"},{"line_number":21,"context_line":"from nova.scheduler import client as scheduler_client"},{"line_number":22,"context_line":"from nova.scheduler import utils as scheduler_utils"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_de1ec9b9","line":21,"updated":"2017-10-24 19:39:42.000000000","message":"Why is this needed when we already have self.scheduler_client?","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9733c4fa3eed675185cf70f18688eab0f097bb16","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":"from nova import objects"},{"line_number":21,"context_line":"from nova.scheduler import client as scheduler_client"},{"line_number":22,"context_line":"from nova.scheduler import utils as scheduler_utils"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_479b2c65","line":21,"in_reply_to":"3f4b6375_0c68bbb6","updated":"2017-10-24 21:03:43.000000000","message":"We could pass self.scheduler_client into the utility method, but OK.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":"from nova import objects"},{"line_number":21,"context_line":"from nova.scheduler import client as scheduler_client"},{"line_number":22,"context_line":"from nova.scheduler import utils as scheduler_utils"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_0c68bbb6","line":21,"in_reply_to":"3f4b6375_de1ec9b9","updated":"2017-10-24 20:28:49.000000000","message":"Because in the refactored version of this we\u0027re not a part of MigrationTask itself. See the next PS I\u0027ll push.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            source_cn \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":70,"context_line":"                self.context, self.instance.host, self.instance.node)"},{"line_number":71,"context_line":"        except exception.ComputeHostNotFound:"},{"line_number":72,"context_line":"            LOG.error(\u0027Unable to find record for source \u0027"},{"line_number":73,"context_line":"                      \u0027node %(node)s on %(host)s\u0027,"},{"line_number":74,"context_line":"                      {\u0027host\u0027: self.instance.host, \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_01e52409","line":71,"updated":"2017-10-24 19:39:42.000000000","message":"There is no unit test for this case.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                      {\u0027host\u0027: self.instance.host, \u0027node\u0027: self.instance.node},"},{"line_number":75,"context_line":"                      instance\u003dself.instance)"},{"line_number":76,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":77,"context_line":"            # and do any rollback required"},{"line_number":78,"context_line":"            raise"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # Stash this for the rollback routine"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_3ed39dd7","line":77,"updated":"2017-10-24 19:39:42.000000000","message":"Ah because of the rollback_wrapper on execute, I see:\n\nhttps://github.com/openstack/nova/blob/91f436d6c095573594f660438fe2c72e721d97ce/nova/conductor/tasks/base.py#L38\n\nAnd ComputeHostNotFound is handled in the manager:\n\nhttps://github.com/openstack/nova/blob/91f436d6c095573594f660438fe2c72e721d97ce/nova/conductor/manager.py#L242","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # Stash this for the rollback routine"},{"line_number":81,"context_line":"        self._source_cn \u003d source_cn"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":84,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        orig_alloc \u003d reportclient.get_allocations_for_consumer_by_provider("},{"line_number":87,"context_line":"            source_cn.uuid, self.instance.uuid)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_1e8a21be","line":84,"range":{"start_line":83,"start_character":8,"end_line":84,"end_character":47},"updated":"2017-10-24 19:39:42.000000000","message":"Should be able to just re-use self.scheduler_client here. -1 for that.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                      instance\u003dself.instance)"},{"line_number":93,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":94,"context_line":"            # and do any rollback required"},{"line_number":95,"context_line":"            raise exception.InstanceUnacceptable("},{"line_number":96,"context_line":"                instance_id\u003dself.instance.uuid,"},{"line_number":97,"context_line":"                reason\u003d_(\u0027Instance has no source node allocation\u0027))"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_dea80921","line":95,"range":{"start_line":95,"start_character":28,"end_line":95,"end_character":48},"updated":"2017-10-24 19:39:42.000000000","message":"Do we need to handle this here?\n\nhttps://github.com/openstack/nova/blob/91f436d6c095573594f660438fe2c72e721d97ce/nova/conductor/manager.py#L239\n\nThat\u0027s to get it passed back up through to the API code which is doing an RPC call to this method.\n\nIf it gets here:\n\nhttps://github.com/openstack/nova/blob/91f436d6c095573594f660438fe2c72e721d97ce/nova/api/openstack/compute/migrate_server.py#L43\n\nIt\u0027ll be a 500 error, but so will ComputeHostNotFound, and for these cases 500 is OK - it\u0027s some internal error and something that shouldn\u0027t happen, and the user can\u0027t fix it.\n\nBut we should still probably make sure that InstanceUnacceptable is in the expected_exceptions list.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9733c4fa3eed675185cf70f18688eab0f097bb16","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                      instance\u003dself.instance)"},{"line_number":93,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":94,"context_line":"            # and do any rollback required"},{"line_number":95,"context_line":"            raise exception.InstanceUnacceptable("},{"line_number":96,"context_line":"                instance_id\u003dself.instance.uuid,"},{"line_number":97,"context_line":"                reason\u003d_(\u0027Instance has no source node allocation\u0027))"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_27cdd065","line":95,"range":{"start_line":95,"start_character":28,"end_line":95,"end_character":48},"in_reply_to":"3f4b6375_0c967b94","updated":"2017-10-24 21:03:43.000000000","message":"We do return this to the API, because nova-api -\u003e rpc call -\u003e conductor, eventually get to execute() which does the rpc cast to prep_resize. So yeah we need InstanceUnacceptable in expected_exceptions.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                      instance\u003dself.instance)"},{"line_number":93,"context_line":"            # A generic error like this will just error out the migration"},{"line_number":94,"context_line":"            # and do any rollback required"},{"line_number":95,"context_line":"            raise exception.InstanceUnacceptable("},{"line_number":96,"context_line":"                instance_id\u003dself.instance.uuid,"},{"line_number":97,"context_line":"                reason\u003d_(\u0027Instance has no source node allocation\u0027))"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_0c967b94","line":95,"range":{"start_line":95,"start_character":28,"end_line":95,"end_character":48},"in_reply_to":"3f4b6375_dea80921","updated":"2017-10-24 20:28:49.000000000","message":"We just need to raise something so that the rollback wrapper will do its thing. We won\u0027t actually raise this to the user as they\u0027ve long since returned, right?","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                instance_id\u003dself.instance.uuid,"},{"line_number":97,"context_line":"                reason\u003d_(\u0027Instance has no source node allocation\u0027))"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        # FIXME(danms): Since we don\u0027t have an atomic operation to adjust"},{"line_number":100,"context_line":"        # allocations for multiple consumers, we have to have space on the"},{"line_number":101,"context_line":"        # source for double the claim before we delete the old one"},{"line_number":102,"context_line":"        # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":103,"context_line":"        # against only one provider. So, this may overwite allocations against"},{"line_number":104,"context_line":"        # a shared provider, if we had one."}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_e119e879","line":101,"range":{"start_line":99,"start_character":8,"end_line":101,"end_character":66},"updated":"2017-10-24 19:39:42.000000000","message":"OK so this is where we need cdent\u0027s POST allocations stuff.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                instance_id\u003dself.instance.uuid,"},{"line_number":97,"context_line":"                reason\u003d_(\u0027Instance has no source node allocation\u0027))"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        # FIXME(danms): Since we don\u0027t have an atomic operation to adjust"},{"line_number":100,"context_line":"        # allocations for multiple consumers, we have to have space on the"},{"line_number":101,"context_line":"        # source for double the claim before we delete the old one"},{"line_number":102,"context_line":"        # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":103,"context_line":"        # against only one provider. So, this may overwite allocations against"},{"line_number":104,"context_line":"        # a shared provider, if we had one."}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_8cef0b1d","line":101,"range":{"start_line":99,"start_character":8,"end_line":101,"end_character":66},"in_reply_to":"3f4b6375_e119e879","updated":"2017-10-24 20:28:49.000000000","message":"Yep. I thought \"FIXME(danms): Use cdent\u0027s stuff\" might be too obscure for later generations.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        # Stash this for the rollback routine"},{"line_number":125,"context_line":"        self._held_allocations \u003d orig_alloc"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        reportclient.delete_allocation_for_instance(self.instance.uuid)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        return migration"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_81059413","line":127,"updated":"2017-10-24 19:39:42.000000000","message":"This can return False, but I don\u0027t know in what cases it would.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            request_spec\u003dlegacy_spec, filter_properties\u003dlegacy_props,"},{"line_number":189,"context_line":"            node\u003dnode, clean_shutdown\u003dself.clean_shutdown)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def rollback(self):"},{"line_number":192,"context_line":"        if self._migration:"},{"line_number":193,"context_line":"            self._migration.status \u003d \u0027error\u0027"},{"line_number":194,"context_line":"            self._migration.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_61329860","line":191,"updated":"2017-10-24 19:39:42.000000000","message":"I don\u0027t know where you\u0027d put it, but it would be useful to have a note in here somewhere that this rollback routine is only cleaning up allocations when we fail during execution in the conductor before casting to the compute. If there is a failure after we\u0027ve cast to the compute, the compute service is responsible for cleaning up the allocations before rescheduling (or giving up if there are no more retries).","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        if not self._held_allocations:"},{"line_number":197,"context_line":"            return"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":200,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":201,"context_line":"        source_cn \u003d self._source_cn"},{"line_number":202,"context_line":"        orig_alloc \u003d self._held_allocations"},{"line_number":203,"context_line":"        instance \u003d self.instance"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_c116ec49","line":200,"range":{"start_line":199,"start_character":8,"end_line":200,"end_character":47},"updated":"2017-10-24 19:39:42.000000000","message":"self.scheduler_client","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        if not self._held_allocations:"},{"line_number":197,"context_line":"            return"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":200,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":201,"context_line":"        source_cn \u003d self._source_cn"},{"line_number":202,"context_line":"        orig_alloc \u003d self._held_allocations"},{"line_number":203,"context_line":"        instance \u003d self.instance"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_0cc43b90","line":200,"range":{"start_line":199,"start_character":8,"end_line":200,"end_character":47},"in_reply_to":"3f4b6375_c116ec49","updated":"2017-10-24 20:28:49.000000000","message":"See above.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":200,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":201,"context_line":"        source_cn \u003d self._source_cn"},{"line_number":202,"context_line":"        orig_alloc \u003d self._held_allocations"},{"line_number":203,"context_line":"        instance \u003d self.instance"},{"line_number":204,"context_line":"        migration \u003d self._migration"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        # FIXME(danms): Since we don\u0027t have an atomic operation to adjust"},{"line_number":207,"context_line":"        # allocations for multiple consumers, we have to have space on the"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_812eb48f","line":204,"range":{"start_line":201,"start_character":8,"end_line":204,"end_character":35},"updated":"2017-10-24 19:39:42.000000000","message":"nit: this seems unnecessary to create new local-scope variables.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":200,"context_line":"        reportclient \u003d schedclient.reportclient"},{"line_number":201,"context_line":"        source_cn \u003d self._source_cn"},{"line_number":202,"context_line":"        orig_alloc \u003d self._held_allocations"},{"line_number":203,"context_line":"        instance \u003d self.instance"},{"line_number":204,"context_line":"        migration \u003d self._migration"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        # FIXME(danms): Since we don\u0027t have an atomic operation to adjust"},{"line_number":207,"context_line":"        # allocations for multiple consumers, we have to have space on the"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_ac38879f","line":204,"range":{"start_line":201,"start_character":8,"end_line":204,"end_character":35},"in_reply_to":"3f4b6375_812eb48f","updated":"2017-10-24 20:28:49.000000000","message":"This too was setting the stage for the later refactor, which I\u0027m now rolling into this one.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":210,"context_line":"        # against only one provider. So, this may overwite allocations against"},{"line_number":211,"context_line":"        # a shared provider, if we had one."},{"line_number":212,"context_line":"        success \u003d reportclient.put_allocations(source_cn.uuid, instance.uuid,"},{"line_number":213,"context_line":"                                               orig_alloc,"},{"line_number":214,"context_line":"                                               self.instance.project_id,"},{"line_number":215,"context_line":"                                               self.instance.user_id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_e147a84b","line":212,"updated":"2017-10-24 19:39:42.000000000","message":"OK so if we get here, we successfully created the migration allocations against the source node and we should have deleted the instance allocations for the source node.\n\nNow we need to re-add the instance allocation on the source node before deleting the migration uuid allocation.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        # a shared provider, if we had one."},{"line_number":212,"context_line":"        success \u003d reportclient.put_allocations(source_cn.uuid, instance.uuid,"},{"line_number":213,"context_line":"                                               orig_alloc,"},{"line_number":214,"context_line":"                                               self.instance.project_id,"},{"line_number":215,"context_line":"                                               self.instance.user_id)"},{"line_number":216,"context_line":"        if not success:"},{"line_number":217,"context_line":"            LOG.error(\u0027Unable to replace resource claim on source \u0027"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_e13208f2","line":214,"range":{"start_line":214,"start_character":47,"end_line":214,"end_character":60},"updated":"2017-10-24 19:39:42.000000000","message":"See you\u0027re using the class instance variable rather than the local scope one, it\u0027s weird - at least to my delicate sensibilities.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                                               self.instance.project_id,"},{"line_number":215,"context_line":"                                               self.instance.user_id)"},{"line_number":216,"context_line":"        if not success:"},{"line_number":217,"context_line":"            LOG.error(\u0027Unable to replace resource claim on source \u0027"},{"line_number":218,"context_line":"                      \u0027host %(host)s node %(node)s for instance\u0027,"},{"line_number":219,"context_line":"                      {\u0027host\u0027: self.instance.host,"},{"line_number":220,"context_line":"                       \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_c15dcc15","line":217,"updated":"2017-10-24 19:39:42.000000000","message":"Thinking out loud, what if we get here because the double-claim fails on the source node and we instead try again but this time remove the migration uuid allocation first, and then try to add the instance allocation again? That might actually work this time if we failed above because the source was at capacity.\n\nI think the reason you\u0027re trying to double the claim first is to not lose it during a scheduling race, but if we\u0027re already at capacity on this node in between the time we swapped the allocations and are doing the rollback, it might be worth trying to drop the migration allocation and then retry the instance allocation as a last effort before giving up.\n\n\u003clater\u003e\n\nHeh, just got to L234. Touche.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            LOG.debug(\u0027Created allocations for instance %(inst)s on %(rp)s\u0027,"},{"line_number":224,"context_line":"                      {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        reportclient.delete_allocation_for_instance(migration.uuid)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        # TODO(danms): Remove this late retry logic when we can replace"},{"line_number":229,"context_line":"        # the above two-step process with a single atomic one. Until then,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_219940c3","line":226,"updated":"2017-10-24 19:39:42.000000000","message":"Again this could return False but I\u0027m not sure in what cases it would.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        # cleared what should be an equal amount of space by deleting the"},{"line_number":232,"context_line":"        # holding migraton."},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        if not success:"},{"line_number":235,"context_line":"            # NOTE(danms): We failed to claim the resources for the"},{"line_number":236,"context_line":"            # instance above before the delete of the migration\u0027s"},{"line_number":237,"context_line":"            # claim. Try again to claim for the instance. This is just"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_01ce4481","line":234,"updated":"2017-10-24 19:39:42.000000000","message":"Where do we test any of this rollback routine? There are a few conditions that could be tested in here, like just the normal rollback and then the one where we retry here.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                    \u0027Created allocations for instance %(inst)s on %(rp)s\u0027,"},{"line_number":249,"context_line":"                    {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":250,"context_line":"            else:"},{"line_number":251,"context_line":"                LOG.error(_(\u0027Unable to replace resource claim on source \u0027"},{"line_number":252,"context_line":"                        \u0027host %(host)s node %(node)s for instance\u0027),"},{"line_number":253,"context_line":"                          {\u0027host\u0027: self.instance.host,"},{"line_number":254,"context_line":"                           \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_21dee06c","line":251,"updated":"2017-10-24 19:39:42.000000000","message":"You would have already logged this once on L217 so we don\u0027t need to log it again do we?\n\nAlthough, thinking about the logging here, this would look weird if we first failed, logged an error, and then succeeded and logged that we claimed for the instance. Maybe you should remove the error logging above and just leave it for down here?","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                    \u0027Created allocations for instance %(inst)s on %(rp)s\u0027,"},{"line_number":249,"context_line":"                    {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":250,"context_line":"            else:"},{"line_number":251,"context_line":"                LOG.error(_(\u0027Unable to replace resource claim on source \u0027"},{"line_number":252,"context_line":"                        \u0027host %(host)s node %(node)s for instance\u0027),"},{"line_number":253,"context_line":"                          {\u0027host\u0027: self.instance.host,"},{"line_number":254,"context_line":"                           \u0027node\u0027: self.instance.node},"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_6c572fcc","line":251,"in_reply_to":"3f4b6375_21dee06c","updated":"2017-10-24 20:28:49.000000000","message":"Well, I\u0027m just leaving this here so I can see it happen in advance of getting cdent\u0027s atomic operation. Once we have that, we won\u0027t need to do this whole thing. L235 on. I added (retried) to the duplicated messages so we can have some indication that it\u0027s not just a total repeat of the earlier operation.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                    {\u0027inst\u0027: instance.uuid, \u0027rp\u0027: source_cn.uuid})"},{"line_number":250,"context_line":"            else:"},{"line_number":251,"context_line":"                LOG.error(_(\u0027Unable to replace resource claim on source \u0027"},{"line_number":252,"context_line":"                        \u0027host %(host)s node %(node)s for instance\u0027),"},{"line_number":253,"context_line":"                          {\u0027host\u0027: self.instance.host,"},{"line_number":254,"context_line":"                           \u0027node\u0027: self.instance.node},"},{"line_number":255,"context_line":"                          instance\u003dself.instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_81efd41c","line":252,"updated":"2017-10-24 19:39:42.000000000","message":"alignment horror","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8db6851794c13a125ba347bf0e552d251d33af2b","unresolved":false,"context_lines":[{"line_number":32,"context_line":"    try:"},{"line_number":33,"context_line":"        source_cn \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":34,"context_line":"            context, instance.host, instance.node)"},{"line_number":35,"context_line":"    except exception.ComputeHostNotFound:"},{"line_number":36,"context_line":"        LOG.error(\u0027Unable to find record for source \u0027"},{"line_number":37,"context_line":"                  \u0027node %(node)s on %(host)s\u0027,"},{"line_number":38,"context_line":"                  {\u0027host\u0027: instance.host, \u0027node\u0027: instance.node},"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f4b6375_27dcb0e2","line":35,"updated":"2017-10-24 21:11:13.000000000","message":"Probably want a test for this.","commit_id":"fb00b6b53811b1fe61a012f8ebedfe5a22f04dbb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8db6851794c13a125ba347bf0e552d251d33af2b","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        # and do any rollback required"},{"line_number":42,"context_line":"        raise"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    schedclient \u003d scheduler_client.SchedulerClient()"},{"line_number":45,"context_line":"    reportclient \u003d schedclient.reportclient"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    orig_alloc \u003d reportclient.get_allocations_for_consumer_by_provider("},{"line_number":48,"context_line":"        source_cn.uuid, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f4b6375_6732a860","line":45,"range":{"start_line":44,"start_character":4,"end_line":45,"end_character":43},"updated":"2017-10-24 21:11:13.000000000","message":"nit: I\u0027d prefer to pass in self.scheduler_client so we don\u0027t have to instantiate this (and the scheduler query client implicitly) every time this method is called - same below.","commit_id":"fb00b6b53811b1fe61a012f8ebedfe5a22f04dbb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8db6851794c13a125ba347bf0e552d251d33af2b","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                  instance\u003dinstance)"},{"line_number":52,"context_line":"        # A generic error like this will just error out the migration"},{"line_number":53,"context_line":"        # and do any rollback required"},{"line_number":54,"context_line":"        raise exception.InstanceUnacceptable("},{"line_number":55,"context_line":"            instance_id\u003dinstance.uuid,"},{"line_number":56,"context_line":"            reason\u003d_(\u0027Instance has no source node allocation\u0027))"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"3f4b6375_870c84a5","line":54,"range":{"start_line":54,"start_character":24,"end_line":54,"end_character":44},"updated":"2017-10-24 21:11:13.000000000","message":"See reply in PS27, we need to handle this in the expected_exceptions in the conductor task manager migrate_server method. API is an rpc call to conductor here.","commit_id":"fb00b6b53811b1fe61a012f8ebedfe5a22f04dbb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8db6851794c13a125ba347bf0e552d251d33af2b","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        # Mimic the \"no space\" error that could have come from the"},{"line_number":75,"context_line":"        # scheduler. Once we have an atomic replace operation, this"},{"line_number":76,"context_line":"        # would be a severe error."},{"line_number":77,"context_line":"        raise exception.NoValidHost("},{"line_number":78,"context_line":"            reason\u003d_(\u0027Unable to replace instance claim on source\u0027))"},{"line_number":79,"context_line":"    else:"},{"line_number":80,"context_line":"        LOG.debug(\u0027Created allocations for migration %(mig)s on %(rp)s\u0027,"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f4b6375_a7c8a021","line":77,"updated":"2017-10-24 21:11:13.000000000","message":"Should have a test for this.","commit_id":"fb00b6b53811b1fe61a012f8ebedfe5a22f04dbb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8db6851794c13a125ba347bf0e552d251d33af2b","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            request_spec\u003dlegacy_spec, filter_properties\u003dlegacy_props,"},{"line_number":257,"context_line":"            node\u003dnode, clean_shutdown\u003dself.clean_shutdown)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def rollback(self):"},{"line_number":260,"context_line":"        if self._migration:"},{"line_number":261,"context_line":"            self._migration.status \u003d \u0027error\u0027"},{"line_number":262,"context_line":"            self._migration.save()"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f4b6375_c7495cb7","line":259,"updated":"2017-10-24 21:11:13.000000000","message":"Need tests for this.","commit_id":"fb00b6b53811b1fe61a012f8ebedfe5a22f04dbb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8db6851794c13a125ba347bf0e552d251d33af2b","unresolved":false,"context_lines":[{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        # NOTE(danms): We created new-style migration-based allocations"},{"line_number":268,"context_line":"        # for the instance, but failed before we kicked off the migration"},{"line_number":269,"context_line":"        # in the source compute. Normally the latter would do that cleanup"},{"line_number":270,"context_line":"        # but we never got that far, so do it here and now."},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        revert_allocation_for_migration(self._source_cn, self.instance,"}],"source_content_type":"text/x-python","patch_set":27,"id":"3f4b6375_4710cca8","line":269,"range":{"start_line":269,"start_character":17,"end_line":269,"end_character":23},"updated":"2017-10-24 21:11:13.000000000","message":"nit: prep_resize actually runs on the dest compute.","commit_id":"fb00b6b53811b1fe61a012f8ebedfe5a22f04dbb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"628598792c5d8cd0942408201fceb4ab42d80e7c","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    # FIXME(danms): Since we don\u0027t have an atomic operation to adjust"},{"line_number":59,"context_line":"    # allocations for multiple consumers, we have to have space on the"},{"line_number":60,"context_line":"    # source for double the claim before we delete the old one"},{"line_number":61,"context_line":"    # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":62,"context_line":"    # against only one provider. So, this may overwite allocations against"},{"line_number":63,"context_line":"    # a shared provider, if we had one."}],"source_content_type":"text/x-python","patch_set":29,"id":"3f4b6375_87a22ffb","line":60,"updated":"2017-10-25 12:56:06.000000000","message":"I thinking about this, if we\u0027re doing resize to the same host, then this is really triple the claim, right? The instance has an old and new flavor allocation against the node and now the migration is going to also. Does that actually make it 4x the claim? Wouldn\u0027t orig_alloc be the doubled up instance claim, and then we\u0027re going to double that onto the node for the migration consumer.\n\nAs long as we get the atomic POST allocations stuff done before we release queens I think we\u0027ll be OK, but it\u0027s something to keep in mind.","commit_id":"697f8f69b69c0028b18b4f8a80f9955d9083077d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bd3da5d849a75edfe8ac54d3a2f42d2b5f84fc4a","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    # FIXME(danms): Since we don\u0027t have an atomic operation to adjust"},{"line_number":59,"context_line":"    # allocations for multiple consumers, we have to have space on the"},{"line_number":60,"context_line":"    # source for double the claim before we delete the old one"},{"line_number":61,"context_line":"    # FIXME(danms): This method is flawed in that it asssumes allocations"},{"line_number":62,"context_line":"    # against only one provider. So, this may overwite allocations against"},{"line_number":63,"context_line":"    # a shared provider, if we had one."}],"source_content_type":"text/x-python","patch_set":29,"id":"3f4b6375_2a5ea243","line":60,"in_reply_to":"3f4b6375_87a22ffb","updated":"2017-10-25 13:45:23.000000000","message":"Nevermind, it was just pointed out to me that we get here before we call the scheduler. So the migration record holds the existing source node allocation and then the scheduler creates the allocation for the instance on the chosen dest node.","commit_id":"697f8f69b69c0028b18b4f8a80f9955d9083077d"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"02e18a068c17eb26723053a53caa2f58261b0a4c","unresolved":false,"context_lines":[{"line_number":1295,"context_line":"        # OK, so the resize operation has run, but we have not yet confirmed or"},{"line_number":1296,"context_line":"        # reverted the resize operation. Before we run periodics, make sure"},{"line_number":1297,"context_line":"        # that we have allocations/usages on BOTH the source and the"},{"line_number":1298,"context_line":"        # destination hosts (because during select_destinations()"},{"line_number":1299,"context_line":"        source_usages \u003d self._get_provider_usages(source_rp_uuid)"},{"line_number":1300,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, source_usages)"},{"line_number":1301,"context_line":"        dest_usages \u003d self._get_provider_usages(dest_rp_uuid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_e6ddac42","line":1298,"updated":"2017-09-26 16:29:17.000000000","message":"because what?","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0a065ae00ac085f6ba1799d7d97c19660ddca20e","unresolved":false,"context_lines":[{"line_number":1295,"context_line":"        # OK, so the resize operation has run, but we have not yet confirmed or"},{"line_number":1296,"context_line":"        # reverted the resize operation. Before we run periodics, make sure"},{"line_number":1297,"context_line":"        # that we have allocations/usages on BOTH the source and the"},{"line_number":1298,"context_line":"        # destination hosts (because during select_destinations()"},{"line_number":1299,"context_line":"        source_usages \u003d self._get_provider_usages(source_rp_uuid)"},{"line_number":1300,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, source_usages)"},{"line_number":1301,"context_line":"        dest_usages \u003d self._get_provider_usages(dest_rp_uuid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f515b1d_c638703e","line":1298,"in_reply_to":"7f515b1d_e6ddac42","updated":"2017-09-26 16:35:21.000000000","message":"I didn\u0027t cut enough out of the previous comment :)","commit_id":"45a25529799a24a157663ee81dcd02a8482f9edf"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4a8658aa2eeea572ff3ab31c5cd4c4fb68529a97","unresolved":false,"context_lines":[{"line_number":1527,"context_line":"        allocations \u003d self._get_allocations_by_server_uuid(migration_uuid)"},{"line_number":1528,"context_line":"        self.assertEqual(1, len(allocations))"},{"line_number":1529,"context_line":"        allocation \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":1530,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, allocation)"},{"line_number":1531,"context_line":""},{"line_number":1532,"context_line":"    def test_resize_revert_same_host(self):"},{"line_number":1533,"context_line":"        # make sure that the test only uses a single host"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_e9c03153","line":1530,"updated":"2017-10-10 19:35:13.000000000","message":"All these changes are good and proper for the \"everything is up and running on Queens\" path. ++\n\nDo we need to have a test that stresses the scenario before all-Queens where the allocation is *not* swapped to the migration UUID by the conductor?","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"cf3bad73a99bc8bf39098d6c34c81faf3d6125d9","unresolved":false,"context_lines":[{"line_number":1527,"context_line":"        allocations \u003d self._get_allocations_by_server_uuid(migration_uuid)"},{"line_number":1528,"context_line":"        self.assertEqual(1, len(allocations))"},{"line_number":1529,"context_line":"        allocation \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":1530,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, allocation)"},{"line_number":1531,"context_line":""},{"line_number":1532,"context_line":"    def test_resize_revert_same_host(self):"},{"line_number":1533,"context_line":"        # make sure that the test only uses a single host"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_b68a7618","line":1530,"in_reply_to":"5f4e5783_36f9e6c7","updated":"2017-10-11 17:01:00.000000000","message":"Yeah, I had the same thoughts and didn\u0027t immediately come up with an easy way to test the scenario in these functional tests...","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"72c6e3f1e0d4e0171ba7a649af4a793a8f6a28f0","unresolved":false,"context_lines":[{"line_number":1527,"context_line":"        allocations \u003d self._get_allocations_by_server_uuid(migration_uuid)"},{"line_number":1528,"context_line":"        self.assertEqual(1, len(allocations))"},{"line_number":1529,"context_line":"        allocation \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":1530,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, allocation)"},{"line_number":1531,"context_line":""},{"line_number":1532,"context_line":"    def test_resize_revert_same_host(self):"},{"line_number":1533,"context_line":"        # make sure that the test only uses a single host"}],"source_content_type":"text/x-python","patch_set":16,"id":"5f4e5783_36f9e6c7","line":1530,"in_reply_to":"5f4e5783_e9c03153","updated":"2017-10-11 16:58:16.000000000","message":"It\u0027d be kinda hard to do that in these functional tests I think. I\u0027ll do some thinking on how we might be able to make that happen.","commit_id":"fc3a0ee4c6802e4e557c974a4610da0a3a2aa09e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"                         allocation[\u0027DISK_GB\u0027])"},{"line_number":1129,"context_line":""},{"line_number":1130,"context_line":"    def get_migration_uuid_for_instance(self, instance_uuid):"},{"line_number":1131,"context_line":"        # NOTE(danms): This is too much introspection for a test like this, but"},{"line_number":1132,"context_line":"        # we can\u0027t see the migration uuid from the API, so we just encapsulate"},{"line_number":1133,"context_line":"        # the peek behind the curtains here to keep it out of the tests."},{"line_number":1134,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":1135,"context_line":"        migrations \u003d db.migration_get_all_by_filters("},{"line_number":1136,"context_line":"            ctxt, {\u0027instance_uuid\u0027: instance_uuid})"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_a138909f","line":1133,"range":{"start_line":1131,"start_character":8,"end_line":1133,"end_character":72},"updated":"2017-10-24 19:39:42.000000000","message":"Could add a TODO that we can get the migration uuid once the microversion added in blueprint add-pagination-and-change-since-for-migration-list exposes it.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":1135,"context_line":"        migrations \u003d db.migration_get_all_by_filters("},{"line_number":1136,"context_line":"            ctxt, {\u0027instance_uuid\u0027: instance_uuid})"},{"line_number":1137,"context_line":"        self.assertEqual(1, len(migrations),"},{"line_number":1138,"context_line":"                         \u0027Test expected an in-progress migration, \u0027"},{"line_number":1139,"context_line":"                         \u0027but found %i\u0027 % len(migrations))"},{"line_number":1140,"context_line":"        return migrations[0].uuid"},{"line_number":1141,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_e151e8da","line":1138,"range":{"start_line":1138,"start_character":43,"end_line":1138,"end_character":54},"updated":"2017-10-24 19:39:42.000000000","message":"nit: you\u0027re not passing a status filter to migration_get_all_by_filters so the in-progress part here is misleading.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":1306,"context_line":"        self.assertFlavorMatchesAllocation(new_flavor, dest_usages)"},{"line_number":1307,"context_line":""},{"line_number":1308,"context_line":"        # The instance should own the new_flavor allocation against the"},{"line_number":1309,"context_line":"        # destination host"},{"line_number":1310,"context_line":"        allocations \u003d self._get_allocations_by_server_uuid(server[\u0027id\u0027])"},{"line_number":1311,"context_line":"        self.assertEqual(1, len(allocations))"},{"line_number":1312,"context_line":"        dest_alloc \u003d allocations[dest_rp_uuid][\u0027resources\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_e16a087f","line":1309,"updated":"2017-10-24 19:39:42.000000000","message":"\"against the destination host created by the scheduler.\"\n\nTo help clarify.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"        self.assertFlavorMatchesAllocation(new_flavor, dest_alloc)"},{"line_number":1314,"context_line":""},{"line_number":1315,"context_line":"        # The migration should own the old_flavor allocation against the"},{"line_number":1316,"context_line":"        # source host"},{"line_number":1317,"context_line":"        migration_uuid \u003d self.get_migration_uuid_for_instance(server[\u0027id\u0027])"},{"line_number":1318,"context_line":"        allocations \u003d self._get_allocations_by_server_uuid(migration_uuid)"},{"line_number":1319,"context_line":"        source_alloc \u003d allocations[source_rp_uuid][\u0027resources\u0027]"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_c1670cb7","line":1316,"updated":"2017-10-24 19:39:42.000000000","message":"\"created by conductor.\"","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":2320,"context_line":"        self._delete_and_check_allocations("},{"line_number":2321,"context_line":"            server, source_rp_uuid, dest_rp_uuid)"},{"line_number":2322,"context_line":""},{"line_number":2323,"context_line":"    def test_rescheduling_when_migrating_instance(self):"},{"line_number":2324,"context_line":"        \"\"\"Tests that allocations are removed from the destination node by"},{"line_number":2325,"context_line":"        the compute service when a cold migrate / resize fails and a reschedule"},{"line_number":2326,"context_line":"        request is sent back to conductor."}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_81beb4b1","line":2323,"range":{"start_line":2323,"start_character":8,"end_line":2323,"end_character":49},"updated":"2017-10-24 19:39:42.000000000","message":"We could add some assertions to this test that the code here:\n\nhttps://github.com/openstack/nova/blob/91f436d6c095573594f660438fe2c72e721d97ce/nova/compute/manager.py#L4020\n\nIs doing it\u0027s job now that the conductor is swapping the allocations before casting to prep_resize.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":2330,"context_line":"            self.flavor1, source_hostname)"},{"line_number":2331,"context_line":""},{"line_number":2332,"context_line":"        def fake_prep_resize(*args, **kwargs):"},{"line_number":2333,"context_line":"            raise test.TestingException(\u0027Simulated _prep_resize failure.\u0027)"},{"line_number":2334,"context_line":""},{"line_number":2335,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":2336,"context_line":"        self.stub_out(\u0027nova.compute.manager.ComputeManager._prep_resize\u0027,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_01cf6456","line":2333,"updated":"2017-10-24 19:39:42.000000000","message":"Before raising, we could assert that the source node allocation is now on the migration uuid and the dest node allocation is on the instance.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":2350,"context_line":"        self.assertFlavorMatchesAllocation("},{"line_number":2351,"context_line":"           {\u0027vcpus\u0027: 0, \u0027ram\u0027: 0, \u0027disk\u0027: 0}, failed_usages)"},{"line_number":2352,"context_line":""},{"line_number":2353,"context_line":"        # Ensure the allocation records still exist on the source host."},{"line_number":2354,"context_line":"        source_rp_uuid \u003d self._get_provider_uuid_by_host(source_hostname)"},{"line_number":2355,"context_line":"        source_usages \u003d self._get_provider_usages(source_rp_uuid)"},{"line_number":2356,"context_line":"        self.assertFlavorMatchesAllocation(self.flavor1, source_usages)"},{"line_number":2357,"context_line":""},{"line_number":2358,"context_line":"    def test_resize_to_same_host_prep_resize_fails(self):"},{"line_number":2359,"context_line":"        \"\"\"Tests that when we resize to the same host and resize fails in"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_61e4d8e0","line":2356,"range":{"start_line":2353,"start_character":8,"end_line":2356,"end_character":71},"updated":"2017-10-24 19:39:42.000000000","message":"The allocation on the source node should be back to the instance at this point, we should assert that.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b430eb35cd9611061a72d4da2603fc9aea65ffd2","unresolved":false,"context_lines":[{"line_number":1316,"context_line":"        # The migration should own the old_flavor allocation against the"},{"line_number":1317,"context_line":"        # source host created by conductor"},{"line_number":1318,"context_line":"        migration_uuid \u003d self.get_migration_uuid_for_instance(server[\u0027id\u0027])"},{"line_number":1319,"context_line":"        allocations \u003d self._get_allocations_by_server_uuid(migration_uuid)"},{"line_number":1320,"context_line":"        source_alloc \u003d allocations[source_rp_uuid][\u0027resources\u0027]"},{"line_number":1321,"context_line":"        self.assertFlavorMatchesAllocation(old_flavor, source_alloc)"},{"line_number":1322,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3f4b6375_ed706474","line":1319,"range":{"start_line":1319,"start_character":27,"end_line":1319,"end_character":74},"updated":"2017-10-27 12:28:21.000000000","message":"nit: would be nice to rename the _get_allocations_by_server_uuid() to _get_allocations_by_consumer_uuid() in a followup","commit_id":"697f8f69b69c0028b18b4f8a80f9955d9083077d"}],"nova/tests/unit/conductor/tasks/test_migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            task._migration.uuid \u003d uuids.migration"},{"line_number":106,"context_line":"            return mock.MagicMock()"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        cn_mock.side_effect \u003d set_migration_uuid"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        task.execute()"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_e118c81e","line":108,"range":{"start_line":108,"start_character":8,"end_line":108,"end_character":15},"updated":"2017-10-24 19:39:42.000000000","message":"Wouldn\u0027t this be more appropriate on the sm_mock?","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1eef0c2a8f349ef4ec822e2a7bdddfad4e8426c8","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            task._migration.uuid \u003d uuids.migration"},{"line_number":106,"context_line":"            return mock.MagicMock()"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        cn_mock.side_effect \u003d set_migration_uuid"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        task.execute()"},{"line_number":111,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_0cd9dbf1","line":108,"range":{"start_line":108,"start_character":8,"end_line":108,"end_character":15},"in_reply_to":"3f4b6375_e118c81e","updated":"2017-10-24 20:28:49.000000000","message":"We haven\u0027t called save() by the time we need this, and at the time we\u0027re calling create() we haven\u0027t set it on the task so we can find it here. I will add a comment.","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05ae0a8fc2b2950a044886e8051f148fdfa89fd3","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            task._migration.uuid \u003d uuids.migration"},{"line_number":165,"context_line":"            return mock.MagicMock()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        cn_mock.side_effect \u003d set_migration_uuid"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        prep_resize_mock.side_effect \u003d test.TestingException"},{"line_number":170,"context_line":"        self.assertRaises(test.TestingException, task.execute)"}],"source_content_type":"text/x-python","patch_set":26,"id":"3f4b6375_a1d41021","line":167,"range":{"start_line":167,"start_character":8,"end_line":167,"end_character":15},"updated":"2017-10-24 19:39:42.000000000","message":"same","commit_id":"ed536097eaeb28dd3eed574e3dd63bdfe1543585"}]}
