)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Recreate mdev devices according to placement"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Recreate mdev device according to provider tree dependence."},{"line_number":10,"context_line":"This PS task advantage of the fact that each gpu will"},{"line_number":11,"context_line":"only provide one vgpu type."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Close-bug: #1900800"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"5ac0bc10_d7e6ef02","line":10,"range":{"start_line":10,"start_character":8,"end_line":10,"end_character":12},"updated":"2021-10-26 08:39:02.000000000","message":"nit: takes","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4b9bf16548b70173c22a1af0975dbdf11d530c27","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"3cc8eeae_7efe92d7","updated":"2021-11-23 16:20:28.000000000","message":"As discussing in the IRC meeting, I\u0027m removing the Review-Prio label as no update happened since a while. Please ping me on IRC (bauzas) when you want me to review again.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"f5ffdfe1_9fbd2081","updated":"2021-10-26 08:39:02.000000000","message":"I have a bunch of comments inline. I\u0027m hard -1 on this due to calling _get_nodes() before initializing the virt driver.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b95854898496ecb353d6f1a910133fb5539d1dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"1eb83184_14455d86","updated":"2021-11-05 12:53:36.000000000","message":"I\u0027v realized further complications ","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"4c330606b76409adda03faf9cc553e8c1bb653f8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"97c1da8d_72a68348","updated":"2021-10-13 00:07:53.000000000","message":"recheck","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"32094b486914e34eb6d0dfb15e6f11022f566c89","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"c3204454_e8d505aa","updated":"2021-10-13 03:15:45.000000000","message":"recheck","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":33384,"name":"Tiago Octaviano Primini","display_name":"Tiago Primini","email":"tiagooctaviano.primini@windriver.com","username":"tiago-primini"},"change_message_id":"723b77e8a2c49697a067ece91a38fdb4fbe911f1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"0f576f90_9bbad515","updated":"2021-11-03 16:40:30.000000000","message":"we have tested this latest ps in a simplex lab using a nvidia t4 and the changes are working properly.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"}],"nova/compute/manager.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":1362,"context_line":"        \"\"\""},{"line_number":1363,"context_line":"        nodes_by_uuid \u003d {}"},{"line_number":1364,"context_line":"        try:"},{"line_number":1365,"context_line":"            node_names \u003d self.driver.get_available_nodes() or []"},{"line_number":1366,"context_line":"        except exception.VirtDriverNotReady:"},{"line_number":1367,"context_line":"            LOG.warning("},{"line_number":1368,"context_line":"                \"Virt driver is not ready. If this is the first time this \""}],"source_content_type":"text/x-python","patch_set":5,"id":"342f7998_792e464d","line":1365,"range":{"start_line":1365,"start_character":58,"end_line":1365,"end_character":64},"updated":"2021-10-07 22:00:14.000000000","message":"This does not seem necessary. get_available_nodes already returns a list.","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"d415bb7a3b2bedadc3f5896c5050e45dc1e0ad35","unresolved":true,"context_lines":[{"line_number":1362,"context_line":"        \"\"\""},{"line_number":1363,"context_line":"        nodes_by_uuid \u003d {}"},{"line_number":1364,"context_line":"        try:"},{"line_number":1365,"context_line":"            node_names \u003d self.driver.get_available_nodes() or []"},{"line_number":1366,"context_line":"        except exception.VirtDriverNotReady:"},{"line_number":1367,"context_line":"            LOG.warning("},{"line_number":1368,"context_line":"                \"Virt driver is not ready. If this is the first time this \""}],"source_content_type":"text/x-python","patch_set":5,"id":"975a3d74_14fc7e29","line":1365,"range":{"start_line":1365,"start_character":58,"end_line":1365,"end_character":64},"in_reply_to":"342f7998_792e464d","updated":"2021-10-08 07:37:25.000000000","message":"unfortunately, I think this part is still needed for security reasons... the reasoning is fake driver requires init_host called before get_available_nodes... and it will return None otherwise which causes _get_nodes failed...","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"4ed40aa58530094db63f761ca5c3a89f63357a73","unresolved":true,"context_lines":[{"line_number":1362,"context_line":"        \"\"\""},{"line_number":1363,"context_line":"        nodes_by_uuid \u003d {}"},{"line_number":1364,"context_line":"        try:"},{"line_number":1365,"context_line":"            node_names \u003d self.driver.get_available_nodes() or []"},{"line_number":1366,"context_line":"        except exception.VirtDriverNotReady:"},{"line_number":1367,"context_line":"            LOG.warning("},{"line_number":1368,"context_line":"                \"Virt driver is not ready. If this is the first time this \""}],"source_content_type":"text/x-python","patch_set":5,"id":"d0fb4814_356be6ba","line":1365,"range":{"start_line":1365,"start_character":58,"end_line":1365,"end_character":64},"in_reply_to":"975a3d74_14fc7e29","updated":"2021-10-08 20:15:49.000000000","message":"I\u0027d tend to think we should update the fake driver to better reflect reality instead of accounting for it here in the real implementation. Prior to your change, init_host was always called before get_available_nodes but your change demonstrates that it\u0027s valid to call get_available_nodes first ... So maybe we should just init the fake driver\u0027s _nodes \u003d [] instead of doing this?","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"62f608de8079d430076c30f1f1b0b6880d522d8a","unresolved":false,"context_lines":[{"line_number":1362,"context_line":"        \"\"\""},{"line_number":1363,"context_line":"        nodes_by_uuid \u003d {}"},{"line_number":1364,"context_line":"        try:"},{"line_number":1365,"context_line":"            node_names \u003d self.driver.get_available_nodes() or []"},{"line_number":1366,"context_line":"        except exception.VirtDriverNotReady:"},{"line_number":1367,"context_line":"            LOG.warning("},{"line_number":1368,"context_line":"                \"Virt driver is not ready. If this is the first time this \""}],"source_content_type":"text/x-python","patch_set":5,"id":"fbbc6c92_e5ffc3d3","line":1365,"range":{"start_line":1365,"start_character":58,"end_line":1365,"end_character":64},"in_reply_to":"d0fb4814_356be6ba","updated":"2021-10-09 05:47:58.000000000","message":"Done","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context) or []"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":5,"id":"12e91707_cfe08697","line":1419,"range":{"start_line":1419,"start_character":48,"end_line":1419,"end_character":54},"updated":"2021-10-07 22:00:14.000000000","message":"This does not seem necessary. And _get_nodes returns a dict, not a list.","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"d415bb7a3b2bedadc3f5896c5050e45dc1e0ad35","unresolved":false,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context) or []"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":5,"id":"befc641b_23f4f62e","line":1419,"range":{"start_line":1419,"start_character":48,"end_line":1419,"end_character":54},"in_reply_to":"12e91707_cfe08697","updated":"2021-10-08 07:37:25.000000000","message":"Done","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"},{"line_number":1423,"context_line":"                _node_allocs \u003d \\"},{"line_number":1424,"context_line":"                    self.reportclient.get_allocations_for_resource_provider("},{"line_number":1425,"context_line":"                        context, node_uuid).allocations"},{"line_number":1426,"context_line":"                for consumer in _node_allocs:"}],"source_content_type":"text/x-python","patch_set":5,"id":"296b7548_9216f836","line":1423,"updated":"2021-10-07 22:00:14.000000000","message":"Note to self: this is a dict keyed by consumer uuid (which maps to instance uuid).","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":1423,"context_line":"                _node_allocs \u003d \\"},{"line_number":1424,"context_line":"                    self.reportclient.get_allocations_for_resource_provider("},{"line_number":1425,"context_line":"                        context, node_uuid).allocations"},{"line_number":1426,"context_line":"                for consumer in _node_allocs:"},{"line_number":1427,"context_line":"                    consumer_dict[consumer] \u003d \\"},{"line_number":1428,"context_line":"                        self.reportclient.get_allocations_for_consumer("},{"line_number":1429,"context_line":"                            context, consumer)"},{"line_number":1430,"context_line":"            for consumer_id in consumer_dict:"},{"line_number":1431,"context_line":"                for rp_id in consumer_dict[consumer_id]:"},{"line_number":1432,"context_line":"                    if rp_id not in provider_dict:"}],"source_content_type":"text/x-python","patch_set":5,"id":"2d164440_bc5eae8d","line":1429,"range":{"start_line":1426,"start_character":16,"end_line":1429,"end_character":46},"updated":"2021-10-07 22:00:14.000000000","message":"At first I thought this is redundant because allocations were already retrieved on L1424 but this is different in that it is pulling allocations for an instance from all resource providers. AFAIK the only time we expect an instance to have allocations on more than one resource provider is during a migration.","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605999b84e5241af38abfd49894ad411e566552c","unresolved":true,"context_lines":[{"line_number":1435,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1436,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1437,"context_line":"                                context, rp_id)"},{"line_number":1438,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1439,"context_line":"            # if a compute node starts the first time"},{"line_number":1440,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1441,"context_line":"            # does not get a resource provider uuid"}],"source_content_type":"text/x-python","patch_set":6,"id":"86b5e615_55e6f63d","line":1438,"updated":"2021-10-08 14:00:20.000000000","message":"ok, you catch the same exception for three calls, it\u0027s fine.\n\nTBC, I would have preferred to have a catch for every call, but given the provided exceptions are the same, that\u0027s OK","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605999b84e5241af38abfd49894ad411e566552c","unresolved":true,"context_lines":[{"line_number":1439,"context_line":"            # if a compute node starts the first time"},{"line_number":1440,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1441,"context_line":"            # does not get a resource provider uuid"},{"line_number":1442,"context_line":"            LOG.debug(\"Failed to find a node in placement\")"},{"line_number":1443,"context_line":""},{"line_number":1444,"context_line":"        self.driver.init_host(host\u003dself.host, allocs\u003dconsumer_dict,"},{"line_number":1445,"context_line":"                              rps\u003dprovider_dict)"}],"source_content_type":"text/x-python","patch_set":6,"id":"345e0f34_72be7115","line":1442,"range":{"start_line":1442,"start_character":22,"end_line":1442,"end_character":58},"updated":"2021-10-08 14:00:20.000000000","message":"That\u0027s actually why I\u0027d prefer to have a specific catch for every call, because here we don\u0027t know whether we got an exception because of a missing customer, a missing node or a RP and also, *which one*\n\nHonestly, this debug log can\u0027t help operators. Also, should it be a debug level or a warning one ?","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"090ac5d9ebad4542d99eb583ee8b86e5c4886a0f","unresolved":true,"context_lines":[{"line_number":1439,"context_line":"            # if a compute node starts the first time"},{"line_number":1440,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1441,"context_line":"            # does not get a resource provider uuid"},{"line_number":1442,"context_line":"            LOG.debug(\"Failed to find a node in placement\")"},{"line_number":1443,"context_line":""},{"line_number":1444,"context_line":"        self.driver.init_host(host\u003dself.host, allocs\u003dconsumer_dict,"},{"line_number":1445,"context_line":"                              rps\u003dprovider_dict)"}],"source_content_type":"text/x-python","patch_set":6,"id":"d6c3249c_8d1938ed","line":1442,"range":{"start_line":1442,"start_character":22,"end_line":1442,"end_character":58},"in_reply_to":"345e0f34_72be7115","updated":"2021-10-08 14:50:50.000000000","message":"thank you for reviewing it. if making it warning, this implies that there will be a warning log  every time a new nova-compute node starts.. I am afraid this might be confusing...","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"75432e1411b8dc527ff606d1597e1ade09ae3fb7","unresolved":true,"context_lines":[{"line_number":1439,"context_line":"            # does not get a resource provider uuid"},{"line_number":1440,"context_line":"            LOG.debug(\"Failed to find a node in placement\")"},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"        self.driver.init_host(host\u003dself.host, allocs\u003dconsumer_dict,"},{"line_number":1443,"context_line":"                              rps\u003dprovider_dict)"},{"line_number":1444,"context_line":""},{"line_number":1445,"context_line":"        instances \u003d objects.InstanceList.get_by_host("},{"line_number":1446,"context_line":"            context, self.host,"}],"source_content_type":"text/x-python","patch_set":8,"id":"6e12c27b_80b609f3","line":1443,"range":{"start_line":1442,"start_character":6,"end_line":1443,"end_character":48},"updated":"2021-10-11 13:12:28.000000000","message":"i think you should catch the atribute error if the driver has not beeen updated to accpet kwargs\n\ncatching the error and calling driver.init_host(self.host) will allow out of tree driver to work and we can drop that after yoga has released.\n\nalso -1 for useing the kwargs syntax for host which is a postional arg","commit_id":"7078128e0de057d858889fc23be55b768013c734"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"916e4d1bf082d6fcd7ebe8cd0c8fd52c8d317bab","unresolved":false,"context_lines":[{"line_number":1439,"context_line":"            # does not get a resource provider uuid"},{"line_number":1440,"context_line":"            LOG.debug(\"Failed to find a node in placement\")"},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"        self.driver.init_host(host\u003dself.host, allocs\u003dconsumer_dict,"},{"line_number":1443,"context_line":"                              rps\u003dprovider_dict)"},{"line_number":1444,"context_line":""},{"line_number":1445,"context_line":"        instances \u003d objects.InstanceList.get_by_host("},{"line_number":1446,"context_line":"            context, self.host,"}],"source_content_type":"text/x-python","patch_set":8,"id":"f75a61fc_815e844f","line":1443,"range":{"start_line":1442,"start_character":6,"end_line":1443,"end_character":48},"in_reply_to":"6e12c27b_80b609f3","updated":"2021-10-13 10:24:51.000000000","message":"Done","commit_id":"7078128e0de057d858889fc23be55b768013c734"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context)"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"edbe611c_7a2ff213","line":1419,"range":{"start_line":1419,"start_character":24,"end_line":1419,"end_character":48},"updated":"2021-10-26 08:39:02.000000000","message":"I think this is broken. This calls self.driver.get_available_nodes() but we haven\u0027t called self.driver.init_host() yet so the driver is probably not ready yet. So this call will always return an empty dict.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"0db1a510f3006e8f62596e30d2d712307500733b","unresolved":true,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context)"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"6b8126e2_3d66bee6","line":1419,"range":{"start_line":1419,"start_character":24,"end_line":1419,"end_character":48},"in_reply_to":"1d2fb549_2247b24c","updated":"2021-11-05 02:03:00.000000000","message":"seems reasonable, but the self.driver.get_available_nodes() really can get the current host\u0027s name.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cc3090fbb3192967e3a7cbbfc3c7174ad5053d56","unresolved":true,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context)"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1d2fb549_2247b24c","line":1419,"range":{"start_line":1419,"start_character":24,"end_line":1419,"end_character":48},"in_reply_to":"5c15c4c8_898f2e96","updated":"2021-11-04 17:04:19.000000000","message":"I think we should not use the libvirt connection before driver.init_host. See [1]\n\n[1] https://github.com/openstack/nova/blob/ee91d92f9105aa7e7b1e45a47f70b8989b458a68/nova/virt/libvirt/host.py#L609-L612","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b95854898496ecb353d6f1a910133fb5539d1dd","unresolved":true,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context)"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"49eab685_f7b29805","line":1419,"range":{"start_line":1419,"start_character":24,"end_line":1419,"end_character":48},"in_reply_to":"6b8126e2_3d66bee6","updated":"2021-11-05 12:53:36.000000000","message":"As self.driver.get_available_nodes() uses self._host therefore using the libvirt connection to get the nodes I don\u0027t think it is safe to use before driver.init_host. The comment in [1] clearly state that we should not use the libvirt connection before the error handlers are set up. As those are set up in init_host we should first call init_host and then we can start using get_available_nodes()","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"e19b0cadf68cfcb0a07503a09b399d5ec4a095d7","unresolved":true,"context_lines":[{"line_number":1416,"context_line":"        consumer_dict \u003d {}"},{"line_number":1417,"context_line":"        provider_dict \u003d {}"},{"line_number":1418,"context_line":"        context \u003d nova.context.get_admin_context()"},{"line_number":1419,"context_line":"        nodes_by_uuid \u003d self._get_nodes(context)"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5c15c4c8_898f2e96","line":1419,"range":{"start_line":1419,"start_character":24,"end_line":1419,"end_character":48},"in_reply_to":"edbe611c_7a2ff213","updated":"2021-10-29 02:45:31.000000000","message":"Not exactly, we can get node_name by getHostname(), and get node by node_name.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"e19b0cadf68cfcb0a07503a09b399d5ec4a095d7","unresolved":true,"context_lines":[{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"},{"line_number":1423,"context_line":"                _node_allocs \u003d \\"},{"line_number":1424,"context_line":"                    self.reportclient.get_allocations_for_resource_provider("},{"line_number":1425,"context_line":"                        context, node_uuid).allocations"},{"line_number":1426,"context_line":"                for consumer in _node_allocs:"}],"source_content_type":"text/x-python","patch_set":9,"id":"0f0e56e6_c332da02","line":1423,"range":{"start_line":1423,"start_character":31,"end_line":1423,"end_character":32},"updated":"2021-10-29 02:45:31.000000000","message":"nit, as gibi says below.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1421,"context_line":"        try:"},{"line_number":1422,"context_line":"            for node_uuid in nodes_by_uuid:"},{"line_number":1423,"context_line":"                _node_allocs \u003d \\"},{"line_number":1424,"context_line":"                    self.reportclient.get_allocations_for_resource_provider("},{"line_number":1425,"context_line":"                        context, node_uuid).allocations"},{"line_number":1426,"context_line":"                for consumer in _node_allocs:"},{"line_number":1427,"context_line":"                    consumer_dict[consumer] \u003d \\"},{"line_number":1428,"context_line":"                        self.reportclient.get_allocations_for_consumer("}],"source_content_type":"text/x-python","patch_set":9,"id":"6d59e3b2_194fb1e9","line":1425,"range":{"start_line":1424,"start_character":38,"end_line":1425,"end_character":43},"updated":"2021-10-26 08:39:02.000000000","message":"This logic also finds the migration consumers against this compute RP which we need as an ongoing migration still consumes VGPUs on the source host so recreating the mdevs for it is needed e.g. if the migration is later reverted and therefore the VM needs to be restarted on this host.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1423,"context_line":"                _node_allocs \u003d \\"},{"line_number":1424,"context_line":"                    self.reportclient.get_allocations_for_resource_provider("},{"line_number":1425,"context_line":"                        context, node_uuid).allocations"},{"line_number":1426,"context_line":"                for consumer in _node_allocs:"},{"line_number":1427,"context_line":"                    consumer_dict[consumer] \u003d \\"},{"line_number":1428,"context_line":"                        self.reportclient.get_allocations_for_consumer("},{"line_number":1429,"context_line":"                            context, consumer)"}],"source_content_type":"text/x-python","patch_set":9,"id":"2b4c6d03_6f2e22b2","line":1426,"range":{"start_line":1426,"start_character":20,"end_line":1426,"end_character":45},"updated":"2021-10-26 08:39:02.000000000","message":"This assumes that all nova managed allocation has resources from the root RP (node_uuid). This assumption holds today, but I suggest to document this assumption in a comment here.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1424,"context_line":"                    self.reportclient.get_allocations_for_resource_provider("},{"line_number":1425,"context_line":"                        context, node_uuid).allocations"},{"line_number":1426,"context_line":"                for consumer in _node_allocs:"},{"line_number":1427,"context_line":"                    consumer_dict[consumer] \u003d \\"},{"line_number":1428,"context_line":"                        self.reportclient.get_allocations_for_consumer("},{"line_number":1429,"context_line":"                            context, consumer)"},{"line_number":1430,"context_line":"            for consumer_id in consumer_dict:"}],"source_content_type":"text/x-python","patch_set":9,"id":"4781e1d3_46f01039","line":1427,"range":{"start_line":1427,"start_character":46,"end_line":1427,"end_character":47},"updated":"2021-10-26 08:39:02.000000000","message":"nit: instead of backslash I suggest to use ():\n\n                  consumer_dict[consumer] \u003d (\n                      self.reportclient.get_allocations_for_consumer(\n                            context, consumer)\n                  )","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1430,"context_line":"            for consumer_id in consumer_dict:"},{"line_number":1431,"context_line":"                for rp_id in consumer_dict[consumer_id]:"},{"line_number":1432,"context_line":"                    if rp_id not in provider_dict:"},{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5065fd59_c6bda0b7","line":1433,"range":{"start_line":1433,"start_character":47,"end_line":1433,"end_character":48},"updated":"2021-10-26 08:39:02.000000000","message":"nit: ditto","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"e19b0cadf68cfcb0a07503a09b399d5ec4a095d7","unresolved":true,"context_lines":[{"line_number":1430,"context_line":"            for consumer_id in consumer_dict:"},{"line_number":1431,"context_line":"                for rp_id in consumer_dict[consumer_id]:"},{"line_number":1432,"context_line":"                    if rp_id not in provider_dict:"},{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"}],"source_content_type":"text/x-python","patch_set":9,"id":"f710378e_7f59cb6a","line":1433,"range":{"start_line":1433,"start_character":24,"end_line":1433,"end_character":37},"updated":"2021-10-29 02:45:31.000000000","message":"we can filter vgpu rp here and transport only vgpu rps.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b95854898496ecb353d6f1a910133fb5539d1dd","unresolved":true,"context_lines":[{"line_number":1431,"context_line":"                for rp_id in consumer_dict[consumer_id]:"},{"line_number":1432,"context_line":"                    if rp_id not in provider_dict:"},{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"}],"source_content_type":"text/x-python","patch_set":9,"id":"98a51e4a_2a5d6dfd","line":1434,"range":{"start_line":1434,"start_character":46,"end_line":1434,"end_character":68},"updated":"2021-11-05 12:53:36.000000000","message":"This can return None at least in two distinct cases. \n1) The RP does not exists in placement, i.e. first start of the compute service\n2) The connection towards placement is failing (see the save_connect decorator on top of the _get_resource_provider call). It can be network issue, config issue etc.\n\nThis later in the libvirt driver will lead to TypeError","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"}],"source_content_type":"text/x-python","patch_set":9,"id":"03ed7d2f_6f73cdbe","line":1436,"updated":"2021-10-26 08:39:02.000000000","message":"What if placement is down when the compute is restarting while there are instances on the host with VGPU. I think with this patch we call init_host without allocation information and the libvirt driver will log \"instance %s allocates vgpu device but does not have allocations in placement\". This is misleading as in this case we simply don\u0027t know if there are allocation in placement or not as placement was down.\n\nI don\u0027t know what will be a good solution. @Others: should we block compute startup if placement is not available?","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"e19b0cadf68cfcb0a07503a09b399d5ec4a095d7","unresolved":true,"context_lines":[{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"}],"source_content_type":"text/x-python","patch_set":9,"id":"284a0776_fabd7c07","line":1436,"in_reply_to":"03ed7d2f_6f73cdbe","updated":"2021-10-29 02:45:31.000000000","message":"gibi, if placement service is down, we cannot start nova-compute service and reach here.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fbc82130e6f0682c6fe51d79fc9d0e4d7ebf5837","unresolved":true,"context_lines":[{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"}],"source_content_type":"text/x-python","patch_set":9,"id":"b5cdcc68_e2266649","line":1436,"in_reply_to":"284a0776_fabd7c07","updated":"2021-11-04 16:59:33.000000000","message":"hm, where do we have that code that blocks starting nova-compute if placement is down?","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"0db1a510f3006e8f62596e30d2d712307500733b","unresolved":true,"context_lines":[{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"}],"source_content_type":"text/x-python","patch_set":9,"id":"e17304ab_51bab15d","line":1436,"in_reply_to":"b5cdcc68_e2266649","updated":"2021-11-05 02:03:00.000000000","message":"when the nova-compute service is start, it will create service at[1], nova-compute will init ComputeManager, and generate reportclient at[2], the SchedulerReportClient will call Placement to create placementclient[3]. so if placement service is down, nova-compute will break at starting.\nhttps://review.opendev.org/plugins/gitiles/openstack/nova/+/refs/heads/master/nova/cmd/compute.py#59\nhttps://review.opendev.org/plugins/gitiles/openstack/nova/+/refs/heads/master/nova/compute/manager.py#535\nhttps://review.opendev.org/plugins/gitiles/openstack/nova/+/refs/heads/master/nova/scheduler/client/report.py#188","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b95854898496ecb353d6f1a910133fb5539d1dd","unresolved":true,"context_lines":[{"line_number":1433,"context_line":"                        provider_dict[rp_id] \u003d \\"},{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"}],"source_content_type":"text/x-python","patch_set":9,"id":"b97f90a4_5c4d7fc6","line":1436,"in_reply_to":"e17304ab_51bab15d","updated":"2021-11-05 12:53:36.000000000","message":"Ups, you are right. The nova-compute service fails to start if placement is down. (With a misleading error:  Unhandled error: openstack.exceptions.NotSupported: The placement service for 192.168.121.179:RegionOne exists but does not have any supported versions.)\n\nI\u0027ve just realized that ResourceProviderAllocationRetrievalFailed is not raised if the RP does not exists, in that case the call returns None. Also this is not raised if placement cannot be reached as that will be caught by the safe_connect decorator on top of _get_resource_provider() and that also returns None.\n\nI don\u0027t think we should ignore ResourceProviderAllocationRetrievalFailed and move forward. We should stop the compute service startup instead. Right now Placement does not declare any other response code other than 404 and 200 (both handled without ResourceProviderAllocationRetrievalFailed). So whatever resulting in a ResourceProviderAllocationRetrievalFailed should be a serious problem warranting us to just top.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b95854898496ecb353d6f1a910133fb5539d1dd","unresolved":true,"context_lines":[{"line_number":1434,"context_line":"                            self.reportclient._get_resource_provider("},{"line_number":1435,"context_line":"                                context, rp_id)"},{"line_number":1436,"context_line":"        except exception.ResourceProviderAllocationRetrievalFailed:"},{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"},{"line_number":1440,"context_line":"            LOG.debug(\"Failed to find a node in placement\")"},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"b6fa2c69_ff9e2adc","line":1439,"range":{"start_line":1437,"start_character":0,"end_line":1439,"end_character":51},"updated":"2021-11-05 12:53:36.000000000","message":"This is not true, if placement returns 404 then the report client does not raise ResourceProviderAllocationRetrievalFailed exception but simply returns None.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1437,"context_line":"            # if a compute node starts the first time"},{"line_number":1438,"context_line":"            # it is possible that it has a node_uuid but"},{"line_number":1439,"context_line":"            # does not get a resource provider uuid"},{"line_number":1440,"context_line":"            LOG.debug(\"Failed to find a node in placement\")"},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"        try:"},{"line_number":1443,"context_line":"            self.driver.init_host(self.host, allocs\u003dconsumer_dict,"}],"source_content_type":"text/x-python","patch_set":9,"id":"0debd189_e8aa4d55","line":1440,"range":{"start_line":1440,"start_character":12,"end_line":1440,"end_character":59},"updated":"2021-10-26 08:39:02.000000000","message":"nit: I would mention in the log that it is OK if this is the first start of the compute","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":1442,"context_line":"        try:"},{"line_number":1443,"context_line":"            self.driver.init_host(self.host, allocs\u003dconsumer_dict,"},{"line_number":1444,"context_line":"                                  rps\u003dprovider_dict)"},{"line_number":1445,"context_line":"        except TypeError:"},{"line_number":1446,"context_line":"            LOG.warning(\"Driver does not allow new arguments, please\""},{"line_number":1447,"context_line":"                        \" consider updating. Fall back to old arguments\")"},{"line_number":1448,"context_line":"            self.driver.init_host(self.host)"},{"line_number":1449,"context_line":""},{"line_number":1450,"context_line":"        instances \u003d objects.InstanceList.get_by_host("}],"source_content_type":"text/x-python","patch_set":9,"id":"6e351683_eee1812f","line":1447,"range":{"start_line":1445,"start_character":0,"end_line":1447,"end_character":73},"updated":"2021-10-26 08:39:02.000000000","message":"I\u0027m not sure we should take up complexity for the out of tree virt drivers. I think an ML post notifying them about the interface change should be enough instead.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":1299,"context_line":"    @mock.patch(\u0027nova.compute.manager.ComputeManager._get_nodes\u0027)"},{"line_number":1300,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1301,"context_line":"                \u0027_get_resource_provider\u0027)"},{"line_number":1302,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1303,"context_line":"                \u0027get_allocations_for_provider_tree\u0027)"},{"line_number":1304,"context_line":"    def test_init_host_with_vgpu("},{"line_number":1305,"context_line":"            self, mock_get_allocs_pt, mock_get_rp, mock_get_nodes,"},{"line_number":1306,"context_line":"            mock__init_inst, mock__destroy_eva, mock_get_by_host):"}],"source_content_type":"text/x-python","patch_set":5,"id":"716bcd73_5d35fb0c","line":1303,"range":{"start_line":1302,"start_character":4,"end_line":1303,"end_character":52},"updated":"2021-10-07 22:00:14.000000000","message":"This seems irrelevant, you\u0027re not calling this method in init_host.","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"d415bb7a3b2bedadc3f5896c5050e45dc1e0ad35","unresolved":false,"context_lines":[{"line_number":1299,"context_line":"    @mock.patch(\u0027nova.compute.manager.ComputeManager._get_nodes\u0027)"},{"line_number":1300,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1301,"context_line":"                \u0027_get_resource_provider\u0027)"},{"line_number":1302,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1303,"context_line":"                \u0027get_allocations_for_provider_tree\u0027)"},{"line_number":1304,"context_line":"    def test_init_host_with_vgpu("},{"line_number":1305,"context_line":"            self, mock_get_allocs_pt, mock_get_rp, mock_get_nodes,"},{"line_number":1306,"context_line":"            mock__init_inst, mock__destroy_eva, mock_get_by_host):"}],"source_content_type":"text/x-python","patch_set":5,"id":"8f221679_cbb03d76","line":1303,"range":{"start_line":1302,"start_character":4,"end_line":1303,"end_character":52},"in_reply_to":"716bcd73_5d35fb0c","updated":"2021-10-08 07:37:25.000000000","message":"Done","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":1343,"context_line":"        with mock.patch.object("},{"line_number":1344,"context_line":"                self.compute.driver, \"init_host\") as mock_init_host:"},{"line_number":1345,"context_line":"            self.compute.init_host()"},{"line_number":1346,"context_line":"            mock_init_host.assert_called()"},{"line_number":1347,"context_line":""},{"line_number":1348,"context_line":"    def test_init_instance_with_binding_failed_vif_type(self):"},{"line_number":1349,"context_line":"        # this instance will plug a \u0027binding_failed\u0027 vif"}],"source_content_type":"text/x-python","patch_set":5,"id":"6defb0d9_3287dfcf","line":1346,"updated":"2021-10-07 22:00:14.000000000","message":"I think the above issue would have been caught if you change this to:\n\n mock_init_host.assert_called_once_with(host\u003dself.compute.host, allocs\u003d\u003cexpected allocs\u003e, rps\u003d\u003cexpected_rps\u003e)","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"d415bb7a3b2bedadc3f5896c5050e45dc1e0ad35","unresolved":false,"context_lines":[{"line_number":1343,"context_line":"        with mock.patch.object("},{"line_number":1344,"context_line":"                self.compute.driver, \"init_host\") as mock_init_host:"},{"line_number":1345,"context_line":"            self.compute.init_host()"},{"line_number":1346,"context_line":"            mock_init_host.assert_called()"},{"line_number":1347,"context_line":""},{"line_number":1348,"context_line":"    def test_init_instance_with_binding_failed_vif_type(self):"},{"line_number":1349,"context_line":"        # this instance will plug a \u0027binding_failed\u0027 vif"}],"source_content_type":"text/x-python","patch_set":5,"id":"03583c00_b7b1ed7d","line":1346,"in_reply_to":"6defb0d9_3287dfcf","updated":"2021-10-08 07:37:25.000000000","message":"Done","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":26019,"context_line":"        # the configuration by removing this type, we want to hardstop."},{"line_number":26020,"context_line":"        self.assertRaises(exception.InvalidLibvirtMdevConfig,"},{"line_number":26021,"context_line":"                          drvr.init_host, host\u003d\u0027foo\u0027)"},{"line_number":26022,"context_line":""},{"line_number":26023,"context_line":"    @mock.patch.object(libvirt_guest.Guest, \u0027detach_device\u0027)"},{"line_number":26024,"context_line":"    def _test_detach_mediated_devices(self, side_effect, detach_device):"},{"line_number":26025,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"c13da263_da7c6c8e","side":"PARENT","line":26022,"updated":"2021-10-07 22:00:14.000000000","message":"Why is this test being removed? I checked the commit message and it is not mentioned.\n\n(later) I see now that it\u0027s because you removed the call to _get_mediated_device_information in init_host and the logic has changed enough that this test isn\u0027t relevant anymore.","commit_id":"11f95eebea01b0aea7026ea8145b0d8709aed2d7"}],"nova/virt/driver.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605999b84e5241af38abfd49894ad411e566552c","unresolved":true,"context_lines":[{"line_number":218,"context_line":"        self.virtapi \u003d virtapi"},{"line_number":219,"context_line":"        self._compute_event_callback \u003d None"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":222,"context_line":"        \"\"\"Initialize anything that is necessary for the driver to function,"},{"line_number":223,"context_line":"        including catching up with currently running VM\u0027s on the given host."},{"line_number":224,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"6aeb432c_7f6af473","line":221,"updated":"2021-10-08 14:00:20.000000000","message":"please, no, no kwargs as we need to have a virt API explaining which resources you have.","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"090ac5d9ebad4542d99eb583ee8b86e5c4886a0f","unresolved":true,"context_lines":[{"line_number":218,"context_line":"        self.virtapi \u003d virtapi"},{"line_number":219,"context_line":"        self._compute_event_callback \u003d None"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":222,"context_line":"        \"\"\"Initialize anything that is necessary for the driver to function,"},{"line_number":223,"context_line":"        including catching up with currently running VM\u0027s on the given host."},{"line_number":224,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"87bfb524_be5d9613","line":221,"in_reply_to":"6aeb432c_7f6af473","updated":"2021-10-08 14:50:50.000000000","message":"hmm, so would you prefer something like init_host(self, host, allocs\u003dNone, rps\u003dNone) ?","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":218,"context_line":"        self.virtapi \u003d virtapi"},{"line_number":219,"context_line":"        self._compute_event_callback \u003d None"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def init_host(self, host, allocs\u003dNone, rps\u003dNone):"},{"line_number":222,"context_line":"        \"\"\"Initialize anything that is necessary for the driver to function,"},{"line_number":223,"context_line":"        including catching up with currently running VM\u0027s on the given host."},{"line_number":224,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"c70a786a_c387d191","line":221,"updated":"2021-10-26 08:39:02.000000000","message":"This probably warrants a mail to the ML for the out of tree virt driver maintainers. (See a similar mail from the past http://lists.openstack.org/pipermail/openstack-discuss/2020-September/017121.html)","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"}],"nova/virt/fake.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"4ed40aa58530094db63f761ca5c3a89f63357a73","unresolved":true,"context_lines":[{"line_number":153,"context_line":"        self._interfaces \u003d {}"},{"line_number":154,"context_line":"        self.active_migrations \u003d {}"},{"line_number":155,"context_line":"        self._host \u003d None"},{"line_number":156,"context_line":"        self._nodes \u003d None"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":159,"context_line":"        self._host \u003d host"}],"source_content_type":"text/x-python","patch_set":6,"id":"5e5239d2_800a154d","line":156,"range":{"start_line":156,"start_character":22,"end_line":156,"end_character":26},"updated":"2021-10-08 20:15:49.000000000","message":"Given the new behavior introduced by this change, it seems like it would be more correct to initialize this to [].","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"62f608de8079d430076c30f1f1b0b6880d522d8a","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self._interfaces \u003d {}"},{"line_number":154,"context_line":"        self.active_migrations \u003d {}"},{"line_number":155,"context_line":"        self._host \u003d None"},{"line_number":156,"context_line":"        self._nodes \u003d None"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":159,"context_line":"        self._host \u003d host"}],"source_content_type":"text/x-python","patch_set":6,"id":"f92bc30d_c1a5553d","line":156,"range":{"start_line":156,"start_character":22,"end_line":156,"end_character":26},"in_reply_to":"5e5239d2_800a154d","updated":"2021-10-09 05:47:58.000000000","message":"Done","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605999b84e5241af38abfd49894ad411e566552c","unresolved":true,"context_lines":[{"line_number":155,"context_line":"        self._host \u003d None"},{"line_number":156,"context_line":"        self._nodes \u003d None"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":159,"context_line":"        self._host \u003d host"},{"line_number":160,"context_line":"        # NOTE(gibi): this is unnecessary complex and fragile but this is"},{"line_number":161,"context_line":"        # how many current functional sample tests expect the node name."}],"source_content_type":"text/x-python","patch_set":6,"id":"087377e3_a661c1b1","line":158,"updated":"2021-10-08 14:00:20.000000000","message":"here, you\u0027re changing the API for init_host, I\u0027d also make sure that out-of-tree virt drivers know about these changes, so before merging this, you would need to provide an email like we did here http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013507.html","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"}],"nova/virt/hyperv/driver.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @property"},{"line_number":148,"context_line":"    def need_legacy_block_device_info(self):"},{"line_number":149,"context_line":"        return False"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":152,"context_line":"        self._serialconsoleops.start_console_handlers()"}],"source_content_type":"text/x-python","patch_set":5,"id":"85e26622_00f7daaa","line":149,"updated":"2021-10-07 22:00:14.000000000","message":"What is this for? It doesn\u0027t appear related to the fix?","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"d415bb7a3b2bedadc3f5896c5050e45dc1e0ad35","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @property"},{"line_number":148,"context_line":"    def need_legacy_block_device_info(self):"},{"line_number":149,"context_line":"        return False"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":152,"context_line":"        self._serialconsoleops.start_console_handlers()"}],"source_content_type":"text/x-python","patch_set":5,"id":"aec52323_b923fb77","line":149,"in_reply_to":"85e26622_00f7daaa","updated":"2021-10-08 07:37:25.000000000","message":"Done","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":33384,"name":"Tiago Octaviano Primini","display_name":"Tiago Primini","email":"tiagooctaviano.primini@windriver.com","username":"tiago-primini"},"change_message_id":"a6047360f6bec06927f4e9866212abe4d71e05be","unresolved":true,"context_lines":[{"line_number":980,"context_line":"        mdevs \u003d self._get_all_assigned_mediated_devices()"},{"line_number":981,"context_line":"        for (mdev_uuid, instance_uuid) in mdevs.items():"},{"line_number":982,"context_line":"            if not self._is_existing_mdev(mdev_uuid):"},{"line_number":983,"context_line":"                if instance_uuid in allocs:"},{"line_number":984,"context_line":"                    vgpu_allocs \u003d self._vgpu_allocations(allocs[instance_uuid])"},{"line_number":985,"context_line":"                    rp_id, _ \u003d next(iter(vgpu_allocs.items()))"},{"line_number":986,"context_line":"                    rp \u003d rps[rp_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"84880383_9bc0aeb2","line":983,"updated":"2021-10-04 13:07:58.000000000","message":"Hi @sbauza! I believe this change will not fix the problem, because since we do not have the vgpu instances persisted in the OS, we will have an exception in line 980 (mdevs \u003d self._get_all_assigned_mediated_devices()) - VIR_ERR_NO_NODE_DEVICE. Could we just catch the exception and create the previous existent mediated devices setting parent to None, like:\n\n                try:\n                    dev_info \u003d self._get_mediated_device_information(dev_name)\n                    parent \u003d dev_info[\u0027parent\u0027]\n                    parent_type \u003d self._get_vgpu_type_per_pgpu(parent)\n                    if dev_info[\u0027type\u0027] !\u003d parent_type:\n                        # NOTE(sbauza): The mdev was created by using a different\n                        # vGPU type. We can\u0027t recreate the mdev until the operator\n                        # modifies the configuration.\n                        parent \u003d \"{}:{}:{}.{}\".format(*parent[4:].split(\u0027_\u0027))\n                        msg \u003d (\"The instance UUID %(inst)s uses a VGPU that \"\n                               \"its parent pGPU %(parent)s no longer \"\n                               \"supports as the instance vGPU type %(type)s \"\n                               \"is not accepted for the pGPU. Please correct \"\n                               \"the configuration accordingly.\" %\n                               {\u0027inst\u0027: instance_uuid,\n                                \u0027parent\u0027: parent,\n                                \u0027type\u0027: dev_info[\u0027type\u0027]})\n                        raise exception.InvalidLibvirtGPUConfig(reason\u003dmsg)\n                except libvirt.libvirtError as e:\n                    errcode \u003d e.get_error_code()\n                    if errcode \u003d\u003d libvirt.VIR_ERR_NO_NODE_DEVICE:\n                        parent \u003d None\n                    else:\n                        raise e\n                self._create_new_mediated_device(parent, uuid\u003dmdev_uuid)\n\nWe tested this in an environment and worked properly, is there any side effect setting the parent to None?","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":33384,"name":"Tiago Octaviano Primini","display_name":"Tiago Primini","email":"tiagooctaviano.primini@windriver.com","username":"tiago-primini"},"change_message_id":"7e517bb8d57109a5dde74e30afe50f785b9da9b4","unresolved":true,"context_lines":[{"line_number":980,"context_line":"        mdevs \u003d self._get_all_assigned_mediated_devices()"},{"line_number":981,"context_line":"        for (mdev_uuid, instance_uuid) in mdevs.items():"},{"line_number":982,"context_line":"            if not self._is_existing_mdev(mdev_uuid):"},{"line_number":983,"context_line":"                if instance_uuid in allocs:"},{"line_number":984,"context_line":"                    vgpu_allocs \u003d self._vgpu_allocations(allocs[instance_uuid])"},{"line_number":985,"context_line":"                    rp_id, _ \u003d next(iter(vgpu_allocs.items()))"},{"line_number":986,"context_line":"                    rp \u003d rps[rp_id]"}],"source_content_type":"text/x-python","patch_set":5,"id":"1e575025_fbef47e5","line":983,"in_reply_to":"84880383_9bc0aeb2","updated":"2021-10-04 18:01:32.000000000","message":"Oh forget about it, the function with problem is _get_mediated_device_information and it was removed in your fix.","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7acebdce64ba48da33191b8d390cc4f4dcad0c85","unresolved":true,"context_lines":[{"line_number":997,"context_line":"                                    rp[\u0027parent_provider_uuid\u0027])"},{"line_number":998,"context_line":"                else:"},{"line_number":999,"context_line":"                    LOG.warning(\"instance %s allocates vgpu device but\""},{"line_number":1000,"context_line":"                                \"does not accounted\", instance_uuid)"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"    def _check_file_backed_memory_support(self):"},{"line_number":1003,"context_line":"        if not CONF.libvirt.file_backed_memory:"}],"source_content_type":"text/x-python","patch_set":5,"id":"ada653ac_ef63885d","line":1000,"range":{"start_line":1000,"start_character":42,"end_line":1000,"end_character":51},"updated":"2021-10-07 22:00:14.000000000","message":"This is incorrect grammar. To be clearer, it could say something like \"have allocations in placement\".","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":29071,"name":"norman shen","email":"yshxxsjt715@gmail.com","username":"ushen"},"change_message_id":"d415bb7a3b2bedadc3f5896c5050e45dc1e0ad35","unresolved":false,"context_lines":[{"line_number":997,"context_line":"                                    rp[\u0027parent_provider_uuid\u0027])"},{"line_number":998,"context_line":"                else:"},{"line_number":999,"context_line":"                    LOG.warning(\"instance %s allocates vgpu device but\""},{"line_number":1000,"context_line":"                                \"does not accounted\", instance_uuid)"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"    def _check_file_backed_memory_support(self):"},{"line_number":1003,"context_line":"        if not CONF.libvirt.file_backed_memory:"}],"source_content_type":"text/x-python","patch_set":5,"id":"4e4499f3_9f810b64","line":1000,"range":{"start_line":1000,"start_character":42,"end_line":1000,"end_character":51},"in_reply_to":"ada653ac_ef63885d","updated":"2021-10-08 07:37:25.000000000","message":"Done","commit_id":"8ad7afeca1039d10e14eea560a1cf777b644c41b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605999b84e5241af38abfd49894ad411e566552c","unresolved":true,"context_lines":[{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def init_host(self, host, **kwargs):"},{"line_number":707,"context_line":"        allocs \u003d kwargs.get(\u0027allocs\u0027, {})"},{"line_number":708,"context_line":"        rps \u003d kwargs.get(\u0027rps\u0027, {})"},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"        self._host.initialize()"},{"line_number":711,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"67270f5d_09a36e72","line":708,"updated":"2021-10-08 14:00:20.000000000","message":"see, I really dislike passing kwargs, as this could change between virt drivers.","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"605999b84e5241af38abfd49894ad411e566552c","unresolved":true,"context_lines":[{"line_number":998,"context_line":"                else:"},{"line_number":999,"context_line":"                    LOG.warning(\"instance %s allocates vgpu device but\""},{"line_number":1000,"context_line":"                                \"does not have allocations in placement\","},{"line_number":1001,"context_line":"                                instance_uuid)"},{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"    def _check_file_backed_memory_support(self):"},{"line_number":1004,"context_line":"        if not CONF.libvirt.file_backed_memory:"}],"source_content_type":"text/x-python","patch_set":6,"id":"68d5703b_ae5c723b","line":1001,"updated":"2021-10-08 14:00:20.000000000","message":"thanks for working on it !","commit_id":"0d5835521e571141dbd254e948b9f03721dccedb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        # TODO(sbauza): Remove this code once mediated devices are persisted"},{"line_number":800,"context_line":"        # across reboots."},{"line_number":801,"context_line":"        self._recreate_assigned_mediated_devices(allocs\u003dallocs, rps\u003drps)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"        self._check_cpu_compatibility()"},{"line_number":804,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"a594efa8_940da55b","line":801,"range":{"start_line":801,"start_character":49,"end_line":801,"end_character":56},"updated":"2021-10-26 08:39:02.000000000","message":"supernit: you probably don\u0027t need to pass these as kwargs here as the variable names are already communicating the same information","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":981,"context_line":"            if not self._is_existing_mdev(mdev_uuid):"},{"line_number":982,"context_line":"                if instance_uuid in allocs:"},{"line_number":983,"context_line":"                    vgpu_allocs \u003d self._vgpu_allocations(allocs[instance_uuid])"},{"line_number":984,"context_line":"                    rp_id, _ \u003d next(iter(vgpu_allocs.items()))"},{"line_number":985,"context_line":"                    rp \u003d rps[rp_id]"},{"line_number":986,"context_line":"                    root_name \u003d rps.get(rp[\u0027parent_provider_uuid\u0027], {})\\"},{"line_number":987,"context_line":"                        .get(\u0027name\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"251fd553_1685b785","line":984,"updated":"2021-10-26 08:39:02.000000000","message":"So this is where we use the assumption that the virt driver only supports a single vgpu type, otherwise we cannot assume a singe RP here. Please add a note here about this assumption","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b95854898496ecb353d6f1a910133fb5539d1dd","unresolved":true,"context_lines":[{"line_number":983,"context_line":"                    vgpu_allocs \u003d self._vgpu_allocations(allocs[instance_uuid])"},{"line_number":984,"context_line":"                    rp_id, _ \u003d next(iter(vgpu_allocs.items()))"},{"line_number":985,"context_line":"                    rp \u003d rps[rp_id]"},{"line_number":986,"context_line":"                    root_name \u003d rps.get(rp[\u0027parent_provider_uuid\u0027], {})\\"},{"line_number":987,"context_line":"                        .get(\u0027name\u0027)"},{"line_number":988,"context_line":"                    # before reshaping, it is possible that pci resource"},{"line_number":989,"context_line":"                    # provider is not created yet"}],"source_content_type":"text/x-python","patch_set":9,"id":"719e5916_f1583981","line":986,"range":{"start_line":986,"start_character":40,"end_line":986,"end_character":66},"updated":"2021-11-05 12:53:36.000000000","message":"This \n\n  rp[\u0027parent_provider_uuid\u0027]\n\ncould fail as rp can be None if:\n1) the RP does not exists in placement, placement returns 404, and the compute manager simply stores None in the provider_dict at https://review.opendev.org/c/openstack/nova/+/810220/9/nova/compute/manager.py#1433\n\n2) the safe_connect decorator on top of _get_resource_provider catches connection error / configuration error etc when connecting to placement and therefore _get_resource_provider returns None which the manager stores in provider_dict passed here as rps","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":983,"context_line":"                    vgpu_allocs \u003d self._vgpu_allocations(allocs[instance_uuid])"},{"line_number":984,"context_line":"                    rp_id, _ \u003d next(iter(vgpu_allocs.items()))"},{"line_number":985,"context_line":"                    rp \u003d rps[rp_id]"},{"line_number":986,"context_line":"                    root_name \u003d rps.get(rp[\u0027parent_provider_uuid\u0027], {})\\"},{"line_number":987,"context_line":"                        .get(\u0027name\u0027)"},{"line_number":988,"context_line":"                    # before reshaping, it is possible that pci resource"},{"line_number":989,"context_line":"                    # provider is not created yet"}],"source_content_type":"text/x-python","patch_set":9,"id":"e5d3510f_1daf37bd","line":986,"range":{"start_line":986,"start_character":20,"end_line":986,"end_character":66},"updated":"2021-10-26 08:39:02.000000000","message":"This is slightly misleading. If you need the root provider then you can use the root_provider_uuid field of the RP directly. Today\u0027s nova RP tree is created in a way that the VGPU RPs are the direct children of the root RP so parent_provider_uuid and root_provider_uuid is the same for the VGPU RP. But this can change in the future.\n\nAre you trying to differentiate between the case when the VGPU resource is reported on the root provider from the case when it is reported on children RPs? A comment would be helpful explaining the intention of this code.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":983,"context_line":"                    vgpu_allocs \u003d self._vgpu_allocations(allocs[instance_uuid])"},{"line_number":984,"context_line":"                    rp_id, _ \u003d next(iter(vgpu_allocs.items()))"},{"line_number":985,"context_line":"                    rp \u003d rps[rp_id]"},{"line_number":986,"context_line":"                    root_name \u003d rps.get(rp[\u0027parent_provider_uuid\u0027], {})\\"},{"line_number":987,"context_line":"                        .get(\u0027name\u0027)"},{"line_number":988,"context_line":"                    # before reshaping, it is possible that pci resource"},{"line_number":989,"context_line":"                    # provider is not created yet"}],"source_content_type":"text/x-python","patch_set":9,"id":"da5e82cc_f1ebce50","line":986,"range":{"start_line":986,"start_character":71,"end_line":986,"end_character":72},"updated":"2021-10-26 08:39:02.000000000","message":"nit: instead of backslash you should break the line after rps.get(","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":985,"context_line":"                    rp \u003d rps[rp_id]"},{"line_number":986,"context_line":"                    root_name \u003d rps.get(rp[\u0027parent_provider_uuid\u0027], {})\\"},{"line_number":987,"context_line":"                        .get(\u0027name\u0027)"},{"line_number":988,"context_line":"                    # before reshaping, it is possible that pci resource"},{"line_number":989,"context_line":"                    # provider is not created yet"},{"line_number":990,"context_line":"                    if root_name:"},{"line_number":991,"context_line":"                        parent \u003d rp[\u0027name\u0027][len(root_name) + 1:]"},{"line_number":992,"context_line":"                        self._create_new_mediated_device(parent,"}],"source_content_type":"text/x-python","patch_set":9,"id":"236ebc4e_8b4fffbc","line":989,"range":{"start_line":988,"start_character":0,"end_line":989,"end_character":49},"updated":"2021-10-26 08:39:02.000000000","message":"I don\u0027t get this comment. How does pci resources came into the picture here?","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":992,"context_line":"                        self._create_new_mediated_device(parent,"},{"line_number":993,"context_line":"                                                         uuid\u003dmdev_uuid)"},{"line_number":994,"context_line":"                    else:"},{"line_number":995,"context_line":"                        LOG.warning(\"resoruce provider %s is not found\","},{"line_number":996,"context_line":"                                    rp[\u0027parent_provider_uuid\u0027])"},{"line_number":997,"context_line":"                else:"},{"line_number":998,"context_line":"                    LOG.warning(\"instance %s allocates vgpu device but\""},{"line_number":999,"context_line":"                                \"does not have allocations in placement\","}],"source_content_type":"text/x-python","patch_set":9,"id":"0b720a50_ad3e60da","line":996,"range":{"start_line":995,"start_character":0,"end_line":996,"end_character":63},"updated":"2021-10-26 08:39:02.000000000","message":"Could you explain when this case happens?","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"494dadebc626f02db2b62a77d8330d0296681e93","unresolved":true,"context_lines":[{"line_number":996,"context_line":"                                    rp[\u0027parent_provider_uuid\u0027])"},{"line_number":997,"context_line":"                else:"},{"line_number":998,"context_line":"                    LOG.warning(\"instance %s allocates vgpu device but\""},{"line_number":999,"context_line":"                                \"does not have allocations in placement\","},{"line_number":1000,"context_line":"                                instance_uuid)"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"    def _check_file_backed_memory_support(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"2ad909f8_bb57fd2d","line":999,"updated":"2021-10-26 08:39:02.000000000","message":"@Sylvain: is there a way to fix such discrepancies with nova-manage? If yes, then lets mention that in the log message.","commit_id":"cdeea1c0f9aea2464c52cf3686ad88e8b72f8d75"}]}
