)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"87fca96f98e0b44c46fd978f3181e1452be5ee80","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            if self.driver.deallocate_networks_on_reschedule(instance):"},{"line_number":1947,"context_line":"                self._cleanup_allocated_networks(context, instance,"},{"line_number":1948,"context_line":"                        requested_networks)"},{"line_number":1949,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_0038223c","side":"PARENT","line":1946,"updated":"2016-02-23 12:19:07.000000000","message":"I guess you already have think about that, let me know you thinking about to redefine this method to accept \"requested_networks\" (which seems to be reasonable) - then override this method on libvirt driver to verify whether or not requested networks have VNIC_TYPE_DIRECT (see: libvirt._has_sriov_port()) ?","commit_id":"ce7bfcc350f23552ce6e057e37542292c7ae0b3f"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c593ae032631a634db001baa0a1227e7f804762c","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            if self.driver.deallocate_networks_on_reschedule(instance):"},{"line_number":1947,"context_line":"                self._cleanup_allocated_networks(context, instance,"},{"line_number":1948,"context_line":"                        requested_networks)"},{"line_number":1949,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_82c26f32","side":"PARENT","line":1946,"in_reply_to":"bae84128_0038223c","updated":"2016-02-23 14:56:02.000000000","message":"Thanks!\n\nI think the reason I preferred not to override driver.deallocate_networks_on_reschedule method is because I was convinced that cleaning sriov ports is a must for all of the drivers; overriding it would make it a driver specific issue..\n\nFor similar reasons, I wanted to make deallocate_sriov_ports_on_reschedule method available for all the drivers and I think it is a networking related validation, that would be kept in one place on the neutron side of things..\n\nDoes it make sense?\n\nAlso in the driver we should probably check vnic type is in network_model.VNIC_TYPES_SRIOV and not just VNIC_TYPE_DIRECT","commit_id":"ce7bfcc350f23552ce6e057e37542292c7ae0b3f"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6d474aa6338637af23404d38d67f88e542f5461b","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            if self.driver.deallocate_networks_on_reschedule(instance):"},{"line_number":1947,"context_line":"                self._cleanup_allocated_networks(context, instance,"},{"line_number":1948,"context_line":"                        requested_networks)"},{"line_number":1949,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_8bd532e6","side":"PARENT","line":1946,"in_reply_to":"bae84128_33ea9e74","updated":"2016-02-24 12:22:26.000000000","message":"Thanks Vladik that makes a lot of sense.","commit_id":"ce7bfcc350f23552ce6e057e37542292c7ae0b3f"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"9d07d4fbb1a084e3f2b68f5f722491e28403688a","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            if self.driver.deallocate_networks_on_reschedule(instance):"},{"line_number":1947,"context_line":"                self._cleanup_allocated_networks(context, instance,"},{"line_number":1948,"context_line":"                        requested_networks)"},{"line_number":1949,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_33ea9e74","side":"PARENT","line":1946,"in_reply_to":"bae84128_82c26f32","updated":"2016-02-24 11:46:25.000000000","message":"\u003e Also in the driver we should probably check vnic type is in network_model.VNIC_TYPES_SRIOV and not just VNIC_TYPE_DIRECT\n\nYep I\u0027ve noticed that we do this all over the place - we should probably fix it in a separate patch of course.","commit_id":"ce7bfcc350f23552ce6e057e37542292c7ae0b3f"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6d474aa6338637af23404d38d67f88e542f5461b","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            # NOTE(vladikr): SR-IOV ports should be deallocated to"},{"line_number":1947,"context_line":"            # to allow new devices to be allocated on a new host."},{"line_number":1948,"context_line":"            # Otherwise, if similar devices are already allocated on the"},{"line_number":1949,"context_line":"            # destination host, the instnce will fail to spawn."}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_2b0b467e","line":1946,"updated":"2016-02-24 12:22:26.000000000","message":"s/NOTE(vladikr):// and you duplicated \u0027to\u0027 s/to//","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c56f9e302b8fef2edc8afea41e8d8bb875bf256f","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            # NOTE(vladikr): SR-IOV ports should be deallocated to"},{"line_number":1947,"context_line":"            # to allow new devices to be allocated on a new host."},{"line_number":1948,"context_line":"            # Otherwise, if similar devices are already allocated on the"},{"line_number":1949,"context_line":"            # destination host, the instnce will fail to spawn."}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_da3c1e95","line":1946,"in_reply_to":"bae84128_2b0b467e","updated":"2016-02-24 14:58:22.000000000","message":"Done","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"9d07d4fbb1a084e3f2b68f5f722491e28403688a","unresolved":false,"context_lines":[{"line_number":1943,"context_line":"            retry[\u0027exc_reason\u0027] \u003d e.kwargs[\u0027reason\u0027]"},{"line_number":1944,"context_line":"            # NOTE(comstud): Deallocate networks if the driver wants"},{"line_number":1945,"context_line":"            # us to do so."},{"line_number":1946,"context_line":"            # NOTE(vladikr): SR-IOV ports should be deallocated to"},{"line_number":1947,"context_line":"            # to allow new devices to be allocated on a new host."},{"line_number":1948,"context_line":"            # Otherwise, if similar devices are already allocated on the"},{"line_number":1949,"context_line":"            # destination host, the instnce will fail to spawn."},{"line_number":1950,"context_line":"            if (self.driver.deallocate_networks_on_reschedule(instance) or"},{"line_number":1951,"context_line":"                self.network_api.deallocate_sriov_ports_on_reschedule(context,"},{"line_number":1952,"context_line":"                                                          requested_networks)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_ca22f751","line":1949,"range":{"start_line":1946,"start_character":30,"end_line":1949,"end_character":63},"updated":"2016-02-24 11:46:25.000000000","message":"This is complicated enough that it might be worth linking to the bug?","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6d474aa6338637af23404d38d67f88e542f5461b","unresolved":false,"context_lines":[{"line_number":1946,"context_line":"            # NOTE(vladikr): SR-IOV ports should be deallocated to"},{"line_number":1947,"context_line":"            # to allow new devices to be allocated on a new host."},{"line_number":1948,"context_line":"            # Otherwise, if similar devices are already allocated on the"},{"line_number":1949,"context_line":"            # destination host, the instnce will fail to spawn."},{"line_number":1950,"context_line":"            if (self.driver.deallocate_networks_on_reschedule(instance) or"},{"line_number":1951,"context_line":"                self.network_api.deallocate_sriov_ports_on_reschedule(context,"},{"line_number":1952,"context_line":"                                                          requested_networks)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_0ba12246","line":1949,"in_reply_to":"bae84128_ca22f751","updated":"2016-02-24 12:22:26.000000000","message":"Nikola If you think comment from Vladik is not enough clear we should to ask him to improve it but i do not think is good at all to have external link to get more information about something related to the code.","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"2a788562abae0f6827d5a99ae07fe8fbf8cf9b80","unresolved":false,"context_lines":[{"line_number":1950,"context_line":"            if (self.driver.deallocate_networks_on_reschedule(instance) or"},{"line_number":1951,"context_line":"                self.network_api.deallocate_sriov_ports_on_reschedule(context,"},{"line_number":1952,"context_line":"                                                          requested_networks)):"},{"line_number":1953,"context_line":"                self._cleanup_allocated_networks(context, instance,"},{"line_number":1954,"context_line":"                        requested_networks)"},{"line_number":1955,"context_line":"            else:"},{"line_number":1956,"context_line":"                # NOTE(alex_xu): Network already allocated and we don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_6b754e62","line":1953,"range":{"start_line":1953,"start_character":21,"end_line":1953,"end_character":48},"updated":"2016-02-24 12:07:47.000000000","message":"So one more thing that comes to mind here is that doing a port update here will cause a Neutron event to happen which might end up going to the new host and causing some issues (we\u0027ve seen races with nwinfo before).\n\nHopefully they are sorted now, but I wonder if it would be a bit safer to just do\n\n  instance.system_metadata[\u0027network_allocated\u0027] \u003d \u0027False\u0027 \n\nand do not clear the ports as they will be updated by the new allocation anyway even if we don\u0027t clear them here.\n\nIdeally we want to be consistent and clean up after ourselves, but I wonder if it might be good to be conservative in this case?","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"6d474aa6338637af23404d38d67f88e542f5461b","unresolved":false,"context_lines":[{"line_number":1950,"context_line":"            if (self.driver.deallocate_networks_on_reschedule(instance) or"},{"line_number":1951,"context_line":"                self.network_api.deallocate_sriov_ports_on_reschedule(context,"},{"line_number":1952,"context_line":"                                                          requested_networks)):"},{"line_number":1953,"context_line":"                self._cleanup_allocated_networks(context, instance,"},{"line_number":1954,"context_line":"                        requested_networks)"},{"line_number":1955,"context_line":"            else:"},{"line_number":1956,"context_line":"                # NOTE(alex_xu): Network already allocated and we don\u0027t"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_8eb3804c","line":1953,"in_reply_to":"bae84128_6b754e62","updated":"2016-02-24 12:22:26.000000000","message":"I do not have strong opinion on this, just feel like if we can we should to reset state before to re schedule.","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"462770571c57ee79bd1fedf9dfc646e171ab2da9","unresolved":false,"context_lines":[{"line_number":2009,"context_line":"            return build_results.FAILED"},{"line_number":2010,"context_line":""},{"line_number":2011,"context_line":"    def deallocate_sriov_ports_on_reschedule(self, network_info):"},{"line_number":2012,"context_line":"        \"\"\"Determins if networks are needed to be deallocated before reschedule"},{"line_number":2013,"context_line":""},{"line_number":2014,"context_line":"        Check the cached network info for any assigned SR-IOV ports."},{"line_number":2015,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aed3d3a_37e8a37c","line":2012,"updated":"2016-02-25 21:06:54.000000000","message":"s/Determins/Determine/","commit_id":"688602d3c2bb6eb18a3f9035122d750d3ef65b1d"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"24a7b38111c1ece1d10449148a51c1a94e878120","unresolved":false,"context_lines":[{"line_number":2009,"context_line":"            return build_results.FAILED"},{"line_number":2010,"context_line":""},{"line_number":2011,"context_line":"    def deallocate_sriov_ports_on_reschedule(self, network_info):"},{"line_number":2012,"context_line":"        \"\"\"Determins if networks are needed to be deallocated before reschedule"},{"line_number":2013,"context_line":""},{"line_number":2014,"context_line":"        Check the cached network info for any assigned SR-IOV ports."},{"line_number":2015,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aed3d3a_da3a0998","line":2012,"in_reply_to":"9aed3d3a_37e8a37c","updated":"2016-02-29 15:04:12.000000000","message":"Done","commit_id":"688602d3c2bb6eb18a3f9035122d750d3ef65b1d"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"49cb2661f9ab9eb6162c063859dd8910aa0a2899","unresolved":false,"context_lines":[{"line_number":2012,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"},{"line_number":2013,"context_line":"        in order to allow new sriov pci devices to be allocated on a new host."},{"line_number":2014,"context_line":"        \"\"\""},{"line_number":2015,"context_line":"        info_cache \u003d instance.info_cache"},{"line_number":2016,"context_line":""},{"line_number":2017,"context_line":"        def _has_sriov_port(vif):"},{"line_number":2018,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_d0bad3e0","line":2015,"range":{"start_line":2015,"start_character":8,"end_line":2015,"end_character":40},"updated":"2016-03-02 14:32:03.000000000","message":"So since the allocate_for_instance call is async. Won\u0027t we risk a race where we get here while the info has not been set on the instance (there is quite a bit of work that neutron does before hitting the get_instance_nw_info() which actually creates a the db record that we can lazy-load here.","commit_id":"e5fe18fed86d8857ffc032a97ffdb7d9c279254b"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"dac54f6785c2faf841c361f37eed18c931026581","unresolved":false,"context_lines":[{"line_number":2012,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"},{"line_number":2013,"context_line":"        in order to allow new sriov pci devices to be allocated on a new host."},{"line_number":2014,"context_line":"        \"\"\""},{"line_number":2015,"context_line":"        info_cache \u003d instance.info_cache"},{"line_number":2016,"context_line":""},{"line_number":2017,"context_line":"        def _has_sriov_port(vif):"},{"line_number":2018,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_586a29b4","line":2015,"range":{"start_line":2015,"start_character":8,"end_line":2015,"end_character":40},"in_reply_to":"7af24918_6095eadc","updated":"2016-03-03 10:35:04.000000000","message":"Ok so I thought about this some more, and changed my mind. We really should not be waiting for network_info here. It should be the responsibility of resource_setup code in case of any failure (and it currently is, but not in a systematic way so it\u0027s easy to introduce a new exception handler and not call wait by accident).\n\nThe most we should do is comment here that we expect it to be done.","commit_id":"e5fe18fed86d8857ffc032a97ffdb7d9c279254b"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"857553291f0377aec3fe687404332572c1759bb4","unresolved":false,"context_lines":[{"line_number":2012,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"},{"line_number":2013,"context_line":"        in order to allow new sriov pci devices to be allocated on a new host."},{"line_number":2014,"context_line":"        \"\"\""},{"line_number":2015,"context_line":"        info_cache \u003d instance.info_cache"},{"line_number":2016,"context_line":""},{"line_number":2017,"context_line":"        def _has_sriov_port(vif):"},{"line_number":2018,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_6095eadc","line":2015,"range":{"start_line":2015,"start_character":8,"end_line":2015,"end_character":40},"in_reply_to":"7af24918_d0bad3e0","updated":"2016-03-02 15:17:38.000000000","message":"Actually looking further at the code - it seems that all error paths actually call network_info.wait() so it seems that this will have been refreshed once it gets here.\n\nIt would still be good to a) add a comment or even better b) make sure we don\u0027t accidentally miss waiting on network_info here, as this is going to be very convoluted to debug if we happen to add an exception path that does not wait for nw_info)","commit_id":"e5fe18fed86d8857ffc032a97ffdb7d9c279254b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ba73bbd587767a56f21ad763ed6eb08b29db5d4","unresolved":false,"context_lines":[{"line_number":2021,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"},{"line_number":2022,"context_line":""},{"line_number":2023,"context_line":"        if (info_cache and info_cache.network_info):"},{"line_number":2024,"context_line":"            return any([_has_sriov_port(vif)"},{"line_number":2025,"context_line":"                        for vif in info_cache.network_info])"},{"line_number":2026,"context_line":""},{"line_number":2027,"context_line":"    def _build_and_run_instance(self, context, instance, image, injected_files,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_307964f7","line":2024,"updated":"2016-03-09 02:51:10.000000000","message":"nit: you don\u0027t really need to iterate through all vifs, you could just have a for loop and return True the first time _has_sriov_port is True, and return False otherwise, i.e.:\n\nfor vif in info_cache.network_info:\n    if _has_sriov_port(vif):\n        return True\nelse:\n    return False\n\nIt would also be nice to return True/False from this method rather than True/None, although the None works with the way you\u0027re using it above.","commit_id":"95e6ef1f45b21ccfe2c554c356c8eaf3f88126b9"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"87af601e3f50cd51b843d96b4394dd08f11950db","unresolved":false,"context_lines":[{"line_number":2021,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"},{"line_number":2022,"context_line":""},{"line_number":2023,"context_line":"        if (info_cache and info_cache.network_info):"},{"line_number":2024,"context_line":"            return any([_has_sriov_port(vif)"},{"line_number":2025,"context_line":"                        for vif in info_cache.network_info])"},{"line_number":2026,"context_line":""},{"line_number":2027,"context_line":"    def _build_and_run_instance(self, context, instance, image, injected_files,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_49c37e38","line":2024,"in_reply_to":"5aef4532_307964f7","updated":"2016-03-09 16:32:53.000000000","message":"Done","commit_id":"95e6ef1f45b21ccfe2c554c356c8eaf3f88126b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"77d2963c4a160f8536ec50e684aba950b0ee14ac","unresolved":false,"context_lines":[{"line_number":2008,"context_line":"                                               clean_task_state\u003dTrue)"},{"line_number":2009,"context_line":"            return build_results.FAILED"},{"line_number":2010,"context_line":""},{"line_number":2011,"context_line":"    def deallocate_sriov_ports_on_reschedule(self, instance):"},{"line_number":2012,"context_line":"        \"\"\"Determine if networks are needed to be deallocated before reschedule"},{"line_number":2013,"context_line":""},{"line_number":2014,"context_line":"        Check the cached network info for any assigned SR-IOV ports."}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_e884ba5e","line":2011,"updated":"2016-03-10 17:59:30.000000000","message":"It sort of feels like this should live in the network API...","commit_id":"77ab8f29ca19de7667ff32e798bdb4154a0c105e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"11ddb3eae36f55100a5996479b59b1dc7ea29050","unresolved":false,"context_lines":[{"line_number":2008,"context_line":"                                               clean_task_state\u003dTrue)"},{"line_number":2009,"context_line":"            return build_results.FAILED"},{"line_number":2010,"context_line":""},{"line_number":2011,"context_line":"    def deallocate_sriov_ports_on_reschedule(self, instance):"},{"line_number":2012,"context_line":"        \"\"\"Determine if networks are needed to be deallocated before reschedule"},{"line_number":2013,"context_line":""},{"line_number":2014,"context_line":"        Check the cached network info for any assigned SR-IOV ports."}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_cb1d7874","line":2011,"in_reply_to":"5aef4532_e884ba5e","updated":"2016-03-10 18:33:18.000000000","message":"I agree. Right now sometimes a port is tied to the physical host and other times it\u0027s not, but that isn\u0027t modeled well anywhere. Ideally the networking service would understand that it has a port for instance\u0027foo\u0027 on host \u0027bar\u0027 and Nova would just say \"hey we\u0027re moving to host \u0027baz\u0027 now, give me whatever network makes sense for that situation\" which would be the same one or a different one depending. Which is my long winded way of saying that I agree that it\u0027s more of a network API responsibility to make this determination.\n\nBut let\u0027s fix the bug first and then worry about cleaning this up.","commit_id":"77ab8f29ca19de7667ff32e798bdb4154a0c105e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f436aba80aef284453ff44428e807cddb58aa1f","unresolved":false,"context_lines":[{"line_number":2015,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"},{"line_number":2016,"context_line":"        in order to allow new sriov pci devices to be allocated on a new host."},{"line_number":2017,"context_line":"        \"\"\""},{"line_number":2018,"context_line":"        info_cache \u003d instance.info_cache"},{"line_number":2019,"context_line":""},{"line_number":2020,"context_line":"        def _has_sriov_port(vif):"},{"line_number":2021,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_556bcb1d","line":2018,"updated":"2016-03-10 17:56:10.000000000","message":"Is it worth checking if instance.system_metadata[\u0027network_allocated\u0027] is set before doing this?\n\nI guess it\u0027s probably not necessary because we can lazy-load the info_cache attribute:\n\nhttps://github.com/openstack/nova/blob/master/nova/objects/instance.py#L918","commit_id":"77ab8f29ca19de7667ff32e798bdb4154a0c105e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"11ddb3eae36f55100a5996479b59b1dc7ea29050","unresolved":false,"context_lines":[{"line_number":2015,"context_line":"        SR-IOV ports should be deallocated prior to rescheduling"},{"line_number":2016,"context_line":"        in order to allow new sriov pci devices to be allocated on a new host."},{"line_number":2017,"context_line":"        \"\"\""},{"line_number":2018,"context_line":"        info_cache \u003d instance.info_cache"},{"line_number":2019,"context_line":""},{"line_number":2020,"context_line":"        def _has_sriov_port(vif):"},{"line_number":2021,"context_line":"            return vif[\u0027vnic_type\u0027] in network_model.VNIC_TYPES_SRIOV"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_4b24c80b","line":2018,"in_reply_to":"5aef4532_556bcb1d","updated":"2016-03-10 18:33:18.000000000","message":"Where this is called it should always be set. It gets unset in _cleanup_allocate_networks which is called after this.","commit_id":"77ab8f29ca19de7667ff32e798bdb4154a0c105e"}],"nova/network/base_api.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"9d07d4fbb1a084e3f2b68f5f722491e28403688a","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        \"\"\"Deallocate port for instance.\"\"\""},{"line_number":216,"context_line":"        raise NotImplementedError()"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def deallocate_sriov_ports_on_reschedule(self, context,"},{"line_number":219,"context_line":"                                             requested_networks):"},{"line_number":220,"context_line":"        \"\"\"Determine if ports should be deallocated before reschedule.\"\"\""},{"line_number":221,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_5e080928","line":218,"range":{"start_line":218,"start_character":8,"end_line":218,"end_character":44},"updated":"2016-02-24 11:46:25.000000000","message":"I am not too happy about this name - it really should be something that implies it is a boolean check.\n\nAlso this sounds way too specific for a general API method. \n\nIt should be something like:\n\nshould_deallocate_on_reschedule() but even that seems poorly suited for a general purpose network API.","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"9d07d4fbb1a084e3f2b68f5f722491e28403688a","unresolved":false,"context_lines":[{"line_number":860,"context_line":"        in order to allow new sriov pci devices to allocated on the new host."},{"line_number":861,"context_line":"        \"\"\""},{"line_number":862,"context_line":"        def is_sriov_vnic_type(port_id):"},{"line_number":863,"context_line":"            vnic_type, _ \u003d self._get_port_vnic_info("},{"line_number":864,"context_line":"                                     context, neutron, port_id)"},{"line_number":865,"context_line":"            return vnic_type in network_model.VNIC_TYPES_SRIOV"},{"line_number":866,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_def1b996","line":863,"range":{"start_line":863,"start_character":33,"end_line":863,"end_character":51},"updated":"2016-02-24 11:46:25.000000000","message":"It\u0027s really unfortunate that we have to do this? It will add delay in the case of reschedule which will definitely impact the average perceived boot time for ALL instances.\n\nWe already have all this information a bit further down the stack where we call _build_resources.\n\nI wonder if we could re-uses it and be smarter about this","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"9d10e94a43eece6851eeeb7e3178fb7df272e4d5","unresolved":false,"context_lines":[{"line_number":860,"context_line":"        in order to allow new sriov pci devices to allocated on the new host."},{"line_number":861,"context_line":"        \"\"\""},{"line_number":862,"context_line":"        def is_sriov_vnic_type(port_id):"},{"line_number":863,"context_line":"            vnic_type, _ \u003d self._get_port_vnic_info("},{"line_number":864,"context_line":"                                     context, neutron, port_id)"},{"line_number":865,"context_line":"            return vnic_type in network_model.VNIC_TYPES_SRIOV"},{"line_number":866,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_8b8fe373","line":863,"range":{"start_line":863,"start_character":33,"end_line":863,"end_character":51},"in_reply_to":"bae84128_9f8f2174","updated":"2016-02-24 15:44:31.000000000","message":"Yeah that was my thinking as well...","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c56f9e302b8fef2edc8afea41e8d8bb875bf256f","unresolved":false,"context_lines":[{"line_number":860,"context_line":"        in order to allow new sriov pci devices to allocated on the new host."},{"line_number":861,"context_line":"        \"\"\""},{"line_number":862,"context_line":"        def is_sriov_vnic_type(port_id):"},{"line_number":863,"context_line":"            vnic_type, _ \u003d self._get_port_vnic_info("},{"line_number":864,"context_line":"                                     context, neutron, port_id)"},{"line_number":865,"context_line":"            return vnic_type in network_model.VNIC_TYPES_SRIOV"},{"line_number":866,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_9f8f2174","line":863,"range":{"start_line":863,"start_character":33,"end_line":863,"end_character":51},"in_reply_to":"bae84128_def1b996","updated":"2016-02-24 14:58:22.000000000","message":"Good point.\nFirst thing that comes to mind is to do pass the network_info variable with the exception, as below, but that would be too weird.. :)\n\nclass RescheduledException(NovaException):\n    def __init__(self, network_info):\n        self.network_info \u003d network_info\n\n...\nexcept RescheduledException as e:\n    print e.network_info\n\n\nI\u0027ll check what we can do with info_cache..","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"9d07d4fbb1a084e3f2b68f5f722491e28403688a","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        if not requested_networks:"},{"line_number":868,"context_line":"            return False"},{"line_number":869,"context_line":""},{"line_number":870,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":871,"context_line":"        return any([is_sriov_vnic_type(request_net.port_id)"},{"line_number":872,"context_line":"                    for request_net in requested_networks"},{"line_number":873,"context_line":"                    if request_net.port_id])"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_3e70a5a3","line":870,"range":{"start_line":870,"start_character":8,"end_line":870,"end_character":49},"updated":"2016-02-24 11:46:25.000000000","message":"This should be in the scope of is_sriov_nic function really","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c56f9e302b8fef2edc8afea41e8d8bb875bf256f","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        if not requested_networks:"},{"line_number":868,"context_line":"            return False"},{"line_number":869,"context_line":""},{"line_number":870,"context_line":"        neutron \u003d get_client(context, admin\u003dTrue)"},{"line_number":871,"context_line":"        return any([is_sriov_vnic_type(request_net.port_id)"},{"line_number":872,"context_line":"                    for request_net in requested_networks"},{"line_number":873,"context_line":"                    if request_net.port_id])"}],"source_content_type":"text/x-python","patch_set":1,"id":"bae84128_fc275b60","line":870,"range":{"start_line":870,"start_character":8,"end_line":870,"end_character":49},"in_reply_to":"bae84128_3e70a5a3","updated":"2016-02-24 14:58:22.000000000","message":"Done","commit_id":"570089bae44ead1db2796f890e5e0daca497c7fe"}],"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":"1ba73bbd587767a56f21ad763ed6eb08b29db5d4","unresolved":false,"context_lines":[{"line_number":3360,"context_line":"        vif2 \u003d fake_network_cache_model.new_vif()"},{"line_number":3361,"context_line":"        vif2[\u0027id\u0027] \u003d \u00272\u0027"},{"line_number":3362,"context_line":"        vif1[\u0027vnic_type\u0027] \u003d network_model.VNIC_TYPE_DIRECT"},{"line_number":3363,"context_line":"        nw_info \u003d network_model.NetworkInfo([vif1, vif2])"},{"line_number":3364,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context,"},{"line_number":3365,"context_line":"                vm_state\u003dvm_states.ACTIVE,"},{"line_number":3366,"context_line":"                system_metadata\u003d{\u0027network_allocated\u0027: \u0027True\u0027},"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_d0d760bd","line":3363,"updated":"2016-03-09 02:51:10.000000000","message":"This test might be more interesting if you had a non-sriov vnic type in the network_info cache, it\u0027s not a huge deal though.","commit_id":"95e6ef1f45b21ccfe2c554c356c8eaf3f88126b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"344bf1ce1e53a3ed5492130cb0a65ec3237c79db","unresolved":false,"context_lines":[{"line_number":3360,"context_line":"        vif2 \u003d fake_network_cache_model.new_vif()"},{"line_number":3361,"context_line":"        vif2[\u0027id\u0027] \u003d \u00272\u0027"},{"line_number":3362,"context_line":"        vif1[\u0027vnic_type\u0027] \u003d network_model.VNIC_TYPE_DIRECT"},{"line_number":3363,"context_line":"        nw_info \u003d network_model.NetworkInfo([vif1, vif2])"},{"line_number":3364,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context,"},{"line_number":3365,"context_line":"                vm_state\u003dvm_states.ACTIVE,"},{"line_number":3366,"context_line":"                system_metadata\u003d{\u0027network_allocated\u0027: \u0027True\u0027},"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_95171344","line":3363,"in_reply_to":"5aef4532_49489ecc","updated":"2016-03-10 17:43:30.000000000","message":"Ah right, good point. macvtap is the other one.","commit_id":"95e6ef1f45b21ccfe2c554c356c8eaf3f88126b9"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"87af601e3f50cd51b843d96b4394dd08f11950db","unresolved":false,"context_lines":[{"line_number":3360,"context_line":"        vif2 \u003d fake_network_cache_model.new_vif()"},{"line_number":3361,"context_line":"        vif2[\u0027id\u0027] \u003d \u00272\u0027"},{"line_number":3362,"context_line":"        vif1[\u0027vnic_type\u0027] \u003d network_model.VNIC_TYPE_DIRECT"},{"line_number":3363,"context_line":"        nw_info \u003d network_model.NetworkInfo([vif1, vif2])"},{"line_number":3364,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context,"},{"line_number":3365,"context_line":"                vm_state\u003dvm_states.ACTIVE,"},{"line_number":3366,"context_line":"                system_metadata\u003d{\u0027network_allocated\u0027: \u0027True\u0027},"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_49489ecc","line":3363,"in_reply_to":"5aef4532_d0d760bd","updated":"2016-03-09 16:32:53.000000000","message":"I do.. VNIC_TYPE_NORMAL isn\u0027t a sriov type","commit_id":"95e6ef1f45b21ccfe2c554c356c8eaf3f88126b9"}]}
