)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"98d088ed12756cbbc367ff85fad190b61ca25295","unresolved":false,"context_lines":[{"line_number":2808,"context_line":"                    context, instance, self.host)"},{"line_number":2809,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":2810,"context_line":"                                                                 instance)"},{"line_number":2811,"context_line":"        else:"},{"line_number":2812,"context_line":"            network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2813,"context_line":""},{"line_number":2814,"context_line":"        if bdms is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa6399be_03e2b403","line":2811,"updated":"2016-10-10 20:23:39.000000000","message":"This confuses me. Why only re-fetch the network info when recreating? Wouldn\u0027t evacuating to a different host also need this? I have a patch [1] that touches this same code for a different thing, and for me it was enough to just refresh the instance\u0027s info cache. Would the same work here? Are we better off changing this to always get network_info from the network API?\n\n[1] https://review.openstack.org/#/c/371048/6/nova/compute/manager.py@2813","commit_id":"ad7ec7c8fb6cc0b9abbe78670ad82800ce06a19a"},{"author":{"_account_id":6608,"name":"Paul Carlton","email":"paul.carlton2@hpe.com","username":"paul-carlton2"},"change_message_id":"7df9c7f22f0e6612e1fd09f3d03d33ae58bb7899","unresolved":false,"context_lines":[{"line_number":2808,"context_line":"                    context, instance, self.host)"},{"line_number":2809,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":2810,"context_line":"                                                                 instance)"},{"line_number":2811,"context_line":"        else:"},{"line_number":2812,"context_line":"            network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2813,"context_line":""},{"line_number":2814,"context_line":"        if bdms is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa6399be_b7302203","line":2811,"in_reply_to":"fa6399be_03e2b403","updated":"2016-10-12 07:57:53.000000000","message":"So as I understand it the recreate flag is only set if the rebuild is part of an evacuate so the change here specifically addresses the evacuate operation. The problem, as per the associated bug, that I\u0027m trying to address is that although the device id used by sirov ports is updated by Neutron the nova network_info is not updated. I looked at cold migrate (resize) and live migrate code and both those call the neutron network api method get_instance_nw_info so I thought changing evacuate processing to do the same seemed like a good plan.\n\nIn fixing this bug (which I did so I could backport the fix to our mitaka based product to address a customer issue) I took the approach I think is appropriate to bug fixes, i.e. make the smallest change possible to fix the bug.  I tested my change and it fixed the problem.  The neutron network api get_instance_nw_info method actually calls compute_utils.refresh_info_cache_for_instance so with respect to the changes to compute/manager.py my change would address your requirement to refresh the network info cache.  However my problem was that the network_info data did not match the Neutron view (which we had just updated from the migration context) and the call\nnw_info \u003d self._build_network_info_model(context, instance,...\nin ther neutron network api get_instance_nw_info method addresses this.\n\nSo in conclusion I think your change followed by mine will fix both issues.","commit_id":"ad7ec7c8fb6cc0b9abbe78670ad82800ce06a19a"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"922233882396e0e62c7fc6265b065422ba115f57","unresolved":false,"context_lines":[{"line_number":2808,"context_line":"                    context, instance, self.host)"},{"line_number":2809,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":2810,"context_line":"                                                                 instance)"},{"line_number":2811,"context_line":"        else:"},{"line_number":2812,"context_line":"            network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2813,"context_line":""},{"line_number":2814,"context_line":"        if bdms is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa6399be_9607a41c","line":2811,"in_reply_to":"fa6399be_b7302203","updated":"2016-10-18 22:15:51.000000000","message":"Thanks for the explanation :) For some reason I thought recreate and evacuation were distinct, when in fact the former is set to cause the latter.","commit_id":"ad7ec7c8fb6cc0b9abbe78670ad82800ce06a19a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ba0d8fb6cc85704fb6148be0f1513e029aff4bc7","unresolved":false,"context_lines":[{"line_number":2869,"context_line":"            # are so similar, we should really try to unify them."},{"line_number":2870,"context_line":"            self.network_api.setup_instance_network_on_host("},{"line_number":2871,"context_line":"                    context, instance, self.host)"},{"line_number":2872,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":2873,"context_line":"                                                                 instance)"},{"line_number":2874,"context_line":"        else:"},{"line_number":2875,"context_line":"            network_info \u003d compute_utils.get_nw_info_for_instance(instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffe62b97_8b8df17c","line":2872,"updated":"2017-03-27 11:48:12.000000000","message":"This suggests the above calls should really have done this already, but I guess this is OK for now.","commit_id":"9e8ba41c6ccce0be5402db797b75e4290486bb50"},{"author":{"_account_id":24777,"name":"Steven Webster","email":"steven.webster@windriver.com","username":"swebster"},"change_message_id":"2549a781d9f3d563bb879eae41f2ad1375a31d47","unresolved":false,"context_lines":[{"line_number":2931,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":2932,"context_line":"                                                                 instance)"},{"line_number":2933,"context_line":"        else:"},{"line_number":2934,"context_line":"            network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2935,"context_line":""},{"line_number":2936,"context_line":"        if bdms is None:"},{"line_number":2937,"context_line":"            bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":5,"id":"5f201791_a0906f96","line":2934,"updated":"2017-06-27 17:10:26.000000000","message":"This should be network_info \u003d instance.get_network_info() (see commit a4a9733f4a9ead01356f0f76c1bb1f04f905fa4e)","commit_id":"5dbc7db018862c8da7b35d4459d303d1f25987d3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d21d6099a22bd2596daf81ceb7c34a22dcd2431c","unresolved":false,"context_lines":[{"line_number":3039,"context_line":"            # For neutron this updates the host in the port binding"},{"line_number":3040,"context_line":"            # TODO(cfriesen): this network_api call and the one above"},{"line_number":3041,"context_line":"            # are so similar, we should really try to unify them."},{"line_number":3042,"context_line":"            self.network_api.setup_instance_network_on_host("},{"line_number":3043,"context_line":"                    context, instance, self.host, migration)"},{"line_number":3044,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":3045,"context_line":"                                                                 instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_e9d588e6","line":3042,"range":{"start_line":3042,"start_character":29,"end_line":3042,"end_character":59},"updated":"2018-08-08 23:03:44.000000000","message":"Alternatively, we could/should decorate this with @base_api.refresh_cache and then the instance.info_cache will be updated automatically for all callers of this method, which should probably happen if we\u0027re monkeying with host port bindings right?","commit_id":"9f4a4fad0cf598bc68281eb79756516c23ace9b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"68d34d6c8ddb7012de23e581e1d9fe9742afadec","unresolved":false,"context_lines":[{"line_number":3039,"context_line":"            # For neutron this updates the host in the port binding"},{"line_number":3040,"context_line":"            # TODO(cfriesen): this network_api call and the one above"},{"line_number":3041,"context_line":"            # are so similar, we should really try to unify them."},{"line_number":3042,"context_line":"            self.network_api.setup_instance_network_on_host("},{"line_number":3043,"context_line":"                    context, instance, self.host, migration)"},{"line_number":3044,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":3045,"context_line":"                                                                 instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_49359c45","line":3042,"range":{"start_line":3042,"start_character":29,"end_line":3042,"end_character":59},"in_reply_to":"3f79a3b5_e9d588e6","updated":"2018-08-08 23:05:44.000000000","message":"But, maybe that would have unintended consequences so we could add a TODO to investigate doing that on master in stein and then it wouldn\u0027t risk anything in backporting this.","commit_id":"9f4a4fad0cf598bc68281eb79756516c23ace9b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0a63956a946283f8df7ca0c72b6a7f490cdf80a6","unresolved":false,"context_lines":[{"line_number":3039,"context_line":"            # For neutron this updates the host in the port binding"},{"line_number":3040,"context_line":"            # TODO(cfriesen): this network_api call and the one above"},{"line_number":3041,"context_line":"            # are so similar, we should really try to unify them."},{"line_number":3042,"context_line":"            self.network_api.setup_instance_network_on_host("},{"line_number":3043,"context_line":"                    context, instance, self.host, migration)"},{"line_number":3044,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":3045,"context_line":"                                                                 instance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_29514063","line":3042,"range":{"start_line":3042,"start_character":29,"end_line":3042,"end_character":59},"in_reply_to":"3f79a3b5_e9d588e6","updated":"2018-08-08 23:16:13.000000000","message":"Heh, John said the same thing:\n\nhttps://review.openstack.org/#/c/382853/3/nova/compute/manager.py@2872","commit_id":"9f4a4fad0cf598bc68281eb79756516c23ace9b9"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a357746645c995326f4a18e623538c75061adc02","unresolved":false,"context_lines":[{"line_number":3059,"context_line":"             mock_get_nw_info,"},{"line_number":3060,"context_line":"             mock_get_blk,"},{"line_number":3061,"context_line":"             mock_upd"},{"line_number":3062,"context_line":"        ):"},{"line_number":3063,"context_line":"            fake_meta \u003d objects.ImageMeta(properties\u003dobjects.ImageMetaProps())"},{"line_number":3064,"context_line":"            instance \u003d fake_instance.fake_instance_obj(self.context,"},{"line_number":3065,"context_line":"                                            image_meta\u003dfake_meta,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_b1c004e2","line":3062,"updated":"2016-10-06 11:45:42.000000000","message":"wow","commit_id":"ad7ec7c8fb6cc0b9abbe78670ad82800ce06a19a"},{"author":{"_account_id":24777,"name":"Steven Webster","email":"steven.webster@windriver.com","username":"swebster"},"change_message_id":"e53ccdea5573fa84d26cf7c50d69b843ac4cd4df","unresolved":false,"context_lines":[{"line_number":3103,"context_line":"    @mock.patch.object(objects.Instance, \u0027save\u0027, return_value\u003dNone)"},{"line_number":3104,"context_line":"    @mock.patch.object(objects.ImageMeta, \u0027from_instance\u0027)"},{"line_number":3105,"context_line":"    @mock.patch.object(compute_utils, \u0027notify_usage_exists\u0027)"},{"line_number":3106,"context_line":"    def test_rebuild_nw_updated_if_recreate(self, mock_save, mock_image_ref,"},{"line_number":3107,"context_line":"                                            mock_notify_exists):"},{"line_number":3108,"context_line":"        with test.nested("},{"line_number":3109,"context_line":"            mock.patch.object(self.compute,"}],"source_content_type":"text/x-python","patch_set":3,"id":"bff0334d_4d0f4c2e","line":3106,"updated":"2017-04-06 00:31:38.000000000","message":"Looks like I also need to mock the compute_utils.notify_about_instance_usage to avoid a new \"_poison_configure\" exception seen in a couple of gate tests.","commit_id":"9e8ba41c6ccce0be5402db797b75e4290486bb50"}]}
