)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2e00d66daf08cda0fb2ecf721ecf379f2ad75022","unresolved":false,"context_lines":[{"line_number":677,"context_line":"                                bdi, destroy_disks)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            rt \u003d self._get_resource_tracker()"},{"line_number":680,"context_line":"            rt.delete_allocation_for_evacuated_instance("},{"line_number":681,"context_line":"                context, instance, migration.source_node)"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"            migration.status \u003d \u0027completed\u0027"},{"line_number":684,"context_line":"            migration.save()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f4e5783_349b27ca","line":681,"range":{"start_line":680,"start_character":12,"end_line":681,"end_character":57},"updated":"2017-10-11 13:28:14.000000000","message":"This is called from within a loop, so you\u0027re going to do the compute node db query lookup for every instance in this loop. Maybe we shouldn\u0027t rely on re-using delete_allocation_for_evacuated_instance and just do the thing we need inline here and only lookup the compute node record once, outside the loop.\n\nWe have similar code in _rollback_live_migration.","commit_id":"24dac729f1dc4cb24a8aa550a1e5b3fc0d6313f0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5a75ab3b17bc7090078235cd14af68b236c40dad","unresolved":false,"context_lines":[{"line_number":677,"context_line":"                                bdi, destroy_disks)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            rt \u003d self._get_resource_tracker()"},{"line_number":680,"context_line":"            rt.delete_allocation_for_evacuated_instance("},{"line_number":681,"context_line":"                context, instance, migration.source_node)"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"            migration.status \u003d \u0027completed\u0027"},{"line_number":684,"context_line":"            migration.save()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f4e5783_ce1c1c6c","line":681,"range":{"start_line":680,"start_character":12,"end_line":681,"end_character":57},"in_reply_to":"5f4e5783_349b27ca","updated":"2017-10-12 12:57:28.000000000","message":"As far as I understand ironic and vmware could have multiple nodes connected to the same host and instances can be spread around. So looking up the compute node once based on the host is not enough in case of ironic and vmware. The support matrix doesn\u0027t help me deciding if vmware or ironic supports evacuation or not but both states supports rebuild.\n\nIs it safe to use get_first_node_by_host_for_old_compat() call here?\n\nhttps://docs.openstack.org/nova/latest/user/support-matrix.html","commit_id":"24dac729f1dc4cb24a8aa550a1e5b3fc0d6313f0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"12aaf00a4ecb5c149f3fcdc12971dbcec147e3ed","unresolved":false,"context_lines":[{"line_number":677,"context_line":"                                bdi, destroy_disks)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            rt \u003d self._get_resource_tracker()"},{"line_number":680,"context_line":"            rt.delete_allocation_for_evacuated_instance("},{"line_number":681,"context_line":"                context, instance, migration.source_node)"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"            migration.status \u003d \u0027completed\u0027"},{"line_number":684,"context_line":"            migration.save()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f4e5783_ad8306cc","line":681,"range":{"start_line":680,"start_character":12,"end_line":681,"end_character":57},"in_reply_to":"5f4e5783_aefd60b2","updated":"2017-10-13 12:33:25.000000000","message":"Done","commit_id":"24dac729f1dc4cb24a8aa550a1e5b3fc0d6313f0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"70dda36aa61e93ae9b851d6dbe0e741550a2a2b1","unresolved":false,"context_lines":[{"line_number":677,"context_line":"                                bdi, destroy_disks)"},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"            rt \u003d self._get_resource_tracker()"},{"line_number":680,"context_line":"            rt.delete_allocation_for_evacuated_instance("},{"line_number":681,"context_line":"                context, instance, migration.source_node)"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"            migration.status \u003d \u0027completed\u0027"},{"line_number":684,"context_line":"            migration.save()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f4e5783_aefd60b2","line":681,"range":{"start_line":680,"start_character":12,"end_line":681,"end_character":57},"in_reply_to":"5f4e5783_ce1c1c6c","updated":"2017-10-12 13:04:46.000000000","message":"Hmm, you are probably right. Damn.\n\nSo let\u0027s use ComputeNode.get_by_host_and_nodename and just get the compute node for this instance to get the uuid so we can remove the allocation, we shouldn\u0027t have to plumb that down through the ResourceTracker, which would essentially be doing the same thing for us.\n\nIf we wanted to make it more efficient for the non-clustered hypervisor drivers, like libvirt, we could cache the host/nodename combo for the lookup.","commit_id":"24dac729f1dc4cb24a8aa550a1e5b3fc0d6313f0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e16e3b47565c84369ebf78d82dbc67393d3f9d00","unresolved":false,"context_lines":[{"line_number":654,"context_line":"        evacuated \u003d [inst for inst in local_instances"},{"line_number":655,"context_line":"                     if inst.uuid in evacuations]"},{"line_number":656,"context_line":""},{"line_number":657,"context_line":"        # NOTE(gibi): We are called from init_host and this point the"},{"line_number":658,"context_line":"        # compute_nodes of the resource tracker has not been populated yet so"},{"line_number":659,"context_line":"        # we cannot rely on the resource tracker here."},{"line_number":660,"context_line":"        compute_nodes \u003d {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_9537344e","line":657,"range":{"start_line":657,"start_character":55,"end_line":657,"end_character":59},"updated":"2017-10-13 13:18:59.000000000","message":"at this","commit_id":"1ef7e206bcfeef5108d57a946380bac2fa4e1105"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"90ced8d6640de8c6730c0d74f19532088f99fa6b","unresolved":false,"context_lines":[{"line_number":654,"context_line":"        evacuated \u003d [inst for inst in local_instances"},{"line_number":655,"context_line":"                     if inst.uuid in evacuations]"},{"line_number":656,"context_line":""},{"line_number":657,"context_line":"        # NOTE(gibi): We are called from init_host and this point the"},{"line_number":658,"context_line":"        # compute_nodes of the resource tracker has not been populated yet so"},{"line_number":659,"context_line":"        # we cannot rely on the resource tracker here."},{"line_number":660,"context_line":"        compute_nodes \u003d {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_9ead119d","line":657,"range":{"start_line":657,"start_character":55,"end_line":657,"end_character":59},"in_reply_to":"5f4e5783_9537344e","updated":"2017-10-13 15:08:55.000000000","message":"Done","commit_id":"1ef7e206bcfeef5108d57a946380bac2fa4e1105"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e16e3b47565c84369ebf78d82dbc67393d3f9d00","unresolved":false,"context_lines":[{"line_number":684,"context_line":""},{"line_number":685,"context_line":"            # delete the allocation of the evacuated instance from this host"},{"line_number":686,"context_line":"            if migration.source_node not in compute_nodes:"},{"line_number":687,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":688,"context_line":"                    context, self.host, migration.source_node).uuid"},{"line_number":689,"context_line":"                compute_nodes[migration.source_node] \u003d cn_uuid"},{"line_number":690,"context_line":"            cn_uuid \u003d compute_nodes[migration.source_node]"},{"line_number":691,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_556bfc1c","line":688,"range":{"start_line":687,"start_character":16,"end_line":688,"end_character":67},"updated":"2017-10-13 13:18:59.000000000","message":"Need to handle ComputeNodeNotFound here probably, just so we don\u0027t mess up processing all instances in the loop if one node isn\u0027t found (maybe it was deleted while the service was down and things were being evacuated)? init_host is what would re-create the compute node here, so if it\u0027s a single node setup (e.g. libvirt), then the pre_start_hook which runs after this is going to recreate the compute node for this host.\n\nSo if we get ComputeNodeNotFound, we\u0027ll have to log something about not being able to cleanup allocations for the node in Placement.\n\nIf it is a libvirt host, then re-creating the compute node will give it a new uuid value and that means a new resource provider in placement anyway, so we wouldn\u0027t really care about the old stale provider allocations. But someone using ironic would probably care if the ironic nodes are still around.","commit_id":"1ef7e206bcfeef5108d57a946380bac2fa4e1105"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"90ced8d6640de8c6730c0d74f19532088f99fa6b","unresolved":false,"context_lines":[{"line_number":684,"context_line":""},{"line_number":685,"context_line":"            # delete the allocation of the evacuated instance from this host"},{"line_number":686,"context_line":"            if migration.source_node not in compute_nodes:"},{"line_number":687,"context_line":"                cn_uuid \u003d objects.ComputeNode.get_by_host_and_nodename("},{"line_number":688,"context_line":"                    context, self.host, migration.source_node).uuid"},{"line_number":689,"context_line":"                compute_nodes[migration.source_node] \u003d cn_uuid"},{"line_number":690,"context_line":"            cn_uuid \u003d compute_nodes[migration.source_node]"},{"line_number":691,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_89cdd967","line":688,"range":{"start_line":687,"start_character":16,"end_line":688,"end_character":67},"in_reply_to":"5f4e5783_556bfc1c","updated":"2017-10-13 15:08:55.000000000","message":"Done","commit_id":"1ef7e206bcfeef5108d57a946380bac2fa4e1105"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"947937f4679da6e352a7fa42ca7898cb135567eb","unresolved":false,"context_lines":[{"line_number":695,"context_line":"                    continue"},{"line_number":696,"context_line":"            cn_uuid \u003d compute_nodes[migration.source_node]"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"            my_resources \u003d scheduler_utils.resources_from_flavor("},{"line_number":699,"context_line":"                instance, instance.flavor)"},{"line_number":700,"context_line":"            res \u003d self.reportclient.remove_provider_from_instance_allocation("},{"line_number":701,"context_line":"                instance.uuid, cn_uuid, instance.user_id,"},{"line_number":702,"context_line":"                instance.project_id, my_resources)"},{"line_number":703,"context_line":"            if not res:"},{"line_number":704,"context_line":"                LOG.error(\"Failed to clean allocation of evacuated instance \""},{"line_number":705,"context_line":"                          \"on the source node %s\","},{"line_number":706,"context_line":"                          cn_uuid, instance\u003dinstance)"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"            migration.status \u003d \u0027completed\u0027"},{"line_number":709,"context_line":"            migration.save()"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f4e5783_fa4eff94","line":706,"range":{"start_line":698,"start_character":0,"end_line":706,"end_character":53},"updated":"2017-10-17 15:36:13.000000000","message":"That\u0027s the exact same (intentionnally) code than in RT\u0027s _delete_allocation_for_moved_instance() so I\u0027d love to see the duplications be merged in a follow-up.","commit_id":"9252ffdacf262008bc41409d4fb574ec472dc913"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e16cfe794a919cfea21550db96ff222036072551","unresolved":false,"context_lines":[{"line_number":695,"context_line":"                    continue"},{"line_number":696,"context_line":"            cn_uuid \u003d compute_nodes[migration.source_node]"},{"line_number":697,"context_line":""},{"line_number":698,"context_line":"            my_resources \u003d scheduler_utils.resources_from_flavor("},{"line_number":699,"context_line":"                instance, instance.flavor)"},{"line_number":700,"context_line":"            res \u003d self.reportclient.remove_provider_from_instance_allocation("},{"line_number":701,"context_line":"                instance.uuid, cn_uuid, instance.user_id,"},{"line_number":702,"context_line":"                instance.project_id, my_resources)"},{"line_number":703,"context_line":"            if not res:"},{"line_number":704,"context_line":"                LOG.error(\"Failed to clean allocation of evacuated instance \""},{"line_number":705,"context_line":"                          \"on the source node %s\","},{"line_number":706,"context_line":"                          cn_uuid, instance\u003dinstance)"},{"line_number":707,"context_line":""},{"line_number":708,"context_line":"            migration.status \u003d \u0027completed\u0027"},{"line_number":709,"context_line":"            migration.save()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f4b6375_3a18de7f","line":706,"range":{"start_line":698,"start_character":0,"end_line":706,"end_character":53},"in_reply_to":"5f4e5783_fa4eff94","updated":"2017-10-18 14:09:43.000000000","message":"follow up patch: https://review.openstack.org/#/c/513041/","commit_id":"9252ffdacf262008bc41409d4fb574ec472dc913"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2e00d66daf08cda0fb2ecf721ecf379f2ad75022","unresolved":false,"context_lines":[{"line_number":1208,"context_line":"            # delete_allocation_for_evacuated_instance as that is called during"},{"line_number":1209,"context_line":"            # init_host of the manager and that point the compute_nodes of the"},{"line_number":1210,"context_line":"            # rt has not been populated yet."},{"line_number":1211,"context_line":"            cn_uuid \u003d self._get_compute_node(context, node).uuid"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        res \u003d self.reportclient.remove_provider_from_instance_allocation("},{"line_number":1214,"context_line":"            instance.uuid, cn_uuid, instance.user_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f4e5783_943d3bbd","line":1211,"range":{"start_line":1211,"start_character":12,"end_line":1211,"end_character":64},"updated":"2017-10-11 13:28:14.000000000","message":"This could raise NotFound if we\u0027re restarting a failed host and the compute node record was deleted by the admin.","commit_id":"24dac729f1dc4cb24a8aa550a1e5b3fc0d6313f0"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e16e3b47565c84369ebf78d82dbc67393d3f9d00","unresolved":false,"context_lines":[{"line_number":694,"context_line":"            self.compute.init_host()"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"            mock_remove_allocation.assert_called_once_with("},{"line_number":697,"context_line":"                deleted_instance.uuid, uuids.our_node_uuid, \u0027fake-user\u0027,"},{"line_number":698,"context_line":"                \u0027fake-project\u0027, mock.sentinel.my_resources)"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        mock_init_host.assert_called_once_with(host\u003dour_host)"},{"line_number":701,"context_line":"        mock_host_get.assert_called_once_with(self.context, our_host,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_15dfc4d6","line":698,"range":{"start_line":697,"start_character":60,"end_line":698,"end_character":30},"updated":"2017-10-13 13:18:59.000000000","message":"nit: I\u0027d use the deleted_instance.user_id and deleted_instance.project_id just in case those values ever change.","commit_id":"1ef7e206bcfeef5108d57a946380bac2fa4e1105"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"90ced8d6640de8c6730c0d74f19532088f99fa6b","unresolved":false,"context_lines":[{"line_number":694,"context_line":"            self.compute.init_host()"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"            mock_remove_allocation.assert_called_once_with("},{"line_number":697,"context_line":"                deleted_instance.uuid, uuids.our_node_uuid, \u0027fake-user\u0027,"},{"line_number":698,"context_line":"                \u0027fake-project\u0027, mock.sentinel.my_resources)"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        mock_init_host.assert_called_once_with(host\u003dour_host)"},{"line_number":701,"context_line":"        mock_host_get.assert_called_once_with(self.context, our_host,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_69f73dd5","line":698,"range":{"start_line":697,"start_character":60,"end_line":698,"end_character":30},"in_reply_to":"5f4e5783_15dfc4d6","updated":"2017-10-13 15:08:55.000000000","message":"Done","commit_id":"1ef7e206bcfeef5108d57a946380bac2fa4e1105"}]}
