)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"ca1769ef52850e7c1baf0229ccb23b0f910f680b","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Apply nested resource provider to vgpu. Will create a resource"},{"line_number":10,"context_line":"provider for each gpu group."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I039c6490a18213b0b4e640b6ee3c58270314c8a5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1f485f77_627bc1f4","line":11,"updated":"2017-11-16 08:26:03.000000000","message":"explain more how this API will be used? Will be invoked by update_inventory to be implemented by this patch: https://review.openstack.org/#/c/520246/?","commit_id":"699fe3897cef34eea727d9976a6bb0931d01d745"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"xenapi(N-R-P): Add API to support vgpu resource provider create"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Apply nested resource provider to vgpu. It will be invoked by"},{"line_number":10,"context_line":"`update_inventory` to be implemented in virt/driver."},{"line_number":11,"context_line":"Check below patch as a reference:"},{"line_number":12,"context_line":"https://review.openstack.org/#/c/520246/"},{"line_number":13,"context_line":"This patch will implement vgpu part\u0027s update:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"ff82abbf_9dbc5fdd","line":10,"range":{"start_line":10,"start_character":1,"end_line":10,"end_character":17},"updated":"2017-11-22 02:55:21.000000000","message":"As Eric commented, the API is now called update_provider_tree. And need add Depends-On https://review.openstack.org/#/c/520246/.","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This patch will implement vgpu part\u0027s update:"},{"line_number":14,"context_line":"It will go through all the gpu groups and update corresponding"},{"line_number":15,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"},{"line_number":16,"context_line":"create a new resource provider and attach it to the compute node."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"blueprint: add-support-for-vgpu"},{"line_number":19,"context_line":"Change-Id: I039c6490a18213b0b4e640b6ee3c58270314c8a5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"ff82abbf_9da1bfac","line":16,"range":{"start_line":16,"start_character":45,"end_line":16,"end_character":47},"updated":"2017-11-22 02:55:21.000000000","message":"as a child of","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c4898bdaea3b9758aa8923b61e24a83e5733bfa8","unresolved":false,"context_lines":[{"line_number":7,"context_line":"xenapi(N-R-P): Add API to support vgpu resource provider create"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Apply nested resource provider to vgpu. It will be invoked by"},{"line_number":10,"context_line":"`update_inventory` to be implemented in virt/driver."},{"line_number":11,"context_line":"Check below patch as a reference:"},{"line_number":12,"context_line":"https://review.openstack.org/#/c/520246/"},{"line_number":13,"context_line":"This patch will implement vgpu part\u0027s update:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"ff82abbf_49fc3cb4","line":10,"range":{"start_line":10,"start_character":1,"end_line":10,"end_character":17},"updated":"2017-11-29 06:42:49.000000000","message":"need update the function name as now it\u0027s update_provider_tree().","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"434ba87c7331b89c5af11c779fb6efac5c4c3ab7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"xenapi(N-R-P): Add API to support vgpu resource provider create"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Apply nested resource provider to vgpu. It will be invoked by"},{"line_number":10,"context_line":"`update_inventory` to be implemented in virt/driver."},{"line_number":11,"context_line":"Check below patch as a reference:"},{"line_number":12,"context_line":"https://review.openstack.org/#/c/520246/"},{"line_number":13,"context_line":"This patch will implement vgpu part\u0027s update:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"ff82abbf_a9e8687b","line":10,"range":{"start_line":10,"start_character":1,"end_line":10,"end_character":17},"in_reply_to":"ff82abbf_49fc3cb4","updated":"2017-11-29 07:21:35.000000000","message":"will update it.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a7dfdc5b02a89ec2f3bd10f3da7a9a00e3037407","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Apply nested resource provider to vgpu. It will be invoked by"},{"line_number":10,"context_line":"`update_provider_tree` to be implemented in virt/driver."},{"line_number":11,"context_line":"Check below patch as a reference:"},{"line_number":12,"context_line":"https://review.openstack.org/#/c/520246/"},{"line_number":13,"context_line":"This patch will implement vgpu part\u0027s update:"},{"line_number":14,"context_line":"It will go through all the gpu groups and update corresponding"},{"line_number":15,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"df7087c5_b4fa4b72","line":12,"updated":"2018-03-23 08:42:39.000000000","message":"I\u0027d suggest put current patch on top of this dependent patch in stack. So easier for tracking. Reviwers can review relative patches together.\n\nAlso I think you need another patch which implements xenapi\u0027s update_provider_tree which should be in the patch stack. Invoke the VGPU api in xenapi\u0027s update_provider_tree.","commit_id":"8965b2fe384dfb04fa00a80e812dccdefcbb9700"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"e8631a7d49f2765d53fa50a9a3d40806411a2d26","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Apply nested resource provider to vgpu. It will be invoked by"},{"line_number":10,"context_line":"`update_provider_tree` to be implemented in virt/driver."},{"line_number":11,"context_line":"Check below patch as a reference:"},{"line_number":12,"context_line":"https://review.openstack.org/#/c/520246/"},{"line_number":13,"context_line":"This patch will implement vgpu part\u0027s update:"},{"line_number":14,"context_line":"It will go through all the gpu groups and update corresponding"},{"line_number":15,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"df7087c5_14ec578d","line":12,"in_reply_to":"df7087c5_b4fa4b72","updated":"2018-03-23 08:47:17.000000000","message":"Will reform the patches stack.\nThanks.","commit_id":"8965b2fe384dfb04fa00a80e812dccdefcbb9700"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a7dfdc5b02a89ec2f3bd10f3da7a9a00e3037407","unresolved":false,"context_lines":[{"line_number":15,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"},{"line_number":16,"context_line":"create a new resource provider and attach it to the compute node."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"blueprint: add-support-for-vgpu"},{"line_number":19,"context_line":"Change-Id: I039c6490a18213b0b4e640b6ee3c58270314c8a5"},{"line_number":20,"context_line":"Depends-On: I5ee11274816cd9e4f0669e9e52468a29262c9020"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"df7087c5_54be4fb4","line":18,"updated":"2018-03-23 08:42:39.000000000","message":"Need update BP as vgpu-rocky:\nhttps://blueprints.launchpad.net/nova/+spec/vgpu-rocky","commit_id":"8965b2fe384dfb04fa00a80e812dccdefcbb9700"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"e8631a7d49f2765d53fa50a9a3d40806411a2d26","unresolved":false,"context_lines":[{"line_number":15,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"},{"line_number":16,"context_line":"create a new resource provider and attach it to the compute node."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"blueprint: add-support-for-vgpu"},{"line_number":19,"context_line":"Change-Id: I039c6490a18213b0b4e640b6ee3c58270314c8a5"},{"line_number":20,"context_line":"Depends-On: I5ee11274816cd9e4f0669e9e52468a29262c9020"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"df7087c5_d401ff39","line":18,"in_reply_to":"df7087c5_54be4fb4","updated":"2018-03-23 08:47:17.000000000","message":"Will replace the BP","commit_id":"8965b2fe384dfb04fa00a80e812dccdefcbb9700"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":13,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"},{"line_number":14,"context_line":"create a new resource provider and attach it to the compute node."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"blueprint: vgpu-rocky"},{"line_number":17,"context_line":"Change-Id: I039c6490a18213b0b4e640b6ee3c58270314c8a5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":49,"id":"3f79a3b5_3441410b","line":16,"range":{"start_line":16,"start_character":11,"end_line":16,"end_character":21},"updated":"2018-09-05 17:21:26.000000000","message":"is this still the right blueprint?","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":13,"context_line":"resource providers. If the resource provider doesn\u0027t exist, it will"},{"line_number":14,"context_line":"create a new resource provider and attach it to the compute node."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"blueprint: vgpu-rocky"},{"line_number":17,"context_line":"Change-Id: I039c6490a18213b0b4e640b6ee3c58270314c8a5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":49,"id":"3f79a3b5_97136db8","line":16,"range":{"start_line":16,"start_character":11,"end_line":16,"end_character":21},"in_reply_to":"3f79a3b5_3441410b","updated":"2018-09-06 01:15:32.000000000","message":"No, will change to the stein bp.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"}],"nova/tests/unit/virt/xenapi/test_driver.py":[{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2f1d3933cdf9cbf4e046e51cdd862cd8543950c0","unresolved":false,"context_lines":[{"line_number":426,"context_line":"                          alloc)"},{"line_number":427,"context_line":""},{"line_number":428,"context_line":"    def test_update_vgpu_rp(self):"},{"line_number":429,"context_line":"        # if the resource provider is exist, update its inventory"},{"line_number":430,"context_line":"        driver \u003d self._get_driver()"},{"line_number":431,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":432,"context_line":"        fake_rp_tree \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_e2a451a8","line":429,"range":{"start_line":429,"start_character":35,"end_line":429,"end_character":43},"updated":"2017-11-16 08:19:15.000000000","message":"exists","commit_id":"86969ed07fb6f5ae0f4a50b16d4da6c7825a94d0"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"b27f7f4da51eddfa76578996efd50b490af9a30b","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":438,"context_line":"                                        \u0027fake_compute_uuid\u0027)"},{"line_number":439,"context_line":"        self.assertTrue(result)"},{"line_number":440,"context_line":"        self.assertEqual(fake_rp_tree.update_inventory.call_count, 2)"},{"line_number":441,"context_line":"        self.assertEqual(fake_rp_tree.exists.call_count, 2)"},{"line_number":442,"context_line":"        fake_rp_tree.new_child.assert_not_called()"},{"line_number":443,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ff82abbf_ce8d3dd4","line":440,"range":{"start_line":440,"start_character":38,"end_line":440,"end_character":54},"updated":"2017-11-22 14:42:55.000000000","message":"Just using asserts on the number of calls made to functions isn\u0027t checking what actually happened and IMO isn\u0027t that useful here... IMO we should only use call_count when checking that exactly the right number of iterations occur in a loop.\n\nWe should probably assert that there are exactly two calls to update_inventory - one for the two different vGPU types.","commit_id":"e498f6a051a39c14c38dbae11ae7a5e99be20378"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"8dbae57a92794e7a5b470f3ec2c0a0349e5f4445","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":438,"context_line":"                                        \u0027fake_compute_uuid\u0027)"},{"line_number":439,"context_line":"        self.assertTrue(result)"},{"line_number":440,"context_line":"        self.assertEqual(fake_rp_tree.update_inventory.call_count, 2)"},{"line_number":441,"context_line":"        self.assertEqual(fake_rp_tree.exists.call_count, 2)"},{"line_number":442,"context_line":"        fake_rp_tree.new_child.assert_not_called()"},{"line_number":443,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ff82abbf_194a837f","line":440,"range":{"start_line":440,"start_character":38,"end_line":440,"end_character":54},"in_reply_to":"ff82abbf_ce8d3dd4","updated":"2017-11-23 03:08:09.000000000","message":"Will add called_with checking. Thank you, Bob.","commit_id":"e498f6a051a39c14c38dbae11ae7a5e99be20378"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a16ef10fc0ed239071bdfb92547198dc23fad70f","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        # if the resource provider is exists, update its inventory"},{"line_number":427,"context_line":"        driver \u003d self._get_driver()"},{"line_number":428,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":429,"context_line":"        fake_rp_tree \u003d mock.Mock()"},{"line_number":430,"context_line":"        fake_rp_tree.exists.return_value \u003d True"},{"line_number":431,"context_line":"        fake_rp_tree.new_child.return_value \u003d \u0027fake_root_rp\u0027"},{"line_number":432,"context_line":"        fake_rp_tree.update_inventory.return_value \u003d True"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_2d95f4e4","line":429,"range":{"start_line":429,"start_character":8,"end_line":429,"end_character":20},"updated":"2018-03-26 19:10:55.000000000","message":"You should use a real ProviderTree for these tests.  They\u0027re not hard to create.  And it\u0027ll give you better test depth.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"51592f900ecc54a3643ded42ee5eca5afcd8c088","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        # if the resource provider is exists, update its inventory"},{"line_number":427,"context_line":"        driver \u003d self._get_driver()"},{"line_number":428,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":429,"context_line":"        fake_rp_tree \u003d mock.Mock()"},{"line_number":430,"context_line":"        fake_rp_tree.exists.return_value \u003d True"},{"line_number":431,"context_line":"        fake_rp_tree.new_child.return_value \u003d \u0027fake_root_rp\u0027"},{"line_number":432,"context_line":"        fake_rp_tree.update_inventory.return_value \u003d True"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_0f69f989","line":429,"range":{"start_line":429,"start_character":8,"end_line":429,"end_character":20},"in_reply_to":"bf659307_2d95f4e4","updated":"2018-03-27 06:20:02.000000000","message":"You are right, will add it.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a16ef10fc0ed239071bdfb92547198dc23fad70f","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_ba3e1b27","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"updated":"2018-03-26 19:10:55.000000000","message":"We only accept A-Z0-9_ so you\u0027ll have to \"slugify\" this.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a5f5e2b6479447be9fd46d233a4e387eca5be36c","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_a6957342","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"in_reply_to":"bf659307_0ffed9ad","updated":"2018-03-28 05:31:51.000000000","message":"So the *-* in uuids also requires a conversion. In order to convert it back to the uuids which are known by XenServer, I\u0027d suggest name the RP as some thing like: \"GRP_\u003cconverted gpu group uuid\u003e_VTYPE_\u003cconverted vGPU type\u0027s uuid\u003e\".","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"51592f900ecc54a3643ded42ee5eca5afcd8c088","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_0ffed9ad","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"in_reply_to":"bf659307_10460325","updated":"2018-03-27 06:20:02.000000000","message":"Thank you very much, Eric.\nWill check it.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"b2aac214974fa2ada8ddc4262f007e17fcbd62cf","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_ef15629d","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"in_reply_to":"bf659307_83ccd26a","updated":"2018-03-29 01:08:28.000000000","message":"No worries :)\nThank you both, Eric and Jianghua","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"daa5a5ad44fe6aefba77a0e77c0e414a8db57c90","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_83ccd26a","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"in_reply_to":"bf659307_a604934b","updated":"2018-03-28 13:57:51.000000000","message":"Apologies, folks, I was completely mistaken about these restrictions for RP names.  I\u0027m updating the slugify patch accordingly.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"beef1a4bbea7998a7fb4b979086ab91f41b552e8","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_a604934b","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"in_reply_to":"bf659307_a6957342","updated":"2018-03-28 05:51:44.000000000","message":"Eric and Naichuan, by checking the schemas for RP, I didn\u0027t get the above restriction: https://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/placement/schemas/resource_provider.py#n20\n\nBut I do see the restriction applied for resource classes:\nhttps://git.openstack.org/cgit/openstack/nova/tree/nova/api/openstack/placement/schemas/inventory.py#n19\n\nI guess it will be a general case to having uuid in RP\u0027s name. But uuid usually will have hyphens. Can we allow hyphen in the schema if there is plan to add it?","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0c758bb825ccb884a044421e6b549e27cede0455","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        }"},{"line_number":441,"context_line":"        fake_gpu_grp_id \u003d \u0027c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":442,"context_line":"        fake_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1_\u0027"},{"line_number":443,"context_line":"                        \u00276444c6ee-3a49-42f5-bebb-606b52175e67_Intel GVT-g\u0027)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"        result \u003d driver._update_vgpu_rp(fake_rp_tree, host_stats,"},{"line_number":446,"context_line":"                                        \u0027fake_compute_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_10460325","line":443,"range":{"start_line":443,"start_character":62,"end_line":443,"end_character":73},"in_reply_to":"bf659307_ba3e1b27","updated":"2018-03-26 19:33:35.000000000","message":"Here, I made this [1] for you.\n\n[1] https://review.openstack.org/556628","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        # if the resource provider is exists, update its inventory"},{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        fake_rp_tree \u003d rp_tree.ProviderTree()"},{"line_number":431,"context_line":"        fake_rp_tree.new_root(\u0027fake_root_name\u0027, \u0027fake_root_uuid\u0027)"},{"line_number":432,"context_line":"        fake_inv \u003d {"},{"line_number":433,"context_line":"            rc_fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_2457e6cc","line":430,"range":{"start_line":430,"start_character":8,"end_line":430,"end_character":20},"updated":"2018-03-29 20:57:34.000000000","message":"It\u0027s not really fake anymore :)\n\nBut this is fine.","commit_id":"cab1d21f8a3d061831109bd1ea2f6fe8b32d6659"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"70e7038eadc21ba17b4387ba8caca9639c506886","unresolved":false,"context_lines":[{"line_number":427,"context_line":"        # if the resource provider is exists, update its inventory"},{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        fake_rp_tree \u003d rp_tree.ProviderTree()"},{"line_number":431,"context_line":"        fake_rp_tree.new_root(\u0027fake_root_name\u0027, \u0027fake_root_uuid\u0027)"},{"line_number":432,"context_line":"        fake_inv \u003d {"},{"line_number":433,"context_line":"            rc_fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_b84555b6","line":430,"range":{"start_line":430,"start_character":8,"end_line":430,"end_character":20},"in_reply_to":"bf659307_2457e6cc","updated":"2018-03-30 05:54:50.000000000","message":":)","commit_id":"cab1d21f8a3d061831109bd1ea2f6fe8b32d6659"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        rp_data \u003d fake_rp_tree.data(expect_rp_name)"},{"line_number":448,"context_line":"        self.assertEqual(rp_data.inventory, fake_inv)"},{"line_number":449,"context_line":"        self.assertEqual(rp_data.name, expect_rp_name)"},{"line_number":450,"context_line":"        self.assertEqual(rp_data.uuid, exist_rp_uuid)"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    def test_create_vgpu_rp(self):"},{"line_number":453,"context_line":"        # if the resource provider is not exist, create it and attach the"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_a46a167e","line":450,"updated":"2018-03-29 20:57:34.000000000","message":"This is much cleaner, thank you.","commit_id":"cab1d21f8a3d061831109bd1ea2f6fe8b32d6659"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"70e7038eadc21ba17b4387ba8caca9639c506886","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        rp_data \u003d fake_rp_tree.data(expect_rp_name)"},{"line_number":448,"context_line":"        self.assertEqual(rp_data.inventory, fake_inv)"},{"line_number":449,"context_line":"        self.assertEqual(rp_data.name, expect_rp_name)"},{"line_number":450,"context_line":"        self.assertEqual(rp_data.uuid, exist_rp_uuid)"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    def test_create_vgpu_rp(self):"},{"line_number":453,"context_line":"        # if the resource provider is not exist, create it and attach the"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_380b857d","line":450,"in_reply_to":"bf659307_a46a167e","updated":"2018-03-30 05:54:50.000000000","message":"Welcome~","commit_id":"cab1d21f8a3d061831109bd1ea2f6fe8b32d6659"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        driver._update_vgpu_rp(fake_rp_tree, host_stats, \u0027fake_root_uuid\u0027)"},{"line_number":493,"context_line":"        self.assertRaises(ValueError,"},{"line_number":494,"context_line":"                          fake_rp_tree.data,"},{"line_number":495,"context_line":"                          expect_rp_name)"}],"source_content_type":"text/x-python","patch_set":26,"id":"bf659307_0420a247","line":495,"updated":"2018-03-29 20:57:34.000000000","message":"cool.","commit_id":"cab1d21f8a3d061831109bd1ea2f6fe8b32d6659"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                          alloc)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def test_update_vgpu_rp_without_create(self):"},{"line_number":427,"context_line":"        # if the resource provider is exists, update its inventory"},{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_4d45a46f","line":427,"range":{"start_line":427,"start_character":34,"end_line":427,"end_character":44},"updated":"2018-04-09 18:47:15.000000000","message":"s/is exists/exists/","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                          alloc)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def test_update_vgpu_rp_without_create(self):"},{"line_number":427,"context_line":"        # if the resource provider is exists, update its inventory"},{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_26b883c6","line":427,"range":{"start_line":427,"start_character":34,"end_line":427,"end_character":44},"in_reply_to":"bf659307_4d45a46f","updated":"2018-04-10 07:05:42.000000000","message":"Will modify it~","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"},{"line_number":431,"context_line":"        rp_tree.new_root(\u0027fake_root_name\u0027, \u0027fake_root_uuid\u0027)"},{"line_number":432,"context_line":"        fake_inv \u003d {"},{"line_number":433,"context_line":"            rc_fields.ResourceClass.VGPU: {"},{"line_number":434,"context_line":"                \u0027total\u0027: 7,"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_6d3d08dc","line":431,"range":{"start_line":431,"start_character":26,"end_line":431,"end_character":30},"updated":"2018-04-09 18:47:15.000000000","message":"here and throughout... these aren\u0027t fakes :)","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"},{"line_number":431,"context_line":"        rp_tree.new_root(\u0027fake_root_name\u0027, \u0027fake_root_uuid\u0027)"},{"line_number":432,"context_line":"        fake_inv \u003d {"},{"line_number":433,"context_line":"            rc_fields.ResourceClass.VGPU: {"},{"line_number":434,"context_line":"                \u0027total\u0027: 7,"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_262ba3eb","line":431,"range":{"start_line":431,"start_character":26,"end_line":431,"end_character":30},"in_reply_to":"bf659307_6d3d08dc","updated":"2018-04-10 07:05:42.000000000","message":"Will rename it.","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"},{"line_number":431,"context_line":"        rp_tree.new_root(\u0027fake_root_name\u0027, \u0027fake_root_uuid\u0027)"},{"line_number":432,"context_line":"        fake_inv \u003d {"},{"line_number":433,"context_line":"            rc_fields.ResourceClass.VGPU: {"},{"line_number":434,"context_line":"                \u0027total\u0027: 7,"},{"line_number":435,"context_line":"                \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_0d248cc5","line":432,"range":{"start_line":432,"start_character":8,"end_line":432,"end_character":12},"updated":"2018-04-09 18:47:15.000000000","message":"not fake :)","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":429,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"},{"line_number":431,"context_line":"        rp_tree.new_root(\u0027fake_root_name\u0027, \u0027fake_root_uuid\u0027)"},{"line_number":432,"context_line":"        fake_inv \u003d {"},{"line_number":433,"context_line":"            rc_fields.ResourceClass.VGPU: {"},{"line_number":434,"context_line":"                \u0027total\u0027: 7,"},{"line_number":435,"context_line":"                \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_c6c6674a","line":432,"range":{"start_line":432,"start_character":8,"end_line":432,"end_character":12},"in_reply_to":"bf659307_0d248cc5","updated":"2018-04-10 07:05:42.000000000","message":"will rename it.","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            }"},{"line_number":439,"context_line":"        }"},{"line_number":440,"context_line":"        exist_rp_uuid \u003d \u0027fake_rp_uuid\u0027"},{"line_number":441,"context_line":"        expect_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027)"},{"line_number":442,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027fake_root_uuid\u0027,"},{"line_number":443,"context_line":"                               uuid\u003dexist_rp_uuid)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_4d136467","line":441,"updated":"2018-04-09 18:47:15.000000000","message":"is there a reason for the parens on enclosing the above string?","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            }"},{"line_number":439,"context_line":"        }"},{"line_number":440,"context_line":"        exist_rp_uuid \u003d \u0027fake_rp_uuid\u0027"},{"line_number":441,"context_line":"        expect_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027)"},{"line_number":442,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027fake_root_uuid\u0027,"},{"line_number":443,"context_line":"                               uuid\u003dexist_rp_uuid)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_e6ffeb64","line":441,"in_reply_to":"bf659307_4d136467","updated":"2018-04-10 07:05:42.000000000","message":"No~~ thank you for the reminder, Jay.","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.assertEqual(rp_data.uuid, exist_rp_uuid)"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def test_create_vgpu_rp(self):"},{"line_number":452,"context_line":"        # if the resource provider is not exist, create it and attach the"},{"line_number":453,"context_line":"        # inventory"},{"line_number":454,"context_line":""},{"line_number":455,"context_line":"        driver \u003d self._get_driver()"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_ed535838","line":452,"range":{"start_line":452,"start_character":34,"end_line":452,"end_character":47},"updated":"2018-04-09 18:47:15.000000000","message":"s/is not exist/does not exist/","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.assertEqual(rp_data.uuid, exist_rp_uuid)"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def test_create_vgpu_rp(self):"},{"line_number":452,"context_line":"        # if the resource provider is not exist, create it and attach the"},{"line_number":453,"context_line":"        # inventory"},{"line_number":454,"context_line":""},{"line_number":455,"context_line":"        driver \u003d self._get_driver()"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_a6f9f380","line":452,"range":{"start_line":452,"start_character":34,"end_line":452,"end_character":47},"in_reply_to":"bf659307_ed535838","updated":"2018-04-10 07:05:42.000000000","message":"Silly mistake, thanks.","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":484,"context_line":"        expect_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027)"},{"line_number":485,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027fake_root_uuid\u0027,"},{"line_number":486,"context_line":"                               uuid\u003dexpect_gpu_grp_id)"},{"line_number":487,"context_line":"        # Set remain vgpu resouce to 0"},{"line_number":488,"context_line":"        host_stats[\u0027vgpu_stats\u0027][expect_gpu_grp_id][\u0027total\u0027] \u003d 0"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"        driver._update_vgpu_rp(rp_tree, host_stats, \u0027fake_root_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_083b1ad1","line":487,"range":{"start_line":487,"start_character":26,"end_line":487,"end_character":33},"updated":"2018-04-09 18:47:15.000000000","message":"resource","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":484,"context_line":"        expect_rp_name \u003d (\u0027VGPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027)"},{"line_number":485,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027fake_root_uuid\u0027,"},{"line_number":486,"context_line":"                               uuid\u003dexpect_gpu_grp_id)"},{"line_number":487,"context_line":"        # Set remain vgpu resouce to 0"},{"line_number":488,"context_line":"        host_stats[\u0027vgpu_stats\u0027][expect_gpu_grp_id][\u0027total\u0027] \u003d 0"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"        driver._update_vgpu_rp(rp_tree, host_stats, \u0027fake_root_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_86ee2fb2","line":487,"range":{"start_line":487,"start_character":26,"end_line":487,"end_character":33},"in_reply_to":"bf659307_083b1ad1","updated":"2018-04-10 07:05:42.000000000","message":"will modify it~","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b17799b8aeac0ef865ac6daf1bfd9a110897dc86","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        exist_rp_uuid \u003d \u0027rp_uuid\u0027"},{"line_number":444,"context_line":"        expect_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":445,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":446,"context_line":"        # GPU rp which is not availabel anymore, need delete"},{"line_number":447,"context_line":"        unavailable_rp_uuid \u003d \u0027rp_uuid_not_available\u0027"},{"line_number":448,"context_line":"        unavailable_rp_name \u003d \u0027GPU_rp_name_not_available\u0027"},{"line_number":449,"context_line":"        rp_tree.new_child(unavailable_rp_name, \u0027root_uuid\u0027,"},{"line_number":450,"context_line":"                          uuid\u003dunavailable_rp_uuid)"},{"line_number":451,"context_line":"        # rp which is not managed by GPU provider, don\u0027t touch"}],"source_content_type":"text/x-python","patch_set":34,"id":"bf659307_0cddebdb","line":448,"range":{"start_line":446,"start_character":8,"end_line":448,"end_character":57},"updated":"2018-04-13 19:05:24.000000000","message":"What precisely do you mean by \"unavailable\"? Are you referring to a GPU group that is in some maintenance state or otherwise non-operational? Or are you referring to a physical GPU card that has been hot-unplugged (is that even possible?) from a piece of compute hardware?","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dba2ea3e192ff1eb05e8b57489a2ca0698a0ee88","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        exist_rp_uuid \u003d \u0027rp_uuid\u0027"},{"line_number":444,"context_line":"        expect_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":445,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":446,"context_line":"        # GPU rp which is not availabel anymore, need delete"},{"line_number":447,"context_line":"        unavailable_rp_uuid \u003d \u0027rp_uuid_not_available\u0027"},{"line_number":448,"context_line":"        unavailable_rp_name \u003d \u0027GPU_rp_name_not_available\u0027"},{"line_number":449,"context_line":"        rp_tree.new_child(unavailable_rp_name, \u0027root_uuid\u0027,"},{"line_number":450,"context_line":"                          uuid\u003dunavailable_rp_uuid)"},{"line_number":451,"context_line":"        # rp which is not managed by GPU provider, don\u0027t touch"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_e8705175","line":448,"range":{"start_line":446,"start_character":8,"end_line":448,"end_character":57},"in_reply_to":"9f6a8fd7_5227b113","updated":"2018-04-17 12:26:20.000000000","message":"I\u0027m concerned that the xenapi virt driver may try to remove resource providers from the placement service when the GPU is in some temporary down/maintenance state. We need to make sure that the xenapi virt driver does *not* do this; the reason is because if anything has been allocated to those resource providers, the DELETE /resource_providers/{uuid} is going to fail due to allocations being outstanding on the resource provider.\n\nSo, my concern was raised here in this test because it *seems* like you are emulating here a scenario where xenapi sees a previously-existing GPU as being in a down/unavailable state and attempts to automatically remove the provider from placement. And that would be bad :)","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"485a7fbe9da5e80723db7d8b484067e73a161011","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        exist_rp_uuid \u003d \u0027rp_uuid\u0027"},{"line_number":444,"context_line":"        expect_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":445,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":446,"context_line":"        # GPU rp which is not availabel anymore, need delete"},{"line_number":447,"context_line":"        unavailable_rp_uuid \u003d \u0027rp_uuid_not_available\u0027"},{"line_number":448,"context_line":"        unavailable_rp_name \u003d \u0027GPU_rp_name_not_available\u0027"},{"line_number":449,"context_line":"        rp_tree.new_child(unavailable_rp_name, \u0027root_uuid\u0027,"},{"line_number":450,"context_line":"                          uuid\u003dunavailable_rp_uuid)"},{"line_number":451,"context_line":"        # rp which is not managed by GPU provider, don\u0027t touch"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_5227b113","line":448,"range":{"start_line":446,"start_character":8,"end_line":448,"end_character":57},"in_reply_to":"9f6a8fd7_9cb560f1","updated":"2018-04-17 08:27:01.000000000","message":"Something needing to confirm with you on IRC, Jay.","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"2573720750a0e4687643e7f67653169ea249805e","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        exist_rp_uuid \u003d \u0027rp_uuid\u0027"},{"line_number":444,"context_line":"        expect_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":445,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":446,"context_line":"        # GPU rp which is not availabel anymore, need delete"},{"line_number":447,"context_line":"        unavailable_rp_uuid \u003d \u0027rp_uuid_not_available\u0027"},{"line_number":448,"context_line":"        unavailable_rp_name \u003d \u0027GPU_rp_name_not_available\u0027"},{"line_number":449,"context_line":"        rp_tree.new_child(unavailable_rp_name, \u0027root_uuid\u0027,"},{"line_number":450,"context_line":"                          uuid\u003dunavailable_rp_uuid)"},{"line_number":451,"context_line":"        # rp which is not managed by GPU provider, don\u0027t touch"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_68ff4a34","line":448,"range":{"start_line":446,"start_character":8,"end_line":448,"end_character":57},"in_reply_to":"9f6a8fd7_e8705175","updated":"2018-04-18 07:27:44.000000000","message":"Will looking for a fix and give you feedback, Jay","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"57f44ae8f6b6cf14b6de8254471ccec0ed3815c1","unresolved":false,"context_lines":[{"line_number":443,"context_line":"        exist_rp_uuid \u003d \u0027rp_uuid\u0027"},{"line_number":444,"context_line":"        expect_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":445,"context_line":"        rp_tree.new_child(expect_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":446,"context_line":"        # GPU rp which is not availabel anymore, need delete"},{"line_number":447,"context_line":"        unavailable_rp_uuid \u003d \u0027rp_uuid_not_available\u0027"},{"line_number":448,"context_line":"        unavailable_rp_name \u003d \u0027GPU_rp_name_not_available\u0027"},{"line_number":449,"context_line":"        rp_tree.new_child(unavailable_rp_name, \u0027root_uuid\u0027,"},{"line_number":450,"context_line":"                          uuid\u003dunavailable_rp_uuid)"},{"line_number":451,"context_line":"        # rp which is not managed by GPU provider, don\u0027t touch"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_9cb560f1","line":448,"range":{"start_line":446,"start_character":8,"end_line":448,"end_character":57},"in_reply_to":"bf659307_0cddebdb","updated":"2018-04-17 07:02:06.000000000","message":"Hi, Jay, just as jianhua mentioned, users could modify the nova.conf to stop vgpu support, `unavailable` could be used to represent the old gpu rp we created before.\nI think gpu missing may be caused by more reasons, but we can deal with it in a uniform way.","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b17799b8aeac0ef865ac6daf1bfd9a110897dc86","unresolved":false,"context_lines":[{"line_number":494,"context_line":"        self.assertEqual(rp_data.uuid, expect_gpu_grp_id)"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"    def test_update_gpu_rp_no_resource(self):"},{"line_number":497,"context_line":"        # if there is no resource left, give up to update the inventory"},{"line_number":498,"context_line":"        driver \u003d self._get_driver()"},{"line_number":499,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":500,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"}],"source_content_type":"text/x-python","patch_set":34,"id":"bf659307_8c5c9b7d","line":497,"range":{"start_line":497,"start_character":40,"end_line":497,"end_character":71},"updated":"2018-04-13 19:05:24.000000000","message":"I think you mean \"check that the child resource provider is removed from the tree entirely\"?","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"57f44ae8f6b6cf14b6de8254471ccec0ed3815c1","unresolved":false,"context_lines":[{"line_number":494,"context_line":"        self.assertEqual(rp_data.uuid, expect_gpu_grp_id)"},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"    def test_update_gpu_rp_no_resource(self):"},{"line_number":497,"context_line":"        # if there is no resource left, give up to update the inventory"},{"line_number":498,"context_line":"        driver \u003d self._get_driver()"},{"line_number":499,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":500,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_5c734881","line":497,"range":{"start_line":497,"start_character":40,"end_line":497,"end_character":71},"in_reply_to":"bf659307_8c5c9b7d","updated":"2018-04-17 07:02:06.000000000","message":"Ah, foolish mistake. Will update it, thanks, Jay.","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                          alloc)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def test_update_gpu_rp(self):"},{"line_number":427,"context_line":"        # If need a new GPU resource provider, create it"},{"line_number":428,"context_line":"        # If the GPU resource provider exists, update its inventory"},{"line_number":429,"context_line":"        # If the GPU resource provider inventory is changed, and it has vGPUs"},{"line_number":430,"context_line":"        # allocated, reserve all the resources"},{"line_number":431,"context_line":"        # If The GPU resource provider is missing, reserve all the resources"},{"line_number":432,"context_line":"        driver \u003d self._get_driver()"},{"line_number":433,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":434,"context_line":"        # Add two new gpu groups to check below cases:"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_94f8554a","line":431,"range":{"start_line":427,"start_character":3,"end_line":431,"end_character":76},"updated":"2018-09-05 17:21:26.000000000","message":"gah, you definitely could have split this mega test out into single tests for each of the failure and success scenarios....","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                          alloc)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def test_update_gpu_rp(self):"},{"line_number":427,"context_line":"        # If need a new GPU resource provider, create it"},{"line_number":428,"context_line":"        # If the GPU resource provider exists, update its inventory"},{"line_number":429,"context_line":"        # If the GPU resource provider inventory is changed, and it has vGPUs"},{"line_number":430,"context_line":"        # allocated, reserve all the resources"},{"line_number":431,"context_line":"        # If The GPU resource provider is missing, reserve all the resources"},{"line_number":432,"context_line":"        driver \u003d self._get_driver()"},{"line_number":433,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":434,"context_line":"        # Add two new gpu groups to check below cases:"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_d74325af","line":431,"range":{"start_line":427,"start_character":3,"end_line":431,"end_character":76},"in_reply_to":"3f79a3b5_94f8554a","updated":"2018-09-06 01:15:32.000000000","message":"Will split it.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":477,"context_line":"                \u0027step_size\u0027: 1,"},{"line_number":478,"context_line":"            }"},{"line_number":479,"context_line":"        }"},{"line_number":480,"context_line":"        exist_rp_uuid \u003d \u0027exist_rp_uuid\u0027"},{"line_number":481,"context_line":"        exist_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":482,"context_line":"        rp_tree.new_child(exist_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":483,"context_line":"        rp_tree.update_inventory(exist_rp_name, exist_rp_inv)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_14b3e59b","line":480,"range":{"start_line":480,"start_character":24,"end_line":480,"end_character":39},"updated":"2018-09-05 17:21:26.000000000","message":"consider using the nova.tests.uuidsentinel module for actual reference-able UUIDs.\n\n from nova.tests import uuidsentinel as uuids\n ...\n \n     exist_rp_uuid \u003d uuids.exist_rp","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":477,"context_line":"                \u0027step_size\u0027: 1,"},{"line_number":478,"context_line":"            }"},{"line_number":479,"context_line":"        }"},{"line_number":480,"context_line":"        exist_rp_uuid \u003d \u0027exist_rp_uuid\u0027"},{"line_number":481,"context_line":"        exist_rp_name \u003d \u0027GPU_c8328467-badf-43d8-8e28-0e096b0f88b1\u0027"},{"line_number":482,"context_line":"        rp_tree.new_child(exist_rp_name, \u0027root_uuid\u0027, uuid\u003dexist_rp_uuid)"},{"line_number":483,"context_line":"        rp_tree.update_inventory(exist_rp_name, exist_rp_inv)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_f740a1a4","line":480,"range":{"start_line":480,"start_character":24,"end_line":480,"end_character":39},"in_reply_to":"3f79a3b5_14b3e59b","updated":"2018-09-06 01:15:32.000000000","message":"got it.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                          alloc)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def test_reshaper_exception(self):"},{"line_number":427,"context_line":"        # If need a new GPU resource provider, create it"},{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_52715c0c","line":427,"updated":"2018-10-02 12:00:14.000000000","message":"this code comment is not relevant to this test","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                          alloc)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def test_reshaper_exception(self):"},{"line_number":427,"context_line":"        # If need a new GPU resource provider, create it"},{"line_number":428,"context_line":"        driver \u003d self._get_driver()"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        rp_tree \u003d provider_tree.ProviderTree()"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_79ccf833","line":427,"in_reply_to":"3f79a3b5_52715c0c","updated":"2018-10-09 03:02:17.000000000","message":"Will modify it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":445,"context_line":"                          rp_tree, \u0027fake_host_stats\u0027, root_rp_name)"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def test_remove_vgpu_allocation_in_root(self):"},{"line_number":448,"context_line":"        # If need a new GPU resource provider, create it"},{"line_number":449,"context_line":"        driver \u003d self._get_driver()"},{"line_number":450,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":451,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_b266b054","line":448,"updated":"2018-10-02 12:00:14.000000000","message":"this code comment is not relevant to this test","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":479,"context_line":"        self.assertNotIn(rc_fields.ResourceClass.VGPU, resources)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"    def test_vgpu_allocation_out_root_exc(self):"},{"line_number":482,"context_line":"        # If need a new GPU resource provider, create it"},{"line_number":483,"context_line":"        driver \u003d self._get_driver()"},{"line_number":484,"context_line":"        host_stats \u003d self.host_stats()"},{"line_number":485,"context_line":""}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_327b80f4","line":482,"updated":"2018-10-02 12:00:14.000000000","message":"this code comment is not relevant to this test","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":486,"context_line":"        root_uuid \u003d uuids.root_uuid"},{"line_number":487,"context_line":"        root_name \u003d \u0027root_name\u0027"},{"line_number":488,"context_line":"        allocations \u003d {"},{"line_number":489,"context_line":"            \u0027fake_consumer_id\u0027: {"},{"line_number":490,"context_line":"                \u0027allocations\u0027: {"},{"line_number":491,"context_line":"                    uuids.no_root_uuid: {"},{"line_number":492,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_d2e48caa","line":489,"range":{"start_line":489,"start_character":12,"end_line":489,"end_character":30},"updated":"2018-10-02 12:00:14.000000000","message":"technically, you could have done:\n\n uuids.consumer: {\n\nhere and above.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":486,"context_line":"        root_uuid \u003d uuids.root_uuid"},{"line_number":487,"context_line":"        root_name \u003d \u0027root_name\u0027"},{"line_number":488,"context_line":"        allocations \u003d {"},{"line_number":489,"context_line":"            \u0027fake_consumer_id\u0027: {"},{"line_number":490,"context_line":"                \u0027allocations\u0027: {"},{"line_number":491,"context_line":"                    uuids.no_root_uuid: {"},{"line_number":492,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_59d1fcc9","line":489,"range":{"start_line":489,"start_character":12,"end_line":489,"end_character":30},"in_reply_to":"3f79a3b5_d2e48caa","updated":"2018-10-09 03:02:17.000000000","message":"Will modify it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        GPUG \u003d {"},{"line_number":555,"context_line":"            # Need reserve all the resource"},{"line_number":556,"context_line":"            changed_rp_uuid: {"},{"line_number":557,"context_line":"                \u0027uuid\u0027: \u00270ce34e6-fc4d-4f6d-a82a-9219f111ccd6\u0027,"},{"line_number":558,"context_line":"                \u0027type_name\u0027: \u0027GRID K100\u0027,"},{"line_number":559,"context_line":"                \u0027max_heads\u0027: 1,"},{"line_number":560,"context_line":"                \u0027total\u0027: 10,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_12c68417","line":557,"range":{"start_line":557,"start_character":23,"end_line":557,"end_character":60},"updated":"2018-10-02 12:00:14.000000000","message":"this should just be:\n\n \u0027uuid\u0027: changed_rp_uuid\n\nI think?","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        GPUG \u003d {"},{"line_number":555,"context_line":"            # Need reserve all the resource"},{"line_number":556,"context_line":"            changed_rp_uuid: {"},{"line_number":557,"context_line":"                \u0027uuid\u0027: \u00270ce34e6-fc4d-4f6d-a82a-9219f111ccd6\u0027,"},{"line_number":558,"context_line":"                \u0027type_name\u0027: \u0027GRID K100\u0027,"},{"line_number":559,"context_line":"                \u0027max_heads\u0027: 1,"},{"line_number":560,"context_line":"                \u0027total\u0027: 10,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_19f4e454","line":557,"range":{"start_line":557,"start_character":23,"end_line":557,"end_character":60},"in_reply_to":"3f79a3b5_12c68417","updated":"2018-10-09 03:02:17.000000000","message":"No, changed_rp_uuid is for vgpu group, while this one is for a vgpu type. But according to your suggestions above, I think uuids.vgpu_type is better.\nWill modify it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        rp_data \u003d rp_tree.data(no_alloc_rp_name)"},{"line_number":632,"context_line":"        self.assertEqual(rp_data.inventory, expected_no_alloc_rp_inv)"},{"line_number":633,"context_line":"        self.assertEqual(rp_data.name, no_alloc_rp_name)"},{"line_number":634,"context_line":"        self.assertEqual(rp_data.uuid, no_alloc_rp_uuid)"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_f29c280e","line":634,"updated":"2018-10-02 12:00:14.000000000","message":"excellent work splitting up the tests Naichuan. Much easier to read and comprehend. ++","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        rp_data \u003d rp_tree.data(no_alloc_rp_name)"},{"line_number":632,"context_line":"        self.assertEqual(rp_data.inventory, expected_no_alloc_rp_inv)"},{"line_number":633,"context_line":"        self.assertEqual(rp_data.name, no_alloc_rp_name)"},{"line_number":634,"context_line":"        self.assertEqual(rp_data.uuid, no_alloc_rp_uuid)"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_597fbcbb","line":634,"in_reply_to":"3f79a3b5_f29c280e","updated":"2018-10-09 03:02:17.000000000","message":"Thank you very much for your review, Jay.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c599e3824a584dfc344c1f0e13c0a0529b608b07","unresolved":false,"context_lines":[{"line_number":451,"context_line":""},{"line_number":452,"context_line":"        root_uuid \u003d uuids.root_uuid"},{"line_number":453,"context_line":"        allocations \u003d {"},{"line_number":454,"context_line":"            \u0027fake_consumer_id\u0027: {"},{"line_number":455,"context_line":"                \u0027allocations\u0027: {"},{"line_number":456,"context_line":"                    root_uuid: {"},{"line_number":457,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_9bee1afc","line":454,"updated":"2018-11-27 14:30:50.000000000","message":"nit: use uuids.instance instead of \"fake_consumer_id\"","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3598bf18e5b060de0cea9c7300bcf6154840a6d7","unresolved":false,"context_lines":[{"line_number":451,"context_line":""},{"line_number":452,"context_line":"        root_uuid \u003d uuids.root_uuid"},{"line_number":453,"context_line":"        allocations \u003d {"},{"line_number":454,"context_line":"            \u0027fake_consumer_id\u0027: {"},{"line_number":455,"context_line":"                \u0027allocations\u0027: {"},{"line_number":456,"context_line":"                    root_uuid: {"},{"line_number":457,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_e1bf4dc8","line":454,"in_reply_to":"3f79a3b5_9bee1afc","updated":"2018-11-28 09:26:33.000000000","message":"Will change it.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c599e3824a584dfc344c1f0e13c0a0529b608b07","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            \u0027fake_consumer_id\u0027: {"},{"line_number":455,"context_line":"                \u0027allocations\u0027: {"},{"line_number":456,"context_line":"                    root_uuid: {"},{"line_number":457,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"},{"line_number":458,"context_line":"                                      \u0027resource\u0027: \u0027fake_resource\u0027}"},{"line_number":459,"context_line":"                    }"},{"line_number":460,"context_line":"                }"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_3b1266ff","line":457,"range":{"start_line":457,"start_character":68,"end_line":457,"end_character":75},"updated":"2018-11-27 14:30:50.000000000","message":"this should be a number (amount used of the VGPU resource class on the root_uuid provider).","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3598bf18e5b060de0cea9c7300bcf6154840a6d7","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            \u0027fake_consumer_id\u0027: {"},{"line_number":455,"context_line":"                \u0027allocations\u0027: {"},{"line_number":456,"context_line":"                    root_uuid: {"},{"line_number":457,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"},{"line_number":458,"context_line":"                                      \u0027resource\u0027: \u0027fake_resource\u0027}"},{"line_number":459,"context_line":"                    }"},{"line_number":460,"context_line":"                }"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_61a1fda6","line":457,"range":{"start_line":457,"start_character":68,"end_line":457,"end_character":75},"in_reply_to":"3f79a3b5_3b1266ff","updated":"2018-11-28 09:26:33.000000000","message":"Ah, will change it. Sorry","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c599e3824a584dfc344c1f0e13c0a0529b608b07","unresolved":false,"context_lines":[{"line_number":455,"context_line":"                \u0027allocations\u0027: {"},{"line_number":456,"context_line":"                    root_uuid: {"},{"line_number":457,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"},{"line_number":458,"context_line":"                                      \u0027resource\u0027: \u0027fake_resource\u0027}"},{"line_number":459,"context_line":"                    }"},{"line_number":460,"context_line":"                }"},{"line_number":461,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_5bf402cd","line":458,"range":{"start_line":458,"start_character":37,"end_line":458,"end_character":66},"updated":"2018-11-27 14:30:50.000000000","message":"what it this? Please use actual resource classes if you can.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3598bf18e5b060de0cea9c7300bcf6154840a6d7","unresolved":false,"context_lines":[{"line_number":455,"context_line":"                \u0027allocations\u0027: {"},{"line_number":456,"context_line":"                    root_uuid: {"},{"line_number":457,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"},{"line_number":458,"context_line":"                                      \u0027resource\u0027: \u0027fake_resource\u0027}"},{"line_number":459,"context_line":"                    }"},{"line_number":460,"context_line":"                }"},{"line_number":461,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_81a459b8","line":458,"range":{"start_line":458,"start_character":37,"end_line":458,"end_character":66},"in_reply_to":"3f79a3b5_5bf402cd","updated":"2018-11-28 09:26:33.000000000","message":"Will change it.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c599e3824a584dfc344c1f0e13c0a0529b608b07","unresolved":false,"context_lines":[{"line_number":489,"context_line":"            uuids.consumer: {"},{"line_number":490,"context_line":"                \u0027allocations\u0027: {"},{"line_number":491,"context_line":"                    uuids.no_root_uuid: {"},{"line_number":492,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"},{"line_number":493,"context_line":"                                      \u0027resource\u0027: \u0027fake_resource\u0027}"},{"line_number":494,"context_line":"                    }"},{"line_number":495,"context_line":"                }"},{"line_number":496,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_db7d721d","line":493,"range":{"start_line":492,"start_character":38,"end_line":493,"end_character":66},"updated":"2018-11-27 14:30:50.000000000","message":"same comments as above. leaving incorrectly-formatted data in a test fixture like this makes it difficult to read and understand the tests in the future...","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3598bf18e5b060de0cea9c7300bcf6154840a6d7","unresolved":false,"context_lines":[{"line_number":489,"context_line":"            uuids.consumer: {"},{"line_number":490,"context_line":"                \u0027allocations\u0027: {"},{"line_number":491,"context_line":"                    uuids.no_root_uuid: {"},{"line_number":492,"context_line":"                        \u0027resources\u0027: {rc_fields.ResourceClass.VGPU: \u0027vgpu1\u0027,"},{"line_number":493,"context_line":"                                      \u0027resource\u0027: \u0027fake_resource\u0027}"},{"line_number":494,"context_line":"                    }"},{"line_number":495,"context_line":"                }"},{"line_number":496,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_218f852f","line":493,"range":{"start_line":492,"start_character":38,"end_line":493,"end_character":66},"in_reply_to":"3f79a3b5_db7d721d","updated":"2018-11-28 09:26:33.000000000","message":"Will modify it.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"}],"nova/virt/xenapi/driver.py":[{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2f1d3933cdf9cbf4e046e51cdd862cd8543950c0","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            )"},{"line_number":505,"context_line":"        return result"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, parent_uuid):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider is not exist, create a"},{"line_number":510,"context_line":"        it as a child the compute node, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_42d9e57c","line":507,"range":{"start_line":507,"start_character":51,"end_line":507,"end_character":62},"updated":"2017-11-16 08:19:15.000000000","message":"compute_node?","commit_id":"86969ed07fb6f5ae0f4a50b16d4da6c7825a94d0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2f1d3933cdf9cbf4e046e51cdd862cd8543950c0","unresolved":false,"context_lines":[{"line_number":511,"context_line":"        \"\"\""},{"line_number":512,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":513,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":514,"context_line":"            rp_name \u003d \u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027]"},{"line_number":515,"context_line":"            inv \u003d {"},{"line_number":516,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":517,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_0273edb2","line":514,"range":{"start_line":514,"start_character":67,"end_line":514,"end_character":77},"updated":"2017-11-16 08:19:15.000000000","message":"I\u0027d suggest use vGPU\u0027s type uuid instead of type name.","commit_id":"86969ed07fb6f5ae0f4a50b16d4da6c7825a94d0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2f1d3933cdf9cbf4e046e51cdd862cd8543950c0","unresolved":false,"context_lines":[{"line_number":525,"context_line":"            else:"},{"line_number":526,"context_line":"                rp_tree.new_child(rp_name, parent_uuid)"},{"line_number":527,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":528,"context_line":"                    raise exception.NovaException(_(\"Error: create children \""},{"line_number":529,"context_line":"                                                    \"node failed\"))"},{"line_number":530,"context_line":"                rp_tree.update_inventory(rp_name, inv)"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"    def get_available_resource(self, nodename):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_62df410d","line":529,"range":{"start_line":528,"start_character":60,"end_line":529,"end_character":64},"updated":"2017-11-16 08:19:15.000000000","message":"\"failed to create resource provider for %s\" % rp_name","commit_id":"86969ed07fb6f5ae0f4a50b16d4da6c7825a94d0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2f1d3933cdf9cbf4e046e51cdd862cd8543950c0","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":528,"context_line":"                    raise exception.NovaException(_(\"Error: create children \""},{"line_number":529,"context_line":"                                                    \"node failed\"))"},{"line_number":530,"context_line":"                rp_tree.update_inventory(rp_name, inv)"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":533,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_02ae4d97","line":530,"updated":"2017-11-16 08:19:15.000000000","message":"the update_inventory() interface in virt driver is planned to return a bool value to indicate if there is any change, so need return a bool value here also.","commit_id":"86969ed07fb6f5ae0f4a50b16d4da6c7825a94d0"},{"author":{"_account_id":19853,"name":"Nguyen Hung Phuong","email":"phuongnh@vn.fujitsu.com","username":"phuongnh"},"change_message_id":"a3264ca9c17b66b6d5eb3aec630a8f16658e3845","unresolved":false,"context_lines":[{"line_number":523,"context_line":"            if rp_tree.exists(rp_name):"},{"line_number":524,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":525,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":526,"context_line":"                                                    \"inventory for %s\""},{"line_number":527,"context_line":"                                                    % rp_name))"},{"line_number":528,"context_line":"            else:"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f485f77_008760b7","line":527,"range":{"start_line":526,"start_character":52,"end_line":527,"end_character":63},"updated":"2017-11-16 12:12:57.000000000","message":"Not sure but I think to fix pep8 issue you can put close parentheses to the left of rp_name parameter.","commit_id":"dc94a8f034c2fb951a5e5ed19ec9d67d4553570a"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"94fd9f4f6dbea1622e051806b9ca328c1006168d","unresolved":false,"context_lines":[{"line_number":523,"context_line":"            if rp_tree.exists(rp_name):"},{"line_number":524,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":525,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":526,"context_line":"                                                    \"inventory for %s\""},{"line_number":527,"context_line":"                                                    % rp_name))"},{"line_number":528,"context_line":"            else:"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f485f77_48a448a6","line":527,"range":{"start_line":526,"start_character":52,"end_line":527,"end_character":63},"in_reply_to":"1f485f77_008760b7","updated":"2017-11-17 02:58:38.000000000","message":"Done","commit_id":"dc94a8f034c2fb951a5e5ed19ec9d67d4553570a"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fd5f7a5bc754dbfcb9869b99d4239856cdbb5ffc","unresolved":false,"context_lines":[{"line_number":523,"context_line":"            if rp_tree.exists(rp_name):"},{"line_number":524,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":525,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":526,"context_line":"                                                    \"inventory for %s\""},{"line_number":527,"context_line":"                                                    % rp_name))"},{"line_number":528,"context_line":"            else:"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f485f77_68a7040d","line":527,"range":{"start_line":526,"start_character":52,"end_line":527,"end_character":63},"in_reply_to":"1f485f77_008760b7","updated":"2017-11-17 02:38:54.000000000","message":"Thank you very much, Nguyen.\nWill fix the error.","commit_id":"dc94a8f034c2fb951a5e5ed19ec9d67d4553570a"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a3eb2a2a44ae42e06d6c253258f07f92d28d7315","unresolved":false,"context_lines":[{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider is not exist, create a"},{"line_number":510,"context_line":"        it as a child the compute node, then attach the inventory to it."},{"line_number":511,"context_line":"        \"\"\""},{"line_number":512,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":513,"context_line":"        for grp_id in vgpu_stats:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_263a5dcb","line":510,"updated":"2017-11-17 04:50:10.000000000","message":"If the resource provider doesn\u0027t exist, we create one and make it as the compute node\u0027s child...","commit_id":"2e0025c0265a6f455baaaf63c132b5232a5c87aa"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f0a3f15e890537eb2bc5afd7439af6b89d9a55b1","unresolved":false,"context_lines":[{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider is not exist, create a"},{"line_number":510,"context_line":"        it as a child the compute node, then attach the inventory to it."},{"line_number":511,"context_line":"        \"\"\""},{"line_number":512,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":513,"context_line":"        for grp_id in vgpu_stats:"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_86111160","line":510,"in_reply_to":"1f485f77_263a5dcb","updated":"2017-11-17 05:31:59.000000000","message":"Will modify it. Thank you very much","commit_id":"2e0025c0265a6f455baaaf63c132b5232a5c87aa"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a3eb2a2a44ae42e06d6c253258f07f92d28d7315","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        it as a child the compute node, then attach the inventory to it."},{"line_number":511,"context_line":"        \"\"\""},{"line_number":512,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":513,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":514,"context_line":"            rp_name \u003d \u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027]"},{"line_number":515,"context_line":"            inv \u003d {"},{"line_number":516,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_46c79997","line":513,"updated":"2017-11-17 04:50:10.000000000","message":"Add a comment to explain why use this as the name. Should we also include the type name also. So we can get useful info by reading the name? If do that, please note we need ensure if it allows spaces in the name. The type name allows spaces.","commit_id":"2e0025c0265a6f455baaaf63c132b5232a5c87aa"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"7e78114b19d863773ce041555691aee55302492d","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        it as a child the compute node, then attach the inventory to it."},{"line_number":511,"context_line":"        \"\"\""},{"line_number":512,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":513,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":514,"context_line":"            rp_name \u003d \u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027]"},{"line_number":515,"context_line":"            inv \u003d {"},{"line_number":516,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_fe6e05c7","line":513,"in_reply_to":"1f485f77_46c79997","updated":"2017-11-17 08:47:25.000000000","message":"Tested rp name with blank, looks not work. Could we send uuid only?","commit_id":"2e0025c0265a6f455baaaf63c132b5232a5c87aa"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f0a3f15e890537eb2bc5afd7439af6b89d9a55b1","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        it as a child the compute node, then attach the inventory to it."},{"line_number":511,"context_line":"        \"\"\""},{"line_number":512,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":513,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":514,"context_line":"            rp_name \u003d \u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027]"},{"line_number":515,"context_line":"            inv \u003d {"},{"line_number":516,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f485f77_66161558","line":513,"in_reply_to":"1f485f77_46c79997","updated":"2017-11-17 05:31:59.000000000","message":"Will add it","commit_id":"2e0025c0265a6f455baaaf63c132b5232a5c87aa"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"4c2d526aa9dc25a3021a0a026ef4ff1efa903706","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            )"},{"line_number":505,"context_line":"        return result"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider doesn\u0027t exist, we create"},{"line_number":510,"context_line":"        one and make it as the compute node\u0027s child, then attach the inventory"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f485f77_644968b5","line":507,"range":{"start_line":507,"start_character":8,"end_line":507,"end_character":23},"updated":"2017-11-17 10:37:11.000000000","message":"This is an internal function and will only be called by XenAPI driver?\nOr the virt/driver.py should define an interface for each driver to implement accordingly?","commit_id":"ecdf1ba1150445780ec0c076d8a18288131b76c3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f4a73e5e7a307250c1d6499838fe4a0fa77d3b44","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            )"},{"line_number":505,"context_line":"        return result"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider doesn\u0027t exist, we create"},{"line_number":510,"context_line":"        one and make it as the compute node\u0027s child, then attach the inventory"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_e268a6bb","line":507,"range":{"start_line":507,"start_character":8,"end_line":507,"end_character":23},"in_reply_to":"1f485f77_644968b5","updated":"2017-11-20 01:54:55.000000000","message":"It is an internal function and called by xenapi driver only.","commit_id":"ecdf1ba1150445780ec0c076d8a18288131b76c3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"647e1dd6e3423fb1b0af2ffc0f314c2e3cc7b801","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                }"},{"line_number":526,"context_line":"            }"},{"line_number":527,"context_line":"            if rp_tree.exists(rp_name):"},{"line_number":528,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":529,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":530,"context_line":"                                                    \"inventory for %s\")"},{"line_number":531,"context_line":"                                                    % rp_name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f485f77_ea5d1f79","line":528,"range":{"start_line":528,"start_character":16,"end_line":528,"end_character":62},"updated":"2017-11-17 12:40:57.000000000","message":"ProviderTree.update_inventory returns a bool indicating whether the inventory was changed in the ProviderTree - but False just means there were no changes to put into effect.  It does *not* mean there was an error.\n\nSo instead of raising an exception, you should use the return values from update_inventory to decide whether to return True or False from the driver method.","commit_id":"ecdf1ba1150445780ec0c076d8a18288131b76c3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f4a73e5e7a307250c1d6499838fe4a0fa77d3b44","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                }"},{"line_number":526,"context_line":"            }"},{"line_number":527,"context_line":"            if rp_tree.exists(rp_name):"},{"line_number":528,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":529,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":530,"context_line":"                                                    \"inventory for %s\")"},{"line_number":531,"context_line":"                                                    % rp_name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_62833658","line":528,"range":{"start_line":528,"start_character":16,"end_line":528,"end_character":62},"in_reply_to":"1f485f77_ea5d1f79","updated":"2017-11-20 01:54:55.000000000","message":"Will modify it. Thank you for the guild.","commit_id":"ecdf1ba1150445780ec0c076d8a18288131b76c3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"647e1dd6e3423fb1b0af2ffc0f314c2e3cc7b801","unresolved":false,"context_lines":[{"line_number":535,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":536,"context_line":"                                                    \" provider for %s\")"},{"line_number":537,"context_line":"                                                    % rp_name)"},{"line_number":538,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":539,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":540,"context_line":"                                                    \"inventory for %s\")"},{"line_number":541,"context_line":"                                                    % rp_name)"},{"line_number":542,"context_line":"        return True"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"    def get_available_resource(self, nodename):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f485f77_aad847ee","line":541,"range":{"start_line":538,"start_character":16,"end_line":541,"end_character":62},"updated":"2017-11-17 12:40:57.000000000","message":"This is duplicated; why not structure this as:\n\n if not rp_tree.exists(rp_name):\n     create it\n     raise if that errors\n updated \u003d rp_tree.update_inventory\n\n...and by the way, per the above, you would then do something like:\n\n return_value \u003d return_value or updated","commit_id":"ecdf1ba1150445780ec0c076d8a18288131b76c3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f4a73e5e7a307250c1d6499838fe4a0fa77d3b44","unresolved":false,"context_lines":[{"line_number":535,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":536,"context_line":"                                                    \" provider for %s\")"},{"line_number":537,"context_line":"                                                    % rp_name)"},{"line_number":538,"context_line":"                if not rp_tree.update_inventory(rp_name, inv):"},{"line_number":539,"context_line":"                    raise exception.NovaException(_(\"Failed to update \""},{"line_number":540,"context_line":"                                                    \"inventory for %s\")"},{"line_number":541,"context_line":"                                                    % rp_name)"},{"line_number":542,"context_line":"        return True"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"    def get_available_resource(self, nodename):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_c2b48238","line":541,"range":{"start_line":538,"start_character":16,"end_line":541,"end_character":62},"in_reply_to":"1f485f77_aad847ee","updated":"2017-11-20 01:54:55.000000000","message":"Will change it, thanks.","commit_id":"ecdf1ba1150445780ec0c076d8a18288131b76c3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"da5a65df26e66c44c00a6e1cedfa2c64db1e1ac2","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":531,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":532,"context_line":"                                                    \" provider for %s\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff82abbf_74ae69e8","line":529,"range":{"start_line":529,"start_character":16,"end_line":529,"end_character":56},"updated":"2017-11-21 13:20:58.000000000","message":"If you do this, you also need to set updated to True.","commit_id":"ddf99e13bc8995c46f2b908510ffe38ac7b2b815"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a5b5713b33a16a7e086da765e2458759f7c6d914","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":531,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":532,"context_line":"                                                    \" provider for %s\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff82abbf_58e4a8ac","line":529,"range":{"start_line":529,"start_character":16,"end_line":529,"end_character":56},"in_reply_to":"ff82abbf_3d9af613","updated":"2017-11-22 01:53:41.000000000","message":"Any change in the provider tree should be notified to the calling function. I think the reason to \"Set updated to True\" is that we added a new child resource provider. So the provider tree got changed. It\u0027s good to avoid depending only on the following update_inventory().","commit_id":"ddf99e13bc8995c46f2b908510ffe38ac7b2b815"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3ee717aaf3b53153baa13287577c10c50259de1b","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":531,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":532,"context_line":"                                                    \" provider for %s\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff82abbf_9d88e2c6","line":529,"range":{"start_line":529,"start_character":16,"end_line":529,"end_character":56},"in_reply_to":"ff82abbf_720bd68d","updated":"2017-11-22 01:03:54.000000000","message":"Will update it, thanks.","commit_id":"ddf99e13bc8995c46f2b908510ffe38ac7b2b815"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"4a047989938858b4462a31e0ac05f1f90248dfc5","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":531,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":532,"context_line":"                                                    \" provider for %s\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff82abbf_720bd68d","line":529,"range":{"start_line":529,"start_character":16,"end_line":529,"end_character":56},"in_reply_to":"ff82abbf_74ae69e8","updated":"2017-11-21 16:31:59.000000000","message":"++\n\nAnd let\u0027s use the gpu group\u0027s uuid as the resource provider\u0027s uuid, so that we can easily to mapping it back to GPU from the RP uuid in the allocation passed in spawn.","commit_id":"ddf99e13bc8995c46f2b908510ffe38ac7b2b815"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3ee717aaf3b53153baa13287577c10c50259de1b","unresolved":false,"context_lines":[{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                rp_tree.new_child(rp_name, compute_node)"},{"line_number":530,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":531,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":532,"context_line":"                                                    \" provider for %s\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"ff82abbf_3d9af613","line":529,"range":{"start_line":529,"start_character":16,"end_line":529,"end_character":56},"in_reply_to":"ff82abbf_74ae69e8","updated":"2017-11-22 01:03:54.000000000","message":"To avid the inventory is empty?\nWill fix it~","commit_id":"ddf99e13bc8995c46f2b908510ffe38ac7b2b815"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            )"},{"line_number":505,"context_line":"        return result"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider doesn\u0027t exist, we create"},{"line_number":510,"context_line":"        one and make it as the compute node\u0027s child, then attach the inventory"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_dd91879b","line":507,"range":{"start_line":507,"start_character":51,"end_line":507,"end_character":63},"updated":"2017-11-22 02:55:21.000000000","message":"nit: use compute_node_uuid or parent_uuid?","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        return result"},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node):"},{"line_number":508,"context_line":"        \"\"\"Nested resource provider support. Update the inventory of each"},{"line_number":509,"context_line":"        resource provider. If the resource provider doesn\u0027t exist, we create"},{"line_number":510,"context_line":"        one and make it as the compute node\u0027s child, then attach the inventory"},{"line_number":511,"context_line":"        to it."},{"line_number":512,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_bdecc329","line":509,"range":{"start_line":508,"start_character":11,"end_line":509,"end_character":26},"updated":"2017-11-22 02:55:21.000000000","message":"nit: Update the resource providers for vGPUs in the provider tree.","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":514,"context_line":"        updated \u003d False"},{"line_number":515,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":516,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":517,"context_line":"            # distinguish corresponding resource providers. Add vgpu uuid"},{"line_number":518,"context_line":"            # to show supported vgpus as well."},{"line_number":519,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":520,"context_line":"                       vgpu_stats[grp_id][\u0027type_name\u0027])"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_1dddaf6f","line":517,"range":{"start_line":517,"start_character":64,"end_line":517,"end_character":73},"updated":"2017-11-22 02:55:21.000000000","message":"\u003d\u003e vGPU *type* uuid","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":516,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":517,"context_line":"            # distinguish corresponding resource providers. Add vgpu uuid"},{"line_number":518,"context_line":"            # to show supported vgpus as well."},{"line_number":519,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":520,"context_line":"                       vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":521,"context_line":"            inv \u003d {"},{"line_number":522,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_9dd21f5c","line":519,"updated":"2017-11-22 02:55:21.000000000","message":"Empty spaces are allowed for rp_name. Suggest include the vGPU type\u0027s name in the RP name also.","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"999040311072134667d046688e3d093db2fe9f9f","unresolved":false,"context_lines":[{"line_number":528,"context_line":"            }"},{"line_number":529,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":530,"context_line":"                # Set gpu group uuid as the resource provider uuid. When nova"},{"line_number":531,"context_line":"                # compute request to spawn a instance, it will send it to"},{"line_number":532,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":533,"context_line":"                # corresponding gpu group on the host"},{"line_number":534,"context_line":"                rp_tree.new_child(rp_name, compute_node, grp_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_7dcf1bb0","line":531,"range":{"start_line":531,"start_character":43,"end_line":531,"end_character":44},"updated":"2017-11-22 02:55:21.000000000","message":"an","commit_id":"e5c89cc77afecc86c9fbceda76f51478357c7935"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"49e42ce3d5158ce9c90ec7f674747092729485b4","unresolved":false,"context_lines":[{"line_number":516,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":517,"context_line":"            # to show supported vgpus as well."},{"line_number":518,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":519,"context_line":"                       \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":520,"context_line":"            inv \u003d {"},{"line_number":521,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":522,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_1e67b327","line":519,"updated":"2017-11-23 17:38:15.000000000","message":"I\u0027m still wondering why we can\u0027t make it more readable?","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"b562509c6fb1cabda6578f47f43829d1df7bb2c6","unresolved":false,"context_lines":[{"line_number":516,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":517,"context_line":"            # to show supported vgpus as well."},{"line_number":518,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":519,"context_line":"                       \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":520,"context_line":"            inv \u003d {"},{"line_number":521,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":522,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_c6d3b2d4","line":519,"in_reply_to":"ff82abbf_1e67b327","updated":"2017-11-24 09:06:26.000000000","message":"Done","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"276822c8450167d55bd111eabdee9a0fd2d707aa","unresolved":false,"context_lines":[{"line_number":516,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":517,"context_line":"            # to show supported vgpus as well."},{"line_number":518,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":519,"context_line":"                       \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":520,"context_line":"            inv \u003d {"},{"line_number":521,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":522,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_154b0959","line":519,"in_reply_to":"ff82abbf_1e67b327","updated":"2017-11-24 02:09:00.000000000","message":"Will fix that.","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"49e42ce3d5158ce9c90ec7f674747092729485b4","unresolved":false,"context_lines":[{"line_number":517,"context_line":"            # to show supported vgpus as well."},{"line_number":518,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":519,"context_line":"                       \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":520,"context_line":"            inv \u003d {"},{"line_number":521,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":522,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":523,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_9e72e3e2","line":520,"updated":"2017-11-23 17:38:15.000000000","message":"check if total \u003e 0 before populate inv data.","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"b562509c6fb1cabda6578f47f43829d1df7bb2c6","unresolved":false,"context_lines":[{"line_number":517,"context_line":"            # to show supported vgpus as well."},{"line_number":518,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":519,"context_line":"                       \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":520,"context_line":"            inv \u003d {"},{"line_number":521,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":522,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":523,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_26e29ea1","line":520,"in_reply_to":"ff82abbf_9e72e3e2","updated":"2017-11-24 09:06:26.000000000","message":"Done","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"276822c8450167d55bd111eabdee9a0fd2d707aa","unresolved":false,"context_lines":[{"line_number":517,"context_line":"            # to show supported vgpus as well."},{"line_number":518,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_stats[grp_id][\u0027uuid\u0027] +"},{"line_number":519,"context_line":"                       \u0027_\u0027 + vgpu_stats[grp_id][\u0027type_name\u0027])"},{"line_number":520,"context_line":"            inv \u003d {"},{"line_number":521,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":522,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":523,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_753cd5be","line":520,"in_reply_to":"ff82abbf_9e72e3e2","updated":"2017-11-24 02:09:00.000000000","message":"Will fix that.","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"49e42ce3d5158ce9c90ec7f674747092729485b4","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                # Set gpu group uuid as the resource provider uuid. When nova"},{"line_number":530,"context_line":"                # compute request to spawn an instance, it will send it to"},{"line_number":531,"context_line":"                # driver in `allocations`, then we could easily find the"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_5e7c5bb4","line":528,"range":{"start_line":528,"start_character":34,"end_line":528,"end_character":41},"updated":"2017-11-23 17:38:15.000000000","message":"use grp_id?","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"b562509c6fb1cabda6578f47f43829d1df7bb2c6","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                # Set gpu group uuid as the resource provider uuid. When nova"},{"line_number":530,"context_line":"                # compute request to spawn an instance, it will send it to"},{"line_number":531,"context_line":"                # driver in `allocations`, then we could easily find the"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_86d92af4","line":528,"range":{"start_line":528,"start_character":34,"end_line":528,"end_character":41},"in_reply_to":"ff82abbf_5e7c5bb4","updated":"2017-11-24 09:06:26.000000000","message":"Done","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"276822c8450167d55bd111eabdee9a0fd2d707aa","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":526,"context_line":"                }"},{"line_number":527,"context_line":"            }"},{"line_number":528,"context_line":"            if not rp_tree.exists(rp_name):"},{"line_number":529,"context_line":"                # Set gpu group uuid as the resource provider uuid. When nova"},{"line_number":530,"context_line":"                # compute request to spawn an instance, it will send it to"},{"line_number":531,"context_line":"                # driver in `allocations`, then we could easily find the"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff82abbf_35464d51","line":528,"range":{"start_line":528,"start_character":34,"end_line":528,"end_character":41},"in_reply_to":"ff82abbf_5e7c5bb4","updated":"2017-11-24 02:09:00.000000000","message":"Will fix that.","commit_id":"fee09716da6b55261e689ab40922162a51c47957"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"6b81c0c68dc12a4e2fa745a302757e38d9f15e02","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        updated \u003d False"},{"line_number":509,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":510,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":511,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":512,"context_line":"            # to show supported vgpus as well."},{"line_number":513,"context_line":"            if vgpu_stats[grp_id][\u0027remaining\u0027] \u003c\u003d 0:"},{"line_number":514,"context_line":"                # If the gpu group has no resource left, remove the rp if it"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_ed6faef9","line":511,"range":{"start_line":511,"start_character":64,"end_line":511,"end_character":78},"updated":"2017-11-24 15:36:36.000000000","message":"\u003d\u003e vGPU type info\nas vGPU type name is included also","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"4aba2be8b657df9b9c1f67811ab1d118d1fe1031","unresolved":false,"context_lines":[{"line_number":508,"context_line":"        updated \u003d False"},{"line_number":509,"context_line":"        for grp_id in vgpu_stats:"},{"line_number":510,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":511,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":512,"context_line":"            # to show supported vgpus as well."},{"line_number":513,"context_line":"            if vgpu_stats[grp_id][\u0027remaining\u0027] \u003c\u003d 0:"},{"line_number":514,"context_line":"                # If the gpu group has no resource left, remove the rp if it"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_0007291a","line":511,"range":{"start_line":511,"start_character":64,"end_line":511,"end_character":78},"in_reply_to":"ff82abbf_ed6faef9","updated":"2017-11-27 01:15:01.000000000","message":"Will modify it.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"6b81c0c68dc12a4e2fa745a302757e38d9f15e02","unresolved":false,"context_lines":[{"line_number":510,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":511,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":512,"context_line":"            # to show supported vgpus as well."},{"line_number":513,"context_line":"            if vgpu_stats[grp_id][\u0027remaining\u0027] \u003c\u003d 0:"},{"line_number":514,"context_line":"                # If the gpu group has no resource left, remove the rp if it"},{"line_number":515,"context_line":"                # exists and jump out of the loop"},{"line_number":516,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":517,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":518,"context_line":"                    updated \u003d True"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_ad23e6bc","line":515,"range":{"start_line":513,"start_character":12,"end_line":515,"end_character":49},"updated":"2017-11-24 15:36:36.000000000","message":"This is wrong. The inv contains the total capacity not the remaining capacity. We can\u0027t remove this RP when remaining capacity \u003c\u003d 0.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"4aba2be8b657df9b9c1f67811ab1d118d1fe1031","unresolved":false,"context_lines":[{"line_number":510,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":511,"context_line":"            # distinguish corresponding resource providers. Add vgpu type uuid"},{"line_number":512,"context_line":"            # to show supported vgpus as well."},{"line_number":513,"context_line":"            if vgpu_stats[grp_id][\u0027remaining\u0027] \u003c\u003d 0:"},{"line_number":514,"context_line":"                # If the gpu group has no resource left, remove the rp if it"},{"line_number":515,"context_line":"                # exists and jump out of the loop"},{"line_number":516,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":517,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":518,"context_line":"                    updated \u003d True"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_200cad39","line":515,"range":{"start_line":513,"start_character":12,"end_line":515,"end_character":49},"in_reply_to":"ff82abbf_ad23e6bc","updated":"2017-11-27 01:15:01.000000000","message":"Will check that.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"f2e7165e92644beb1451c70170377e9a8f8b48a7","unresolved":false,"context_lines":[{"line_number":520,"context_line":""},{"line_number":521,"context_line":"            vgpu_type_uuid \u003d vgpu_stats[grp_id][\u0027uuid\u0027]"},{"line_number":522,"context_line":"            vgpu_type_name \u003d vgpu_stats[grp_id][\u0027type_name\u0027]"},{"line_number":523,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_type_uuid +"},{"line_number":524,"context_line":"                       \u0027_\u0027 + vgpu_type_name)"},{"line_number":525,"context_line":"            inv \u003d {"},{"line_number":526,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_28a264fe","line":523,"updated":"2017-11-24 15:48:21.000000000","message":"I meant can we name it as something like:\nResource provider for vGPU type (\u003cuuid\u003e:\u003cvGPU type name\u003e) in GPU group (\u003cgroup_uuid\u003e)\n?\nIt will be easier for reading the RP info.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"4aba2be8b657df9b9c1f67811ab1d118d1fe1031","unresolved":false,"context_lines":[{"line_number":520,"context_line":""},{"line_number":521,"context_line":"            vgpu_type_uuid \u003d vgpu_stats[grp_id][\u0027uuid\u0027]"},{"line_number":522,"context_line":"            vgpu_type_name \u003d vgpu_stats[grp_id][\u0027type_name\u0027]"},{"line_number":523,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_type_uuid +"},{"line_number":524,"context_line":"                       \u0027_\u0027 + vgpu_type_name)"},{"line_number":525,"context_line":"            inv \u003d {"},{"line_number":526,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_c042a13e","line":523,"in_reply_to":"ff82abbf_28a264fe","updated":"2017-11-27 01:15:01.000000000","message":"OK, will fix it.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"6b81c0c68dc12a4e2fa745a302757e38d9f15e02","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            vgpu_type_name \u003d vgpu_stats[grp_id][\u0027type_name\u0027]"},{"line_number":523,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_type_uuid +"},{"line_number":524,"context_line":"                       \u0027_\u0027 + vgpu_type_name)"},{"line_number":525,"context_line":"            inv \u003d {"},{"line_number":526,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":527,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":528,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_ed480e88","line":525,"updated":"2017-11-24 15:36:36.000000000","message":"As I commented in the previous PS, need check total \u003e 0 before create inv data.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"4aba2be8b657df9b9c1f67811ab1d118d1fe1031","unresolved":false,"context_lines":[{"line_number":522,"context_line":"            vgpu_type_name \u003d vgpu_stats[grp_id][\u0027type_name\u0027]"},{"line_number":523,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + vgpu_type_uuid +"},{"line_number":524,"context_line":"                       \u0027_\u0027 + vgpu_type_name)"},{"line_number":525,"context_line":"            inv \u003d {"},{"line_number":526,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":527,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":528,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ff82abbf_8048195c","line":525,"in_reply_to":"ff82abbf_ed480e88","updated":"2017-11-27 01:15:01.000000000","message":"Will move remain checking to total checking.","commit_id":"b2bf7c8516d992de4555c08ff5870d242911f0e0"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"1840cab1231adddd6423d2f74be16660221abdaf","unresolved":false,"context_lines":[{"line_number":499,"context_line":"            )"},{"line_number":500,"context_line":"        return result"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node_uuid):"},{"line_number":503,"context_line":"        \"\"\"Update the resource providers for vGPUs in the provider tree. If the"},{"line_number":504,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"},{"line_number":505,"context_line":"        compute node\u0027s child, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_dfa6c60f","line":502,"range":{"start_line":502,"start_character":4,"end_line":502,"end_character":70},"updated":"2017-11-29 01:34:08.000000000","message":"It seems this method here isn\u0027t been called by any other method. And I checked the related VGPU and Nested resource provider patches, I found one https://review.openstack.org/#/c/521187/ \nSo in the future, we need implement update_provider_tree() in our xenapi/driver.py, and update_provider_tree() will call this function _update_vgpu_rp(), right?","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"a85978baf5e93db283f818b7acb0d49c3deaf6d4","unresolved":false,"context_lines":[{"line_number":499,"context_line":"            )"},{"line_number":500,"context_line":"        return result"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node_uuid):"},{"line_number":503,"context_line":"        \"\"\"Update the resource providers for vGPUs in the provider tree. If the"},{"line_number":504,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"},{"line_number":505,"context_line":"        compute node\u0027s child, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_44bf41a9","line":502,"range":{"start_line":502,"start_character":4,"end_line":502,"end_character":70},"in_reply_to":"ff82abbf_494e7c38","updated":"2017-11-29 08:06:02.000000000","message":"Thanks for explain this, it\u0027s clear for me","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c4898bdaea3b9758aa8923b61e24a83e5733bfa8","unresolved":false,"context_lines":[{"line_number":499,"context_line":"            )"},{"line_number":500,"context_line":"        return result"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node_uuid):"},{"line_number":503,"context_line":"        \"\"\"Update the resource providers for vGPUs in the provider tree. If the"},{"line_number":504,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"},{"line_number":505,"context_line":"        compute node\u0027s child, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_494e7c38","line":502,"range":{"start_line":502,"start_character":4,"end_line":502,"end_character":70},"in_reply_to":"ff82abbf_dfa6c60f","updated":"2017-11-29 06:42:49.000000000","message":"You are right. The following patch is to implement update_provider_tree() for XenAPI. Once that\u0027s done, we should create patch or update this patch to invoke this function in update_provider_tree(). \nhttps://review.openstack.org/#/c/521041/4/nova/virt/xenapi/driver.py","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"434ba87c7331b89c5af11c779fb6efac5c4c3ab7","unresolved":false,"context_lines":[{"line_number":499,"context_line":"            )"},{"line_number":500,"context_line":"        return result"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"    def _update_vgpu_rp(self, rp_tree, host_stats, compute_node_uuid):"},{"line_number":503,"context_line":"        \"\"\"Update the resource providers for vGPUs in the provider tree. If the"},{"line_number":504,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"},{"line_number":505,"context_line":"        compute node\u0027s child, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_385348e4","line":502,"range":{"start_line":502,"start_character":4,"end_line":502,"end_character":70},"in_reply_to":"ff82abbf_dfa6c60f","updated":"2017-11-29 07:21:35.000000000","message":"yes.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"1b202c18279429ed9d85e6dbf98604536713e9af","unresolved":false,"context_lines":[{"line_number":514,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":515,"context_line":"                # and jump out of the loop"},{"line_number":516,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":517,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":518,"context_line":"                    updated \u003d True"},{"line_number":519,"context_line":"                continue"},{"line_number":520,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_cc497a31","line":517,"updated":"2017-11-27 06:15:44.000000000","message":"We need an UT covering this logic.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"29951d72a891e4bc6af9fac3a83aeeb4ba1983fe","unresolved":false,"context_lines":[{"line_number":514,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":515,"context_line":"                # and jump out of the loop"},{"line_number":516,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":517,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":518,"context_line":"                    updated \u003d True"},{"line_number":519,"context_line":"                continue"},{"line_number":520,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_972e1a90","line":517,"in_reply_to":"ff82abbf_0c12020a","updated":"2017-11-27 09:49:25.000000000","message":"Ah, yes. You\u0027re right. I thought that case is testing remaning \u003d 0 but it does covered the case for total \u003c\u003d0.\n\nAnother case (which looks more normal than this case which having 0 resources but reported by get_vgpu_stats) for deleting RP is that vGPU was disabled in the PGPU group. Then the group will not show up in the vgpu_stats. But I understand we can\u0027t do that until rp_tree supplies a way to report all children RPs for a specified RP. So I\u0027m fine with this change at the moment.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6ab2b06c578feb9fc4093a44151a6fe194f06d9e","unresolved":false,"context_lines":[{"line_number":514,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":515,"context_line":"                # and jump out of the loop"},{"line_number":516,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":517,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":518,"context_line":"                    updated \u003d True"},{"line_number":519,"context_line":"                continue"},{"line_number":520,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_f7f9a6c7","line":517,"in_reply_to":"ff82abbf_972e1a90","updated":"2017-11-27 09:57:37.000000000","message":"Got it, thanks.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"8122435bc63749781f6c5e793b47120cb5a6fa9e","unresolved":false,"context_lines":[{"line_number":514,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":515,"context_line":"                # and jump out of the loop"},{"line_number":516,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":517,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":518,"context_line":"                    updated \u003d True"},{"line_number":519,"context_line":"                continue"},{"line_number":520,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_0c12020a","line":517,"in_reply_to":"ff82abbf_cc497a31","updated":"2017-11-27 06:19:45.000000000","message":"def test_update_vgpu_rp_no_resource(self):\nTestcase above is for this case.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"29951d72a891e4bc6af9fac3a83aeeb4ba1983fe","unresolved":false,"context_lines":[{"line_number":530,"context_line":"            }"},{"line_number":531,"context_line":"            if not rp_tree.exists(grp_id):"},{"line_number":532,"context_line":"                # Set gpu group uuid as the resource provider uuid. When nova"},{"line_number":533,"context_line":"                # compute request to spawn an instance, it will send it to"},{"line_number":534,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":535,"context_line":"                # corresponding gpu group on the host"},{"line_number":536,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_774ef66f","line":533,"range":{"start_line":533,"start_character":26,"end_line":533,"end_character":33},"updated":"2017-11-27 09:49:25.000000000","message":"requests","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6ab2b06c578feb9fc4093a44151a6fe194f06d9e","unresolved":false,"context_lines":[{"line_number":530,"context_line":"            }"},{"line_number":531,"context_line":"            if not rp_tree.exists(grp_id):"},{"line_number":532,"context_line":"                # Set gpu group uuid as the resource provider uuid. When nova"},{"line_number":533,"context_line":"                # compute request to spawn an instance, it will send it to"},{"line_number":534,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":535,"context_line":"                # corresponding gpu group on the host"},{"line_number":536,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"ff82abbf_17f76ad5","line":533,"range":{"start_line":533,"start_character":26,"end_line":533,"end_character":33},"in_reply_to":"ff82abbf_774ef66f","updated":"2017-11-27 09:57:37.000000000","message":"Will fix it.","commit_id":"9195cc47773db35716912cf048f77d30c660b450"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a16ef10fc0ed239071bdfb92547198dc23fad70f","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                # compute requests to spawn an instance, it will send it to"},{"line_number":550,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":551,"context_line":"                # corresponding gpu group on the host"},{"line_number":552,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"},{"line_number":553,"context_line":"                updated \u003d True"},{"line_number":554,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":555,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_bad05bf9","line":552,"range":{"start_line":552,"start_character":62,"end_line":552,"end_character":68},"updated":"2018-03-26 19:10:55.000000000","message":"name kwargs","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"51592f900ecc54a3643ded42ee5eca5afcd8c088","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                # compute requests to spawn an instance, it will send it to"},{"line_number":550,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":551,"context_line":"                # corresponding gpu group on the host"},{"line_number":552,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"},{"line_number":553,"context_line":"                updated \u003d True"},{"line_number":554,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":555,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_8f2bc92e","line":552,"range":{"start_line":552,"start_character":62,"end_line":552,"end_character":68},"in_reply_to":"bf659307_bad05bf9","updated":"2018-03-27 06:20:02.000000000","message":"Will modify it.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a16ef10fc0ed239071bdfb92547198dc23fad70f","unresolved":false,"context_lines":[{"line_number":551,"context_line":"                # corresponding gpu group on the host"},{"line_number":552,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"},{"line_number":553,"context_line":"                updated \u003d True"},{"line_number":554,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":555,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":556,"context_line":"                                                    \" provider for %s\")"},{"line_number":557,"context_line":"                                                    % rp_name)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_3a068b88","line":554,"range":{"start_line":554,"start_character":16,"end_line":554,"end_character":47},"updated":"2018-03-26 19:10:55.000000000","message":"This should never happen.  If new_child is going to fail, it\u0027ll raise ValueError.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"51592f900ecc54a3643ded42ee5eca5afcd8c088","unresolved":false,"context_lines":[{"line_number":551,"context_line":"                # corresponding gpu group on the host"},{"line_number":552,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"},{"line_number":553,"context_line":"                updated \u003d True"},{"line_number":554,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":555,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":556,"context_line":"                                                    \" provider for %s\")"},{"line_number":557,"context_line":"                                                    % rp_name)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_ef1b6518","line":554,"range":{"start_line":554,"start_character":16,"end_line":554,"end_character":47},"in_reply_to":"bf659307_3a068b88","updated":"2018-03-27 06:20:02.000000000","message":"Will modify it.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a16ef10fc0ed239071bdfb92547198dc23fad70f","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"},{"line_number":553,"context_line":"                updated \u003d True"},{"line_number":554,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":555,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":556,"context_line":"                                                    \" provider for %s\")"},{"line_number":557,"context_line":"                                                    % rp_name)"},{"line_number":558,"context_line":"            # Return true as long as there is one resource provider need to"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_baf93b81","line":555,"range":{"start_line":555,"start_character":36,"end_line":555,"end_character":49},"updated":"2018-03-26 19:10:55.000000000","message":"How about a more specific exception?","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"51592f900ecc54a3643ded42ee5eca5afcd8c088","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                rp_tree.new_child(rp_name, compute_node_uuid, grp_id)"},{"line_number":553,"context_line":"                updated \u003d True"},{"line_number":554,"context_line":"                if not rp_tree.exists(rp_name):"},{"line_number":555,"context_line":"                    raise exception.NovaException(_(\"Failed to create resource\""},{"line_number":556,"context_line":"                                                    \" provider for %s\")"},{"line_number":557,"context_line":"                                                    % rp_name)"},{"line_number":558,"context_line":"            # Return true as long as there is one resource provider need to"}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_cfd6a128","line":555,"range":{"start_line":555,"start_character":36,"end_line":555,"end_character":49},"in_reply_to":"bf659307_baf93b81","updated":"2018-03-27 06:20:02.000000000","message":"Will add a new exception.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a16ef10fc0ed239071bdfb92547198dc23fad70f","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            # Return true as long as there is one resource provider need to"},{"line_number":559,"context_line":"            # update"},{"line_number":560,"context_line":"            updated \u003d rp_tree.update_inventory(rp_name, inv) or updated"},{"line_number":561,"context_line":"        return updated"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":564,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_3a8a0b1b","line":561,"range":{"start_line":561,"start_character":15,"end_line":561,"end_character":22},"updated":"2018-03-26 19:10:55.000000000","message":"fyi we no longer need this (at least from update_provider_tree)","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"51592f900ecc54a3643ded42ee5eca5afcd8c088","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            # Return true as long as there is one resource provider need to"},{"line_number":559,"context_line":"            # update"},{"line_number":560,"context_line":"            updated \u003d rp_tree.update_inventory(rp_name, inv) or updated"},{"line_number":561,"context_line":"        return updated"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":564,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":23,"id":"bf659307_8fe0a9fc","line":561,"range":{"start_line":561,"start_character":15,"end_line":561,"end_character":22},"in_reply_to":"bf659307_3a8a0b1b","updated":"2018-03-27 06:20:02.000000000","message":"Will check it.","commit_id":"8b73a57c57669a12d0999f244c5878e6697c0210"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_e73c90c9","line":535,"range":{"start_line":535,"start_character":33,"end_line":535,"end_character":65},"updated":"2018-03-29 20:57:34.000000000","message":"Are grp_id and grp_value[\u0027uuid\u0027] different??  If so, why?  Regardless, I can\u0027t see why you would need to use both in the RP name (or anywhere, for that matter).  Based on what I see in _get_vgpu_stats_in_group, you can always look up the latter given the former.","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"7e9201436e51368b420b9f6ce4125251fd820ab8","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_0baf4a7d","line":535,"range":{"start_line":535,"start_character":33,"end_line":535,"end_character":65},"in_reply_to":"bf659307_e73c90c9","updated":"2018-03-30 08:14:30.000000000","message":"grp_id is pgpu group uuid, while grp_value[\u0027uuid\u0027] is the vgpu uuid it supported.\nIn truth we only use grp_id currently(Still I need confirm), the other information is just in case of the future use. I will remove it","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_64a2beb0","line":536,"range":{"start_line":535,"start_character":12,"end_line":536,"end_character":52},"updated":"2018-03-29 20:57:34.000000000","message":"TODO: use nova.api.placement.lib.slugify when [1] lands.\n\n[1] https://review.openstack.org/#/c/556628/","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_07118452","line":536,"range":{"start_line":536,"start_character":29,"end_line":536,"end_character":51},"updated":"2018-03-29 20:57:34.000000000","message":"You should be using traits to indicate supported types, not decorating the RP name.\n\n rp_tree.add_traits(rp_name, *[slugify(\u0027CUSTOM_\u0027 + name) for name in grp_value[\u0027type_names\u0027])\n\nNB: the above depends on [1] and assumes you change [2] as suggested.\n\nAlso, technically you should first\n\n rp_tree.remove_traits(rp_name, *all_possible_type_name_traits)\n\n...so you only end up with the types you support.  See [3] for the rationale behind that.\n\nBut regardless, don\u0027t put types in the RP name.\n\n[1] https://review.openstack.org/#/c/553475/\n[2] https://review.openstack.org/#/c/520313/27/nova/virt/xenapi/host.py@308\n[3] https://review.openstack.org/#/c/553476/","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"7e9201436e51368b420b9f6ce4125251fd820ab8","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_abbf3ea8","line":536,"range":{"start_line":535,"start_character":12,"end_line":536,"end_character":52},"in_reply_to":"bf659307_64a2beb0","updated":"2018-03-30 08:14:30.000000000","message":"Will check it","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":540,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_c72f0c86","line":537,"updated":"2018-03-29 20:57:34.000000000","message":"So given the above, I think your RP name should just be VGPU_$grp_id","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"7e9201436e51368b420b9f6ce4125251fd820ab8","unresolved":false,"context_lines":[{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id + \u0027_\u0027 + grp_value[\u0027uuid\u0027] +"},{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":540,"context_line":"                    \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_8bc27a33","line":537,"in_reply_to":"bf659307_c72f0c86","updated":"2018-03-30 08:14:30.000000000","message":"You are right :)","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":540,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":541,"context_line":"                    \u0027max_unit\u0027: 1,"},{"line_number":542,"context_line":"                    \u0027step_size\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_87535417","line":539,"range":{"start_line":539,"start_character":29,"end_line":539,"end_character":56},"updated":"2018-03-29 20:57:34.000000000","message":"grp_value[\u0027total\u0027]","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"7e9201436e51368b420b9f6ce4125251fd820ab8","unresolved":false,"context_lines":[{"line_number":536,"context_line":"                       \u0027_\u0027 + grp_value[\u0027type_name\u0027])"},{"line_number":537,"context_line":"            inv \u003d {"},{"line_number":538,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":539,"context_line":"                    \u0027total\u0027: vgpu_stats[grp_id][\u0027total\u0027],"},{"line_number":540,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":541,"context_line":"                    \u0027max_unit\u0027: 1,"},{"line_number":542,"context_line":"                    \u0027step_size\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_a128bd96","line":539,"range":{"start_line":539,"start_character":29,"end_line":539,"end_character":56},"in_reply_to":"bf659307_87535417","updated":"2018-03-30 08:14:30.000000000","message":"will modify it","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0d7d0622fbc11801abf80150e77ee8dc95766a70","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":28,"id":"bf659307_e7531338","line":535,"updated":"2018-04-01 12:57:37.000000000","message":"Great changes.\n\nYou still need to do the traits stuff.","commit_id":"7b839f8ecf67bfa563e7175dcdd589494410fd27"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"e1ac481f83236ecd9d01a222bc017ea9be7c828b","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":28,"id":"bf659307_933e16bf","line":535,"in_reply_to":"bf659307_e7531338","updated":"2018-04-02 01:19:39.000000000","message":"Hi, Eric. According to our plan, jianghua will add traits stuff base on this patch.","commit_id":"7b839f8ecf67bfa563e7175dcdd589494410fd27"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d6ff3af0f38c76afdd8dbd4c0a557064ef2b9260","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_6872d6af","line":535,"range":{"start_line":535,"start_character":23,"end_line":535,"end_character":30},"updated":"2018-04-09 18:47:15.000000000","message":"It\u0027s not the VGPU that is the resource provider, though. It\u0027s the PGPU or PGPU group. So I would prefix with just \"GPU_\" or maybe \"GPU_GROUP_\"","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"2a435def3b937d464f512b47b69e9599b14ff736","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_a6e6d315","line":535,"range":{"start_line":535,"start_character":23,"end_line":535,"end_character":30},"in_reply_to":"bf659307_6872d6af","updated":"2018-04-10 07:04:20.000000000","message":"Agreed with Jay.\n\nAlso I\u0027d suggest avoid using the hard-coded string. I see you defined const variable at here: https://review.openstack.org/#/c/521041/16/nova/virt/xenapi/driver.py@56","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"69a574625245613485cfb75e2a00b773d8599c99","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_0638df3a","line":535,"range":{"start_line":535,"start_character":23,"end_line":535,"end_character":30},"in_reply_to":"bf659307_6872d6af","updated":"2018-04-10 07:05:42.000000000","message":"Got it, will use \"GPU_\" as the prefix.","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"20e10490f0b7099a4f595fd818f7db85c2c526ac","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_e6828bc8","line":535,"range":{"start_line":535,"start_character":23,"end_line":535,"end_character":30},"in_reply_to":"bf659307_a6e6d315","updated":"2018-04-10 07:10:05.000000000","message":"Yes, it defined in the next patch~~\nWill change to \"GPU_\" anyway~. Thanks, Jianghua.","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f70f0bea129f3734fd9b2fc9b2a16fa88747da89","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_329bd9c9","line":535,"range":{"start_line":535,"start_character":23,"end_line":535,"end_character":30},"in_reply_to":"bf659307_bc3b42c6","updated":"2018-04-10 09:12:11.000000000","message":"Will move to this patch","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"675a439a439c8c281ce766bb13860282ec87d0f9","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":533,"context_line":"                continue"},{"line_number":534,"context_line":""},{"line_number":535,"context_line":"            rp_name \u003d (\u0027VGPU_\u0027 + grp_id)"},{"line_number":536,"context_line":"            inv \u003d {"},{"line_number":537,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":538,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bf659307_bc3b42c6","line":535,"range":{"start_line":535,"start_character":23,"end_line":535,"end_character":30},"in_reply_to":"bf659307_e6828bc8","updated":"2018-04-10 07:59:23.000000000","message":"why not define it in this patch instead?","commit_id":"0beb5ed0bbe72a7dc755118bb6a11c7c047c0687"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"151caf47f1711e1cbd978b71e9e32f0519d1c2ba","unresolved":false,"context_lines":[{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":530,"context_line":"            # to show supported vgpus as well."},{"line_number":531,"context_line":"            if vgpu_stats[grp_id][\u0027total\u0027] \u003c\u003d 0:"},{"line_number":532,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":533,"context_line":"                # and jump out of the loop"},{"line_number":534,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":535,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":536,"context_line":"                continue"},{"line_number":537,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":538,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":34,"id":"bf659307_cc7db3e7","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":42},"updated":"2018-04-13 18:58:33.000000000","message":"If there were allocations against this resource provider previously, the removal of the resource provider from the tree will succeed here but fail when the reportclient attempts to take actions based on the \"diff\" of the provider tree.\n\nDoes the \u0027total\u0027 field in the vgpu_stats[grp_id] dict contain the actual total amount of inventory? Or does \u0027total\u0027 indicates the amount *remaining* that can be consumed by a guest?","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"665e8d5d923f88a7cfc6a3ee77187b6e4cfe4ca1","unresolved":false,"context_lines":[{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":530,"context_line":"            # to show supported vgpus as well."},{"line_number":531,"context_line":"            if vgpu_stats[grp_id][\u0027total\u0027] \u003c\u003d 0:"},{"line_number":532,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":533,"context_line":"                # and jump out of the loop"},{"line_number":534,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":535,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":536,"context_line":"                continue"},{"line_number":537,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":538,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_074d8271","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":42},"in_reply_to":"bf659307_cc7db3e7","updated":"2018-04-17 05:54:22.000000000","message":"Hi, Jay, `total` show the actual total amount of the inventory.\nCan\u0027t find the `diff` action in provider_tree class, do you mean we could delete rps only when they are used(means we are the owner?)?","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"c99a39995fcdee6bb9a5b467a4deeff185bee87c","unresolved":false,"context_lines":[{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":530,"context_line":"            # to show supported vgpus as well."},{"line_number":531,"context_line":"            if vgpu_stats[grp_id][\u0027total\u0027] \u003c\u003d 0:"},{"line_number":532,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":533,"context_line":"                # and jump out of the loop"},{"line_number":534,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":535,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":536,"context_line":"                continue"},{"line_number":537,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":538,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_21c16d2f","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":42},"in_reply_to":"bf659307_cc7db3e7","updated":"2018-04-18 09:25:38.000000000","message":"Hi, Jay, will remove those codes. It should fix the bad case you mentioned, and not affect resource using.","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"74d24c36c25e46914a99cc58cae20e1df547da87","unresolved":false,"context_lines":[{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":530,"context_line":"            # to show supported vgpus as well."},{"line_number":531,"context_line":"            if vgpu_stats[grp_id][\u0027total\u0027] \u003c\u003d 0:"},{"line_number":532,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":533,"context_line":"                # and jump out of the loop"},{"line_number":534,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":535,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":536,"context_line":"                continue"},{"line_number":537,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":538,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_883bdfcf","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":42},"in_reply_to":"bf659307_cc7db3e7","updated":"2018-04-17 05:21:42.000000000","message":"It\u0027s actually amount of inventory include the consumed. This case only exists when the enabled vGPU types are changed in the nova configuration. I think we should allow the update keeping failure until the existing allocation get released, if there are vGPUs already allocated before the configuration changed.","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"485a7fbe9da5e80723db7d8b484067e73a161011","unresolved":false,"context_lines":[{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":530,"context_line":"            # to show supported vgpus as well."},{"line_number":531,"context_line":"            if vgpu_stats[grp_id][\u0027total\u0027] \u003c\u003d 0:"},{"line_number":532,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":533,"context_line":"                # and jump out of the loop"},{"line_number":534,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":535,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":536,"context_line":"                continue"},{"line_number":537,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":538,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":34,"id":"9f6a8fd7_32f0fd90","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":42},"in_reply_to":"bf659307_cc7db3e7","updated":"2018-04-17 08:27:01.000000000","message":"Looks not make sense :[\nWill discuss it with you on IRC, Jay.","commit_id":"cb81810a2ef228a5e3a10faf3b496cc38a589f9e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"293d897cc77dcee873979ef7d4021fc333a93080","unresolved":false,"context_lines":[{"line_number":531,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":532,"context_line":"                # and jump out of the loop"},{"line_number":533,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":534,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":535,"context_line":"                continue"},{"line_number":536,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":537,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f6a8fd7_ad72077a","line":534,"updated":"2018-04-20 16:22:41.000000000","message":"Only do this if the GPU has been physically removed from the hardware (in other words, the grp_id wouldn\u0027t even show up in the vgpu_stats dict keys).\n\nFor a GPU that is reporting a total of 0 VGPUs, if that is the case because of some administratively-downed device, then you will want to set the reserved count of the VGPU inventory item equal to the total count of the inventory item. This will indicate that there is inventory of VGPU, but none that is available for guests.","commit_id":"4eaa7b2f612b1ee10f5fac8572ace8757e378913"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"60f0cecbbeb8660de54c588843ffebfc2427fd89","unresolved":false,"context_lines":[{"line_number":531,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":532,"context_line":"                # and jump out of the loop"},{"line_number":533,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":534,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":535,"context_line":"                continue"},{"line_number":536,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":537,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f6a8fd7_0ed3b6d6","line":534,"in_reply_to":"9f6a8fd7_ad72077a","updated":"2018-04-25 09:05:12.000000000","message":"\u003e Only do this if the GPU has been physically removed from the\n \u003e hardware (in other words, the grp_id wouldn\u0027t even show up in the\n \u003e vgpu_stats dict keys).\n \u003e \n \u003e For a GPU that is reporting a total of 0 VGPUs, if that is the case\n \u003e because of some administratively-downed device, then you will want\n \u003e to set the reserved count of the VGPU inventory item equal to the\n \u003e total count of the inventory item. This will indicate that there is\n \u003e inventory of VGPU, but none that is available for guests.","commit_id":"4eaa7b2f612b1ee10f5fac8572ace8757e378913"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6eb62d30227ca2975b15c93168a867ad88e2a08b","unresolved":false,"context_lines":[{"line_number":531,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":532,"context_line":"                # and jump out of the loop"},{"line_number":533,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":534,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":535,"context_line":"                continue"},{"line_number":536,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":537,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f6a8fd7_4a281f85","line":534,"in_reply_to":"9f6a8fd7_ad72077a","updated":"2018-05-02 08:26:25.000000000","message":"Done","commit_id":"4eaa7b2f612b1ee10f5fac8572ace8757e378913"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"bb50d2a86ec05f53a04f144dec331ea303baa8b3","unresolved":false,"context_lines":[{"line_number":531,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":532,"context_line":"                # and jump out of the loop"},{"line_number":533,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":534,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":535,"context_line":"                continue"},{"line_number":536,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":537,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f6a8fd7_8e44a648","line":534,"in_reply_to":"9f6a8fd7_ad72077a","updated":"2018-04-24 09:48:46.000000000","message":"Jay, it\u0027s my mistake. In truth, there is no evidence shows GPUs would return a total of 0 vGPUs. Will change to check the inventory and traits status. If they are changed, the configuration might be changed, then reserve all the resource to avoid scheduling.","commit_id":"4eaa7b2f612b1ee10f5fac8572ace8757e378913"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0790e3dfd6c92f5dd5a9629facb060d0105cb267","unresolved":false,"context_lines":[{"line_number":531,"context_line":"                # If the gpu group has no resource, remove the rp if it exists"},{"line_number":532,"context_line":"                # and jump out of the loop"},{"line_number":533,"context_line":"                if rp_tree.exists(grp_id):"},{"line_number":534,"context_line":"                    rp_tree.remove(grp_id)"},{"line_number":535,"context_line":"                continue"},{"line_number":536,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":537,"context_line":"            inv \u003d {"}],"source_content_type":"text/x-python","patch_set":36,"id":"9f6a8fd7_9b70660a","line":534,"in_reply_to":"9f6a8fd7_ad72077a","updated":"2018-04-24 09:29:56.000000000","message":"Will modify it. thanks, Jay","commit_id":"4eaa7b2f612b1ee10f5fac8572ace8757e378913"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a5548cafd4400222b9ea537a73ba38287a225bed","unresolved":false,"context_lines":[{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":529,"context_line":"            # to show supported vgpus as well."},{"line_number":530,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":531,"context_line":"            inv \u003d {"},{"line_number":532,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_9115904b","line":529,"range":{"start_line":528,"start_character":60,"end_line":529,"end_character":46},"updated":"2018-04-25 08:27:35.000000000","message":"delete as it\u0027s included in the RP name anymore?","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6eb62d30227ca2975b15c93168a867ad88e2a08b","unresolved":false,"context_lines":[{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":529,"context_line":"            # to show supported vgpus as well."},{"line_number":530,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":531,"context_line":"            inv \u003d {"},{"line_number":532,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_6a2ba381","line":529,"range":{"start_line":528,"start_character":60,"end_line":529,"end_character":46},"in_reply_to":"9f6a8fd7_9115904b","updated":"2018-05-02 08:26:25.000000000","message":"Done","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"60f0cecbbeb8660de54c588843ffebfc2427fd89","unresolved":false,"context_lines":[{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers. Add vgpu type info"},{"line_number":529,"context_line":"            # to show supported vgpus as well."},{"line_number":530,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":531,"context_line":"            inv \u003d {"},{"line_number":532,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_d47e96e2","line":529,"range":{"start_line":528,"start_character":60,"end_line":529,"end_character":46},"in_reply_to":"9f6a8fd7_9115904b","updated":"2018-04-25 09:05:12.000000000","message":"will remove it","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a5548cafd4400222b9ea537a73ba38287a225bed","unresolved":false,"context_lines":[{"line_number":542,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":543,"context_line":"                # corresponding gpu group on the host"},{"line_number":544,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":545,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":546,"context_line":"                # If the inventory or traits are changed, it means the vGPU"},{"line_number":547,"context_line":"                # configuration might be changed. Set the reserved count of"},{"line_number":548,"context_line":"                # the VGPU inventory item equal to the total count of the"}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_74a30a01","line":545,"range":{"start_line":545,"start_character":25,"end_line":545,"end_character":46},"updated":"2018-04-25 08:27:35.000000000","message":"should check traits also? it doesn\u0027t depend on if the traits of vGPU has been exposed or not.","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6eb62d30227ca2975b15c93168a867ad88e2a08b","unresolved":false,"context_lines":[{"line_number":542,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":543,"context_line":"                # corresponding gpu group on the host"},{"line_number":544,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":545,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":546,"context_line":"                # If the inventory or traits are changed, it means the vGPU"},{"line_number":547,"context_line":"                # configuration might be changed. Set the reserved count of"},{"line_number":548,"context_line":"                # the VGPU inventory item equal to the total count of the"}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_0a2227a5","line":545,"range":{"start_line":545,"start_character":25,"end_line":545,"end_character":46},"in_reply_to":"9f6a8fd7_74a30a01","updated":"2018-05-02 08:26:25.000000000","message":"Done","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"60f0cecbbeb8660de54c588843ffebfc2427fd89","unresolved":false,"context_lines":[{"line_number":542,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":543,"context_line":"                # corresponding gpu group on the host"},{"line_number":544,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":545,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":546,"context_line":"                # If the inventory or traits are changed, it means the vGPU"},{"line_number":547,"context_line":"                # configuration might be changed. Set the reserved count of"},{"line_number":548,"context_line":"                # the VGPU inventory item equal to the total count of the"}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_7f20c39b","line":545,"range":{"start_line":545,"start_character":25,"end_line":545,"end_character":46},"in_reply_to":"9f6a8fd7_74a30a01","updated":"2018-04-25 09:05:12.000000000","message":"yes, but we can\u0027t do it now, need traits instances to do compare. Already add a \u0027TODO\u0027 comments in line550.","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"a5548cafd4400222b9ea537a73ba38287a225bed","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                # inventory item to avoid scheduling."},{"line_number":550,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":551,"context_line":"                # applied"},{"line_number":552,"context_line":"                inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value[\u0027total\u0027]"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":555,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_54da8677","line":552,"updated":"2018-04-25 08:27:35.000000000","message":"We shouldn\u0027t change this if there is no vGPU created in this group. And we need a way to reset this value. otherwise this GPU will always be out of service. right?","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6eb62d30227ca2975b15c93168a867ad88e2a08b","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                # inventory item to avoid scheduling."},{"line_number":550,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":551,"context_line":"                # applied"},{"line_number":552,"context_line":"                inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value[\u0027total\u0027]"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":555,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_2a25abab","line":552,"in_reply_to":"9f6a8fd7_54da8677","updated":"2018-05-02 08:26:25.000000000","message":"Done","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"60f0cecbbeb8660de54c588843ffebfc2427fd89","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                # inventory item to avoid scheduling."},{"line_number":550,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":551,"context_line":"                # applied"},{"line_number":552,"context_line":"                inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value[\u0027total\u0027]"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":555,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"9f6a8fd7_7f5523f9","line":552,"in_reply_to":"9f6a8fd7_54da8677","updated":"2018-04-25 09:05:12.000000000","message":"Will check it. thanks","commit_id":"e94402e3c2e4f698579417564d2a8a12a70e9bb9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a08be64427835136c01815039167118195e39bd8","unresolved":false,"context_lines":[{"line_number":52,"context_line":"OVERHEAD_PER_MB \u003d 0.00781"},{"line_number":53,"context_line":"OVERHEAD_PER_VCPU \u003d 1.5"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"GPU_RP_PREFIX \u003d \"GPU_\""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def invalid_option(option_name, recommended_value):"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_99d2edff","line":55,"range":{"start_line":55,"start_character":0,"end_line":55,"end_character":13},"updated":"2018-05-10 20:13:14.000000000","message":"Are you going to use this somewhere else later?  Hardly seems worth a whole const for just one use.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0c8ae8e9c0977da90561d000384de617376701e8","unresolved":false,"context_lines":[{"line_number":52,"context_line":"OVERHEAD_PER_MB \u003d 0.00781"},{"line_number":53,"context_line":"OVERHEAD_PER_VCPU \u003d 1.5"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"GPU_RP_PREFIX \u003d \"GPU_\""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def invalid_option(option_name, recommended_value):"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_8d614308","line":55,"range":{"start_line":55,"start_character":0,"end_line":55,"end_character":13},"in_reply_to":"5f7c97a3_99d2edff","updated":"2018-05-11 07:48:27.000000000","message":"Hi, Eric, as a prefix of GPU resource provider, it will be used in both rp creating and VM creating process (parser gpug uuids from rp names). Also we need it to filter out all the GPU rps from a rp set.\nAlthough we only used it once in this patch, it should be defined as a whole const to avoid mismatch in the future patches.\nBut looks moving it to a common utility is a more reasonable choice.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a08be64427835136c01815039167118195e39bd8","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_396ab9ed","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"updated":"2018-05-10 20:13:14.000000000","message":"Is it possible for the list of devices to change, ever?  I assume so, if devices are plugged/unplugged.\n\nSo you also need to go through and delete any GPU-related RPs that have disappeared since the last time you looked.  You don\u0027t want to have to persist the names/IDs of those RPs locally (especially across compute service restarts), but I think you can take advantage of your naming convention and look for any provider named GPU_*.  If its UUID isn\u0027t in your list of grp_id, delete it.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6c94af5779033c4b32c57c66c77a513fe273223","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_4c432314","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_084f616b","updated":"2018-05-11 14:03:01.000000000","message":"Okay, but we\u0027re not just talking about \"hot\" [un]plug.  If I bring down the whole host, swap devices in and out, and bring it back up, the driver still needs to be able to make the placement picture match what the host now has on it.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8cfefec5f5297dbed5b65a01f913d018482edc56","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_a5e15cd2","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_0a1ab915","updated":"2018-06-01 18:20:51.000000000","message":"We\u0027re talking about two different cases here.\n\nIf a GPU is still on the system, but can\u0027t be used, that\u0027s when you need to set reserved \u003d total.\n\nIf a GPU has been completely *removed* from the system, you need a way to remove the corresponding provider entirely.\n\nIn the latter case, I hope the admin made sure there were no instances using that GPU before removing it.  Otherwise we will indeed have the allocation problem Jay mentions.\n\n@Jay - perhaps we should check for allocations whenever deleting a provider in update_from_provider_tree.  (What do we do if we find some?  Delete the allocs?  Refuse to delete the provider?  Blow up the compute service?)","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0c8ae8e9c0977da90561d000384de617376701e8","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_084f616b","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_396ab9ed","updated":"2018-05-11 07:48:27.000000000","message":"We discussed it with Jay before. We don\u0027t support gpu hot plugged/unplugged. But we support rp changes caused by configure changes.\nFor example, if we modified nova.conf to change to support another vgpu type, then the inventories(or traits) should be changed. If there are no vgpu allocated on this gpug, we will happily update the new inventory to the rp. But if we have an allocation(with the old vgpu type) on this rp, we will reserve all the resource to avoid further scheduler(just like line 554 does), because we don\u0027t support multiple vgpu types on one gpu group.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b6e5152edb8d623902526011efae03b46ff238ff","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_a81cb677","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_49df313a","updated":"2018-06-04 13:44:46.000000000","message":"\u003e For invalid case, every exception from placement is OK. Like\n \u003e hardware error, customers disabled/deleted compute node while there\n \u003e are still allocations on. We don\u0027t need to modify anything about\n \u003e this case because we are not designed to deal with invalid cases,\n \u003e customers need to manage those cases by themselves.\n\nProblem is, as currently written, update_from_provider_tree will fail if it tries to delete a provider with allocations.  Now, I *think* because of the way the best-effort algorithm is written, it will actually make all the rest of the changes, which *might* work out okay in the end.  But if it does actually break the compute service, I\u0027m not sure what the admin would be able to do to correct it.  Will they be able to delete the instances holding those allocations?  How will they find out which instances they need to delete?  Can they manually delete allocations via the command line?  Would we want them to?\n\n \u003e For valid case, like customers disabled/deleted compute nodes which\n \u003e are free. in this case, we need to check and delete the related\n \u003e rps. But if there is no allocated in the rp, the delete would be\n \u003e allowed by placement. So placement don\u0027t need to modify anything?\n \u003e Any suggestion?\n\nPlacement *does* need to modify something - it needs to delete the provider in question.  But it doesn\u0027t know it needs to do that unless you remove that provider from the provider_tree here.  That\u0027s the part of the code I\u0027ve been saying is missing.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"781b5580c88a712c12e032e50fc45b2cc9ee094c","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_ad7b68f2","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_49df313a","updated":"2018-06-04 12:42:16.000000000","message":"@jaypipes, Jay, what\u0027s your opinion?","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0aac0e046245bdabf71f28d3d42304ad7f3b0c77","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_0a1ab915","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_4c432314","updated":"2018-05-15 05:44:30.000000000","message":"Hi, Eric. According to Jay\u0027s suggestion on patch34:\n\"I\u0027m concerned that the xenapi virt driver may try to remove resource providers from the placement service when the GPU is in some temporary down/maintenance state. We need to make sure that the xenapi virt driver does *not* do this; the reason is because if anything has been allocated to those resource providers, the DELETE /resource_providers/{uuid} is going to fail due to allocations being outstanding on the resource provider.\n\nSo, my concern was raised here in this test because it *seems* like you are emulating here a scenario where xenapi sees a previously-existing GPU as being in a down/unavailable state and attempts to automatically remove the provider from placement. And that would be bad :)\"\n\nThat\u0027s why we prefer reserving to deleting.\nPlease check it and give us your suggestion, thanks.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a04c9d981d12a1d31e2848bfe286ee451bf650be","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_71251d5c","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_803e6589","updated":"2018-06-05 06:42:14.000000000","message":"Ah, Sorry, about the first question, we can\u0027t manage the exception in the driver code. It should be very difficult to manage that exception...","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"812f5972851c6cefaee895deb492d0d67d01f5a1","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_49df313a","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_a5e15cd2","updated":"2018-06-04 02:56:36.000000000","message":"Hi, Eric. I think we can roughly divide the cases into two classes about gpu missing caused rp delete: invalid and valid.\nFor invalid case, every exception from placement is OK. Like hardware error, customers disabled/deleted compute node while there are still allocations on. We don\u0027t need to modify anything about this case because we are not designed to deal with invalid cases, customers need to manage those cases by themselves.\nFor valid case, like customers disabled/deleted compute nodes which are free. in this case, we need to check and delete the related rps. But if there is no allocated in the rp, the delete would be allowed by placement. So placement don\u0027t need to modify anything?\nAny suggestion?","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"4c3ee57a986e8dd0f012228e22d35eac7cc2d4a1","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_803e6589","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_a81cb677","updated":"2018-06-05 02:47:17.000000000","message":"\u003e \u003e For invalid case, every exception from placement is OK. Like\n \u003e \u003e hardware error, customers disabled/deleted compute node while\n \u003e there\n \u003e \u003e are still allocations on. We don\u0027t need to modify anything about\n \u003e \u003e this case because we are not designed to deal with invalid cases,\n \u003e \u003e customers need to manage those cases by themselves.\n \u003e \n \u003e Problem is, as currently written, update_from_provider_tree will\n \u003e fail if it tries to delete a provider with allocations.  Now, I\n \u003e *think* because of the way the best-effort algorithm is written, it\n \u003e will actually make all the rest of the changes, which *might* work\n \u003e out okay in the end.  But if it does actually break the compute\n \u003e service, I\u0027m not sure what the admin would be able to do to correct\n \u003e it.  Will they be able to delete the instances holding those\n \u003e allocations?  How will they find out which instances they need to\n \u003e delete?  Can they manually delete allocations via the command line?\n \u003e  Would we want them to?\nOnly my opinion: That\u0027s related to the responsibility definition of the OpenStack function and operator. \nIf the rp is missing, the VM may still can be used and our customer may have something usable on it. Manage VM is not our duty.\nAnd we can give some error logs(placement throw out exceptions and driver consume it) with host uuid and missing rp information, which could help customers to locate the host with the problem. We don\u0027t throw out exceptions so it would not block openstack services.\nError logs or exceptions, that depends on the severity of the rp missing. For vGPU, I think error logs are enough(It should be exceptions for compute rps, I think~). So it is very flexible to manage.\n\nCustomers could just omit the errors, or disable the node to check further. \n\n \u003e \n \u003e \u003e For valid case, like customers disabled/deleted compute nodes\n \u003e which\n \u003e \u003e are free. in this case, we need to check and delete the related\n \u003e \u003e rps. But if there is no allocated in the rp, the delete would be\n \u003e \u003e allowed by placement. So placement don\u0027t need to modify anything?\n \u003e \u003e Any suggestion?\n \u003e \n \u003e Placement *does* need to modify something - it needs to delete the\n \u003e provider in question.  But it doesn\u0027t know it needs to do that\n \u003e unless you remove that provider from the provider_tree here. \n \u003e That\u0027s the part of the code I\u0027ve been saying is missing.\n\nI\u0027m not clear about that. Do you mean placement still have not code to delete rps even they have no allocation on?\nThen it should add the code to do it:)","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"03ee49e557f5ed934df28034b4741763a8ad0952","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":527,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":528,"context_line":"            # distinguish corresponding resource providers."},{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_71b51d7e","line":526,"range":{"start_line":526,"start_character":33,"end_line":526,"end_character":51},"in_reply_to":"5f7c97a3_a81cb677","updated":"2018-06-05 07:15:45.000000000","message":"Placement is a high abstract component, items in placement can\u0027t reflect hardware directly. How about we log all the staled rps and related host information in driver code, and \nwhen resource tracker want to update rp tree to placement, placement doesn\u0027t throw exception, log errors as well?\nIf the staled rps is very important, the driver also can throw an exception.\nLet driver decide the severity of the staled rps and react to it.\n@efried, @jaypipes, Any suggestion?","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a08be64427835136c01815039167118195e39bd8","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":530,"context_line":"            inv \u003d {"},{"line_number":531,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":532,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"},{"line_number":533,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":534,"context_line":"                    \u0027max_unit\u0027: 1,"},{"line_number":535,"context_line":"                    \u0027step_size\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_f9a1a147","line":532,"range":{"start_line":532,"start_character":29,"end_line":532,"end_character":47},"updated":"2018-05-10 20:13:14.000000000","message":"Can this ever be zero?  If so, you\u0027ll have to have a special case to account for it, because the schema [1] won\u0027t let you send it.  So if you find one of those and it already exists in rp_tree, you should delete it (or possibly set reserved \u003d total, though that doesn\u0027t quite reflect the data you have - Jay, thoughts?); and if it doesn\u0027t exist in rp_tree, you can simply ignore it.\n\n[1] https://github.com/openstack/nova/blob/master/nova/api/openstack/placement/schemas/inventory.py#L29","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0c8ae8e9c0977da90561d000384de617376701e8","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":530,"context_line":"            inv \u003d {"},{"line_number":531,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":532,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"},{"line_number":533,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":534,"context_line":"                    \u0027max_unit\u0027: 1,"},{"line_number":535,"context_line":"                    \u0027step_size\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_0878c18d","line":532,"range":{"start_line":532,"start_character":29,"end_line":532,"end_character":47},"in_reply_to":"5f7c97a3_f9a1a147","updated":"2018-05-11 07:48:27.000000000","message":"It should not, a healthy gpug should have at least one resource. \nOnce I want to set it to zero to avoid scheduler in some cases, Jay suggested set all reserved.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a08be64427835136c01815039167118195e39bd8","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":548,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":549,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_f95e8174","line":550,"range":{"start_line":550,"start_character":33,"end_line":550,"end_character":37},"updated":"2018-05-10 20:13:14.000000000","message":"group","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a08be64427835136c01815039167118195e39bd8","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_b9d9e9f3","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"updated":"2018-05-10 20:13:14.000000000","message":"Sorry, I don\u0027t understand this condition.  It appears as though this will make it possible to allocate only one vGPU from this group.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"7f3c640949de6b8a7daedf1c0cf7f6d93a7ed16b","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_9e6a6a7e","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_25f6ac90","updated":"2018-06-02 01:56:20.000000000","message":"Hi, Eric, this change is to deal with inventory changes like use changed the nova conf to support a different vgpu type. we will compare `tatol` and `remain` to confirm if there are vgpus of old type in use. If so, we will set `reserved` equal to `total` to prevent new allocation because we don\u0027t support multiple vgpu types in a same gpu group.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6c94af5779033c4b32c57c66c77a513fe273223","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_8cc29b58","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_4861d9d2","updated":"2018-05-11 14:03:01.000000000","message":"Then I must not be understanding what this \u0027remaining\u0027 field means.  I thought it was how the device reports how many vGPUs are unallocated to instances.  In other words, \u0027total\u0027 - \u0027remaining\u0027 would be the number of vGPUs that *are* allocated to instances.\n\nIf that\u0027s wrong, can you please describe to me what \u0027remaining\u0027 actually indicates?  Because perhaps there\u0027s a better word we could use for this field to avoid future confusion.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1245c69bda78d9ffd34eb843902c9bfe91e30bca","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_ccc90126","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_68d3fed6","updated":"2018-06-04 16:47:15.000000000","message":"Okay, discussed this on IRC with naichuans and bauzas [1].  I think I get why this is doing what it\u0027s doing: at this point, we\u0027re only looking at a single VGPU type anyway, so this has nothing to do with changing types per se (see below).  What we\u0027re doing is comparing the *inventory* (L544) to what we expect it to be (L532) to find out whether someone has changed the configuration of *this group*.  If they have, *and* there were any existing allocations (L553), disable the group by setting reserved \u003d total (below).\n\nThe case I had been confusing this with was when the user tries to change the VGPU type - which they would do by altering CONF.devices.enabled_vgpu_types and restarting the compute service.  Per bauzas [2] we\u0027re not going to handle that case other than docs - it\u0027s up to the admin.\n\nNow, this still leaves the issue I mention above: in the case where the VGPU type is legitimately changed (legitimately \u003d\u003d no allocations), OR if a GPU is removed from the system (\"cold\" unplug, given hot plugging is not supported), the stale RP needs to be deleted from placement.\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2018-06-04.log.html#t2018-06-04T14:27:01\n[2] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2018-06-04.log.html#t2018-06-04T15:14:14","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8cfefec5f5297dbed5b65a01f913d018482edc56","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_25f6ac90","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_8aca499e","updated":"2018-06-01 18:20:51.000000000","message":"Okay, so I\u0027m still not understanding why you\u0027re doing this.  To me, this logic reads as follows:\n\n\"If there are any vGPUs assigned out of this group, disable the group and prevent any further vGPUs from being created on it.\"\n\nWhich doesn\u0027t make sense to me.  Because it means you can only ever use one vGPU from a given group.  After you do that, remaining \u003d\u003d total - 1 and this code will disable the group.\n\nWhat am I missing??","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0aac0e046245bdabf71f28d3d42304ad7f3b0c77","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_8aca499e","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_8cc29b58","updated":"2018-05-15 05:44:30.000000000","message":"You are right. But `remaining` field is not included in inventory. We get it from the hypervisor. \nWe check it here just want to confirm if there is a vGPU allocated on the gpug.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b6e5152edb8d623902526011efae03b46ff238ff","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_68d3fed6","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_9e6a6a7e","updated":"2018-06-04 13:44:46.000000000","message":"Please help me understand which part of this algorithm is detecting that we\u0027re looking at an \"old\" vgpu type.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"0c8ae8e9c0977da90561d000384de617376701e8","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_4861d9d2","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_b9d9e9f3","updated":"2018-05-11 07:48:27.000000000","message":"this is for nova configure changed case(comments on line526). inventories and traits are not changed when you just allocate some resources, it will not fail into this branch.","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"4c3ee57a986e8dd0f012228e22d35eac7cc2d4a1","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # types in a GPU grup."},{"line_number":551,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":552,"context_line":"                # applied"},{"line_number":553,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":554,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":555,"context_line":"                        \u0027total\u0027]"},{"line_number":556,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"5f7c97a3_60f309e9","line":553,"range":{"start_line":553,"start_character":16,"end_line":553,"end_character":64},"in_reply_to":"5f7c97a3_ccc90126","updated":"2018-06-05 02:47:17.000000000","message":"I will add the code. I plan to put the invalid and the valid process together. I will directly delete in the valid case, for the invalid case, I will consume exception from placement and give some error logs.\nAny suggestion?","commit_id":"94f63fb487415a7735b10524d35f62fc30c5e6cf"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"154a071254fcf46052533033c7ed6428f9e20542","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        updated_rps \u003d []"},{"line_number":527,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers."}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_9c10e402","line":526,"range":{"start_line":526,"start_character":8,"end_line":526,"end_character":24},"updated":"2018-06-06 16:00:26.000000000","message":"nit: make this a set() for better performance on L565.","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fbf45a4c781b8eea025c865277b93085dd6bcbcb","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        compute node\u0027s child, then attach the inventory to it."},{"line_number":524,"context_line":"        \"\"\""},{"line_number":525,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":526,"context_line":"        updated_rps \u003d []"},{"line_number":527,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers."}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_3a47477a","line":526,"range":{"start_line":526,"start_character":8,"end_line":526,"end_character":24},"in_reply_to":"5f7c97a3_9c10e402","updated":"2018-06-07 01:09:04.000000000","message":"Good catch, thanks, Eric.","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"154a071254fcf46052533033c7ed6428f9e20542","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":548,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":549,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":550,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":551,"context_line":"                # types in a GPU group."},{"line_number":552,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":553,"context_line":"                # applied"},{"line_number":554,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_3cc43092","line":551,"range":{"start_line":550,"start_character":48,"end_line":551,"end_character":23},"updated":"2018-06-06 16:00:26.000000000","message":"I think this is the part of the comment that\u0027s been confusing me from the start.  Perhaps \"don\u0027t support multiple *configurations* at once\" would be clearer?","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fbf45a4c781b8eea025c865277b93085dd6bcbcb","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":548,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":549,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":550,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":551,"context_line":"                # types in a GPU group."},{"line_number":552,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":553,"context_line":"                # applied"},{"line_number":554,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_ba7917c6","line":551,"range":{"start_line":550,"start_character":48,"end_line":551,"end_character":23},"in_reply_to":"5f7c97a3_3cc43092","updated":"2018-06-07 01:09:04.000000000","message":"It\u0027s based on one gpu group, physically don\u0027t support. We want to descript it to our developers. If we change to configurations, its customer looks changed to operators?","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"154a071254fcf46052533033c7ed6428f9e20542","unresolved":false,"context_lines":[{"line_number":556,"context_line":"                        \u0027total\u0027]"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":559,"context_line":"            updated_rps \u003d updated_rps + [rp_name]"},{"line_number":560,"context_line":"        children_rps \u003d rp_tree.get_provider_uuids(root_name_or_uuid)"},{"line_number":561,"context_line":"        # Looking for gpu rps which don\u0027t exist anymore"},{"line_number":562,"context_line":"        for rp in children_rps:"}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_5cf24ce5","line":559,"range":{"start_line":559,"start_character":12,"end_line":559,"end_character":49},"updated":"2018-06-06 16:00:26.000000000","message":"or\n\n updated_rps.append(rp_name)\n\nbut if you\u0027re going to make it a set, as suggested above, it would be\n\n updated_rps.add(rp_name)","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fbf45a4c781b8eea025c865277b93085dd6bcbcb","unresolved":false,"context_lines":[{"line_number":556,"context_line":"                        \u0027total\u0027]"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":559,"context_line":"            updated_rps \u003d updated_rps + [rp_name]"},{"line_number":560,"context_line":"        children_rps \u003d rp_tree.get_provider_uuids(root_name_or_uuid)"},{"line_number":561,"context_line":"        # Looking for gpu rps which don\u0027t exist anymore"},{"line_number":562,"context_line":"        for rp in children_rps:"}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_1ab60b8c","line":559,"range":{"start_line":559,"start_character":12,"end_line":559,"end_character":49},"in_reply_to":"5f7c97a3_5cf24ce5","updated":"2018-06-07 01:09:04.000000000","message":"thank you for reminder","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"154a071254fcf46052533033c7ed6428f9e20542","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            rp_data \u003d rp_tree.data(rp)"},{"line_number":564,"context_line":"            if (rp_data.name[:len(GPU_RP_PREFIX)] \u003d\u003d GPU_RP_PREFIX and"},{"line_number":565,"context_line":"                    rp_data.name not in updated_rps):"},{"line_number":566,"context_line":"                rp_data.inventory[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d \\"},{"line_number":567,"context_line":"                    rp_data.inventory[fields.ResourceClass.VGPU][\u0027total\u0027]"},{"line_number":568,"context_line":"                rp_tree.update_inventory(rp_data.name, rp_data.inventory)"},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"    def get_available_resource(self, nodename):"}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_1cc37459","line":567,"range":{"start_line":566,"start_character":16,"end_line":567,"end_character":73},"updated":"2018-06-06 16:00:26.000000000","message":"This is all you can do for now without actually checking for allocations.  What you eventually want this to look like is:\n\n if allocations exist for rp:\n     LOG.warning(\"Allocations exist for removed GPU group %s - disabling instead of removing.\")\n     reserved \u003d total\n else:\n     rp_tree.remove(rp.uuid)\n\nFor now, you should add a TODO to make this happen once you have access to allocations.  (That should be coming as part of bp reshape-provider-tree.)\n\nAlso, please use parens rather than backslashes.","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fbf45a4c781b8eea025c865277b93085dd6bcbcb","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            rp_data \u003d rp_tree.data(rp)"},{"line_number":564,"context_line":"            if (rp_data.name[:len(GPU_RP_PREFIX)] \u003d\u003d GPU_RP_PREFIX and"},{"line_number":565,"context_line":"                    rp_data.name not in updated_rps):"},{"line_number":566,"context_line":"                rp_data.inventory[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d \\"},{"line_number":567,"context_line":"                    rp_data.inventory[fields.ResourceClass.VGPU][\u0027total\u0027]"},{"line_number":568,"context_line":"                rp_tree.update_inventory(rp_data.name, rp_data.inventory)"},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"    def get_available_resource(self, nodename):"}],"source_content_type":"text/x-python","patch_set":47,"id":"5f7c97a3_7abfff5f","line":567,"range":{"start_line":566,"start_character":16,"end_line":567,"end_character":73},"in_reply_to":"5f7c97a3_1cc37459","updated":"2018-06-07 01:09:04.000000000","message":"Will add TODO description","commit_id":"e6662d91d913fd5be711599f56fe5da908ebe455"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":526,"context_line":"        updated_rps \u003d set()"},{"line_number":527,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers."},{"line_number":530,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":531,"context_line":"            inv \u003d {"},{"line_number":532,"context_line":"                fields.ResourceClass.VGPU: {"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_b4131101","line":529,"range":{"start_line":529,"start_character":14,"end_line":529,"end_character":25},"updated":"2018-09-05 17:21:26.000000000","message":"s/distinguish/identify/","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":528,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":529,"context_line":"            # distinguish corresponding resource providers."},{"line_number":530,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":531,"context_line":"            inv \u003d {"},{"line_number":532,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":533,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_d4200d4c","line":530,"range":{"start_line":530,"start_character":22,"end_line":530,"end_character":23},"updated":"2018-09-05 17:21:26.000000000","message":"nit: parens not necessary here","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":543,"context_line":"                # corresponding gpu group on the host"},{"line_number":544,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":545,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":546,"context_line":"                # If the inventory or traits are changed, it means the vGPU"},{"line_number":547,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":548,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":549,"context_line":"                # inventory item equal to the total count of the inventory item"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_54bb9de3","line":546,"range":{"start_line":546,"start_character":45,"end_line":546,"end_character":48},"updated":"2018-09-05 17:21:26.000000000","message":"s/are/have/","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":544,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":545,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":546,"context_line":"                # If the inventory or traits are changed, it means the vGPU"},{"line_number":547,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":548,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":549,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":550,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_d4cecd81","line":547,"range":{"start_line":547,"start_character":38,"end_line":547,"end_character":40},"updated":"2018-09-05 17:21:26.000000000","message":"s/be/have/","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":547,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":548,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":549,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":550,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":551,"context_line":"                # types in a GPU group."},{"line_number":552,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":553,"context_line":"                # applied"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_54a07da5","line":550,"range":{"start_line":550,"start_character":38,"end_line":550,"end_character":44},"updated":"2018-09-05 17:21:26.000000000","message":"s/becase/because/","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":551,"context_line":"                # types in a GPU group."},{"line_number":552,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":553,"context_line":"                # applied"},{"line_number":554,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":555,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":556,"context_line":"                        \u0027total\u0027]"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_74a579b4","line":553,"updated":"2018-09-05 17:21:26.000000000","message":"You might be interested in this patch to os-traits:\n\nhttps://review.openstack.org/#/c/597170/","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":551,"context_line":"                # types in a GPU group."},{"line_number":552,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":553,"context_line":"                # applied"},{"line_number":554,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":555,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":556,"context_line":"                        \u0027total\u0027]"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_b7e1c9d2","line":553,"in_reply_to":"3f79a3b5_74a579b4","updated":"2018-09-06 01:15:32.000000000","message":"Yes, I will post traits related patches after n-rp patches finished.\nThank you very much, Jay.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":556,"context_line":"                        \u0027total\u0027]"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":559,"context_line":"            updated_rps.add(rp_name)"},{"line_number":560,"context_line":"        children_rps \u003d rp_tree.get_provider_uuids(root_name_or_uuid)"},{"line_number":561,"context_line":"        # Looking for gpu rps which don\u0027t exist anymore"},{"line_number":562,"context_line":"        for rp in children_rps:"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_d43d6d2c","line":559,"range":{"start_line":558,"start_character":0,"end_line":559,"end_character":36},"updated":"2018-09-05 17:21:26.000000000","message":"You should only be updating things if a) this is a new provider or b) inventory has changed. This, however, is going to mark the providers as having updated inventory each time this function is run, regardless of whether the vGPU inventory has changed.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":556,"context_line":"                        \u0027total\u0027]"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"            rp_tree.update_inventory(rp_name, inv)"},{"line_number":559,"context_line":"            updated_rps.add(rp_name)"},{"line_number":560,"context_line":"        children_rps \u003d rp_tree.get_provider_uuids(root_name_or_uuid)"},{"line_number":561,"context_line":"        # Looking for gpu rps which don\u0027t exist anymore"},{"line_number":562,"context_line":"        for rp in children_rps:"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_373b7938","line":559,"range":{"start_line":558,"start_character":0,"end_line":559,"end_character":36},"in_reply_to":"3f79a3b5_d43d6d2c","updated":"2018-09-06 01:15:32.000000000","message":"Will change it, thanks.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        # Looking for gpu rps which don\u0027t exist anymore"},{"line_number":562,"context_line":"        for rp in children_rps:"},{"line_number":563,"context_line":"            rp_data \u003d rp_tree.data(rp)"},{"line_number":564,"context_line":"            if (rp_data.name[:len(GPU_RP_PREFIX)] \u003d\u003d GPU_RP_PREFIX and"},{"line_number":565,"context_line":"                    rp_data.name not in updated_rps):"},{"line_number":566,"context_line":"                # TODO(naichuans): After bp:reshape-provider-tree finished,"},{"line_number":567,"context_line":"                # we need to delete staled rps instead of reserving resources."}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_941cd5c2","line":564,"range":{"start_line":564,"start_character":16,"end_line":564,"end_character":67},"updated":"2018-09-05 17:21:26.000000000","message":"a more Pythonic way of doing this would be:\n\n if rp_data.name.startswith(GPU_RP_PREFIX)","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        # Looking for gpu rps which don\u0027t exist anymore"},{"line_number":562,"context_line":"        for rp in children_rps:"},{"line_number":563,"context_line":"            rp_data \u003d rp_tree.data(rp)"},{"line_number":564,"context_line":"            if (rp_data.name[:len(GPU_RP_PREFIX)] \u003d\u003d GPU_RP_PREFIX and"},{"line_number":565,"context_line":"                    rp_data.name not in updated_rps):"},{"line_number":566,"context_line":"                # TODO(naichuans): After bp:reshape-provider-tree finished,"},{"line_number":567,"context_line":"                # we need to delete staled rps instead of reserving resources."}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_f7d2e1fc","line":564,"range":{"start_line":564,"start_character":16,"end_line":564,"end_character":67},"in_reply_to":"3f79a3b5_941cd5c2","updated":"2018-09-06 01:15:32.000000000","message":"Got it.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"dcdfc4a979c7f235f693cef44d787fa306176911","unresolved":false,"context_lines":[{"line_number":564,"context_line":"            if (rp_data.name[:len(GPU_RP_PREFIX)] \u003d\u003d GPU_RP_PREFIX and"},{"line_number":565,"context_line":"                    rp_data.name not in updated_rps):"},{"line_number":566,"context_line":"                # TODO(naichuans): After bp:reshape-provider-tree finished,"},{"line_number":567,"context_line":"                # we need to delete staled rps instead of reserving resources."},{"line_number":568,"context_line":"                rp_data.inventory[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d ("},{"line_number":569,"context_line":"                    rp_data.inventory[fields.ResourceClass.VGPU][\u0027total\u0027])"},{"line_number":570,"context_line":"                rp_tree.update_inventory(rp_data.name, rp_data.inventory)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_747d79e5","line":567,"range":{"start_line":567,"start_character":36,"end_line":567,"end_character":42},"updated":"2018-09-05 17:21:26.000000000","message":"s/staled/stale/\n\nthough I think you might have meant to use the term \"orphan\" instead of \"stale\"?","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ee423873eb5e0cdbb964c0bc59a5ca5edd27f678","unresolved":false,"context_lines":[{"line_number":564,"context_line":"            if (rp_data.name[:len(GPU_RP_PREFIX)] \u003d\u003d GPU_RP_PREFIX and"},{"line_number":565,"context_line":"                    rp_data.name not in updated_rps):"},{"line_number":566,"context_line":"                # TODO(naichuans): After bp:reshape-provider-tree finished,"},{"line_number":567,"context_line":"                # we need to delete staled rps instead of reserving resources."},{"line_number":568,"context_line":"                rp_data.inventory[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d ("},{"line_number":569,"context_line":"                    rp_data.inventory[fields.ResourceClass.VGPU][\u0027total\u0027])"},{"line_number":570,"context_line":"                rp_tree.update_inventory(rp_data.name, rp_data.inventory)"}],"source_content_type":"text/x-python","patch_set":49,"id":"3f79a3b5_9705ad7c","line":567,"range":{"start_line":567,"start_character":36,"end_line":567,"end_character":42},"in_reply_to":"3f79a3b5_747d79e5","updated":"2018-09-06 01:15:32.000000000","message":"Will change it.","commit_id":"c2b9862f312423509857ca37eb06d988a01af2a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":535,"context_line":"            LOG.info(\u0027Requesting provider tree reshape in order to move \u0027"},{"line_number":536,"context_line":"                     \u0027VGPU inventory from the root compute node provider \u0027"},{"line_number":537,"context_line":"                     \u0027%s to a child provider.\u0027, root_name_or_uuid)"},{"line_number":538,"context_line":"            raise exception.ReshapeNeeded()"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        vgpu_stats \u003d host_stats[\u0027vgpu_stats\u0027]"},{"line_number":541,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_72a1f839","line":538,"updated":"2018-10-02 12:00:14.000000000","message":"✓","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":541,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":542,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":543,"context_line":"            # distinguish corresponding resource providers."},{"line_number":544,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":545,"context_line":"            inv \u003d {"},{"line_number":546,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":547,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_12620417","line":544,"updated":"2018-10-02 12:00:14.000000000","message":"nit: you don\u0027t need the parens above.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":541,"context_line":"        for grp_id, grp_value in vgpu_stats.items():"},{"line_number":542,"context_line":"            # Each gpu group have a specified group id, so we add `grp_id` to"},{"line_number":543,"context_line":"            # distinguish corresponding resource providers."},{"line_number":544,"context_line":"            rp_name \u003d (GPU_RP_PREFIX + grp_id)"},{"line_number":545,"context_line":"            inv \u003d {"},{"line_number":546,"context_line":"                fields.ResourceClass.VGPU: {"},{"line_number":547,"context_line":"                    \u0027total\u0027: grp_value[\u0027total\u0027],"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_f98d68d4","line":544,"in_reply_to":"3f79a3b5_12620417","updated":"2018-10-09 03:02:17.000000000","message":"Will modify it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":556,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":557,"context_line":"                # corresponding gpu group on the host"},{"line_number":558,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":559,"context_line":"                rp_tree.update_inventory(rp_name, inv)"},{"line_number":560,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":561,"context_line":"                # If the inventory or traits are changed, it means the vGPU"},{"line_number":562,"context_line":"                # configuration might be changed. In this case, if the GPU"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_d267ac23","line":559,"updated":"2018-10-02 12:00:14.000000000","message":"✓","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":562,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":563,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":564,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":565,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":566,"context_line":"                # types in a GPU group."},{"line_number":567,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":568,"context_line":"                # applied"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_b270f0db","line":565,"range":{"start_line":565,"start_character":38,"end_line":565,"end_character":44},"updated":"2018-10-02 12:00:14.000000000","message":"because","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":562,"context_line":"                # configuration might be changed. In this case, if the GPU"},{"line_number":563,"context_line":"                # group has vGPUs allocated, set the reserved count of the vGPU"},{"line_number":564,"context_line":"                # inventory item equal to the total count of the inventory item"},{"line_number":565,"context_line":"                # to avoid scheduling becase we don\u0027t support multiple vGPU"},{"line_number":566,"context_line":"                # types in a GPU group."},{"line_number":567,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":568,"context_line":"                # applied"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_d9bc2c6d","line":565,"range":{"start_line":565,"start_character":38,"end_line":565,"end_character":44},"in_reply_to":"3f79a3b5_b270f0db","updated":"2018-10-09 03:02:17.000000000","message":"Oh, stupid mistake, thanks, Jay.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":569,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":570,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":571,"context_line":"                        \u0027total\u0027]"},{"line_number":572,"context_line":"                rp_tree.update_inventory(rp_name, inv)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"        if allocations is not None:"},{"line_number":575,"context_line":"            # For each consumer in the allocations dict, look for VGPU"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_b259d05b","line":572,"updated":"2018-10-02 12:00:14.000000000","message":"✓","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            for consumer_uuid, alloc_data in allocations.items():"},{"line_number":578,"context_line":"                # Copy and iterate over the current set of providers to avoid"},{"line_number":579,"context_line":"                # modifying keys while iterating."},{"line_number":580,"context_line":"                allocations \u003d alloc_data[\u0027allocations\u0027]"},{"line_number":581,"context_line":"                for rp_uuid in list(allocations):"},{"line_number":582,"context_line":"                    resources \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":583,"context_line":"                    if fields.ResourceClass.VGPU in resources:"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_922374be","line":580,"updated":"2018-10-02 12:00:14.000000000","message":"Please change the name of the allocations variable here. It is shadowing/overwriting the allocations kwarg passed to the _update_gpu_rp() function.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            for consumer_uuid, alloc_data in allocations.items():"},{"line_number":578,"context_line":"                # Copy and iterate over the current set of providers to avoid"},{"line_number":579,"context_line":"                # modifying keys while iterating."},{"line_number":580,"context_line":"                allocations \u003d alloc_data[\u0027allocations\u0027]"},{"line_number":581,"context_line":"                for rp_uuid in list(allocations):"},{"line_number":582,"context_line":"                    resources \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":583,"context_line":"                    if fields.ResourceClass.VGPU in resources:"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_79b3989b","line":580,"in_reply_to":"3f79a3b5_922374be","updated":"2018-10-09 03:02:17.000000000","message":"Will change it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":578,"context_line":"                # Copy and iterate over the current set of providers to avoid"},{"line_number":579,"context_line":"                # modifying keys while iterating."},{"line_number":580,"context_line":"                allocations \u003d alloc_data[\u0027allocations\u0027]"},{"line_number":581,"context_line":"                for rp_uuid in list(allocations):"},{"line_number":582,"context_line":"                    resources \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":583,"context_line":"                    if fields.ResourceClass.VGPU in resources:"},{"line_number":584,"context_line":"                        # We\u0027ve found VGPU allocations on a provider. It"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_35012a05","line":581,"range":{"start_line":581,"start_character":30,"end_line":581,"end_character":48},"updated":"2018-10-02 12:00:14.000000000","message":"not necessary. Just do:\n\n for rp_uuid in allocations.keys():\n\n(but, as I mention above, change the name of the allocations variable so you\u0027re not shadowing the function argument of the same name :) )","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":578,"context_line":"                # Copy and iterate over the current set of providers to avoid"},{"line_number":579,"context_line":"                # modifying keys while iterating."},{"line_number":580,"context_line":"                allocations \u003d alloc_data[\u0027allocations\u0027]"},{"line_number":581,"context_line":"                for rp_uuid in list(allocations):"},{"line_number":582,"context_line":"                    resources \u003d allocations[rp_uuid][\u0027resources\u0027]"},{"line_number":583,"context_line":"                    if fields.ResourceClass.VGPU in resources:"},{"line_number":584,"context_line":"                        # We\u0027ve found VGPU allocations on a provider. It"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_99b6b489","line":581,"range":{"start_line":581,"start_character":30,"end_line":581,"end_character":48},"in_reply_to":"3f79a3b5_35012a05","updated":"2018-10-09 03:02:17.000000000","message":"Got it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":596,"context_line":"                                      \u0027consumer_uuid\u0027: consumer_uuid,"},{"line_number":597,"context_line":"                                      \u0027alloc_data\u0027: alloc_data,"},{"line_number":598,"context_line":"                                      \u0027root_uuid\u0027: root_node.uuid})"},{"line_number":599,"context_line":"                            raise exception.ReshapeFailed(error\u003dmsg)"},{"line_number":600,"context_line":"                        # Add the VGPU allocation to the VGPU provider."},{"line_number":601,"context_line":"                        # TODO(naichuans): this logic is wrong, but we do not"},{"line_number":602,"context_line":"                        # support multiple gpu type on one compute node now ,"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_722498c3","line":599,"updated":"2018-10-02 12:00:14.000000000","message":"✓","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4499d62fcfd19ab0db88ee90ee6424e7a345ea27","unresolved":false,"context_lines":[{"line_number":607,"context_line":"                                    fields.ResourceClass.VGPU:"},{"line_number":608,"context_line":"                                        resources[fields.ResourceClass.VGPU]"},{"line_number":609,"context_line":"                                }"},{"line_number":610,"context_line":"                            }"},{"line_number":611,"context_line":"                        # And remove the VGPU allocation from the"},{"line_number":612,"context_line":"                        # root node provider."},{"line_number":613,"context_line":"                        del resources[fields.ResourceClass.VGPU]"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_f51f3257","line":610,"updated":"2018-10-02 12:00:14.000000000","message":"This is going to allocate one VGPU for the consumer *on each pGPU group*. I don\u0027t believe that is what you wanted, is it?","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"00c7f7a27b489209fd805c656338f97d420e91b7","unresolved":false,"context_lines":[{"line_number":607,"context_line":"                                    fields.ResourceClass.VGPU:"},{"line_number":608,"context_line":"                                        resources[fields.ResourceClass.VGPU]"},{"line_number":609,"context_line":"                                }"},{"line_number":610,"context_line":"                            }"},{"line_number":611,"context_line":"                        # And remove the VGPU allocation from the"},{"line_number":612,"context_line":"                        # root node provider."},{"line_number":613,"context_line":"                        del resources[fields.ResourceClass.VGPU]"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_374be728","line":610,"in_reply_to":"3f79a3b5_f51f3257","updated":"2018-10-09 04:56:57.000000000","message":"Hi, Jay, please check my note.\nCurrently, we only support one gpu group, so it works well.\nI add the loop because the vgpu_stats support multiple gpu groups.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"a43ffc0c82da3fb3abb140d10b32a6e3c98c9f1f","unresolved":false,"context_lines":[{"line_number":607,"context_line":"                                    fields.ResourceClass.VGPU:"},{"line_number":608,"context_line":"                                        resources[fields.ResourceClass.VGPU]"},{"line_number":609,"context_line":"                                }"},{"line_number":610,"context_line":"                            }"},{"line_number":611,"context_line":"                        # And remove the VGPU allocation from the"},{"line_number":612,"context_line":"                        # root node provider."},{"line_number":613,"context_line":"                        del resources[fields.ResourceClass.VGPU]"}],"source_content_type":"text/x-python","patch_set":56,"id":"3f79a3b5_39ad2032","line":610,"in_reply_to":"3f79a3b5_f51f3257","updated":"2018-10-09 03:02:17.000000000","message":"Will check it.","commit_id":"a55f3b9c2348435879f9e66a3152a10527c89f18"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b312acd2fe5b5f91208ac75061075ea6279623a9","unresolved":false,"context_lines":[{"line_number":518,"context_line":"            )"},{"line_number":519,"context_line":"        return result"},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"    def _update_gpu_rp(self, rp_tree, host_stats, root_name_or_uuid,"},{"line_number":522,"context_line":"                       allocations\u003dNone):"},{"line_number":523,"context_line":"        \"\"\"Update the resource providers for GPUs in the provider tree. If the"},{"line_number":524,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"}],"source_content_type":"text/x-python","patch_set":57,"id":"3f79a3b5_45694dbe","line":521,"range":{"start_line":521,"start_character":8,"end_line":521,"end_character":22},"updated":"2018-10-17 15:25:38.000000000","message":"I don\u0027t see anything calling this?\n\nI guess this does later in the series:\n\nhttps://review.openstack.org/#/c/521041/46/nova/virt/xenapi/driver.py","commit_id":"96b265ff631362ca27eff7efa0a1de4f3cb86608"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"ace92df64db76a201062795ef29235893fb5a877","unresolved":false,"context_lines":[{"line_number":518,"context_line":"            )"},{"line_number":519,"context_line":"        return result"},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"    def _update_gpu_rp(self, rp_tree, host_stats, root_name_or_uuid,"},{"line_number":522,"context_line":"                       allocations\u003dNone):"},{"line_number":523,"context_line":"        \"\"\"Update the resource providers for GPUs in the provider tree. If the"},{"line_number":524,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"}],"source_content_type":"text/x-python","patch_set":57,"id":"3f79a3b5_10f7075d","line":521,"range":{"start_line":521,"start_character":8,"end_line":521,"end_character":22},"in_reply_to":"3f79a3b5_45694dbe","updated":"2018-10-18 01:25:53.000000000","message":"You are right, Matt. This patch only added the vgpu rp update function and the third patch will call it.","commit_id":"96b265ff631362ca27eff7efa0a1de4f3cb86608"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c599e3824a584dfc344c1f0e13c0a0529b608b07","unresolved":false,"context_lines":[{"line_number":519,"context_line":"        return result"},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"    def _update_gpu_rp(self, rp_tree, host_stats, root_name_or_uuid,"},{"line_number":522,"context_line":"                       allocations\u003dNone):"},{"line_number":523,"context_line":"        \"\"\"Update the resource providers for GPUs in the provider tree. If the"},{"line_number":524,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"},{"line_number":525,"context_line":"        compute node\u0027s child, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_9b34da48","line":522,"range":{"start_line":522,"start_character":23,"end_line":522,"end_character":41},"updated":"2018-11-27 14:30:50.000000000","message":"Please add a docstring to this this method that explains the allocations kwarg is *mutable* and will be changed by this method. Explain in the docstring *how* the allocations kwarg is mutated.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3598bf18e5b060de0cea9c7300bcf6154840a6d7","unresolved":false,"context_lines":[{"line_number":519,"context_line":"        return result"},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"    def _update_gpu_rp(self, rp_tree, host_stats, root_name_or_uuid,"},{"line_number":522,"context_line":"                       allocations\u003dNone):"},{"line_number":523,"context_line":"        \"\"\"Update the resource providers for GPUs in the provider tree. If the"},{"line_number":524,"context_line":"        resource provider doesn\u0027t exist, we create one and make it as the"},{"line_number":525,"context_line":"        compute node\u0027s child, then attach the inventory to it."}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_0190494b","line":522,"range":{"start_line":522,"start_character":23,"end_line":522,"end_character":41},"in_reply_to":"3f79a3b5_9b34da48","updated":"2018-11-28 09:26:33.000000000","message":"Will add it.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5b738b804e5e78e8bbc46ee4f8b6a5db4c0ffb16","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                # compute requests to spawn an instance, it will send it to"},{"line_number":556,"context_line":"                # driver in `allocations`, then we could easily find the"},{"line_number":557,"context_line":"                # corresponding gpu group on the host"},{"line_number":558,"context_line":"                rp_tree.new_child(rp_name, root_name_or_uuid, uuid\u003dgrp_id)"},{"line_number":559,"context_line":"                rp_tree.update_inventory(rp_name, inv)"},{"line_number":560,"context_line":"            elif rp_tree.has_inventory_changed(rp_name, inv):"},{"line_number":561,"context_line":"                # If the inventory or traits are changed, it means the vGPU"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_04d229d1","line":558,"range":{"start_line":558,"start_character":67,"end_line":558,"end_character":73},"updated":"2018-12-04 09:38:03.000000000","message":"+1 to map the RP directly to the hypervisor uuid","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c599e3824a584dfc344c1f0e13c0a0529b608b07","unresolved":false,"context_lines":[{"line_number":566,"context_line":"                # types in a GPU group."},{"line_number":567,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":568,"context_line":"                # applied"},{"line_number":569,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":570,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":571,"context_line":"                        \u0027total\u0027]"},{"line_number":572,"context_line":"                rp_tree.update_inventory(rp_name, inv)"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_1b60ca33","line":569,"updated":"2018-11-27 14:30:50.000000000","message":"nit: might be worth adding a LOG.warning() here saying that you found something unexpected: that is, you found VGPUs assigned on a PGPU group when you expected no such assignments to exist. In other words, someone had used the PGPU outside of Nova, or there was a data corruption somewhere in Nova in the reshape process.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"3598bf18e5b060de0cea9c7300bcf6154840a6d7","unresolved":false,"context_lines":[{"line_number":566,"context_line":"                # types in a GPU group."},{"line_number":567,"context_line":"                # TODO(naichuans): Add traits related check after os-traits"},{"line_number":568,"context_line":"                # applied"},{"line_number":569,"context_line":"                if grp_value[\u0027total\u0027] !\u003d grp_value[\u0027remaining\u0027]:"},{"line_number":570,"context_line":"                    inv[fields.ResourceClass.VGPU][\u0027reserved\u0027] \u003d grp_value["},{"line_number":571,"context_line":"                        \u0027total\u0027]"},{"line_number":572,"context_line":"                rp_tree.update_inventory(rp_name, inv)"}],"source_content_type":"text/x-python","patch_set":58,"id":"3f79a3b5_c187b110","line":569,"in_reply_to":"3f79a3b5_1b60ca33","updated":"2018-11-28 09:26:33.000000000","message":"Will add it.","commit_id":"8333d21ab2a72b38efffef6b3fbcd3f58a48d8f8"}],"nova/virt/xenapi/host.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"995a5e2d52965394502bde32cf9ffce052237bb3","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        type_ref \u003d type_names_in_grp[chosen_type]"},{"line_number":306,"context_line":"        type_uuid \u003d self._session.call_xenapi(\u0027VGPU_type.get_uuid\u0027, type_ref)"},{"line_number":307,"context_line":"        stat[\u0027uuid\u0027] \u003d type_uuid"},{"line_number":308,"context_line":"        stat[\u0027type_name\u0027] \u003d chosen_type"},{"line_number":309,"context_line":"        stat[\u0027max_heads\u0027] \u003d int(self._session.call_xenapi("},{"line_number":310,"context_line":"            \u0027VGPU_type.get_max_heads\u0027, type_ref))"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_040c223f","line":308,"range":{"start_line":308,"start_character":28,"end_line":308,"end_character":39},"updated":"2018-03-29 20:57:34.000000000","message":"I think this should be a list\n\n stat[\u0027type_names\u0027] \u003d [chosen_type]\n\n...to prepare for when you do support more than one type.","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"70e7038eadc21ba17b4387ba8caca9639c506886","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        type_ref \u003d type_names_in_grp[chosen_type]"},{"line_number":306,"context_line":"        type_uuid \u003d self._session.call_xenapi(\u0027VGPU_type.get_uuid\u0027, type_ref)"},{"line_number":307,"context_line":"        stat[\u0027uuid\u0027] \u003d type_uuid"},{"line_number":308,"context_line":"        stat[\u0027type_name\u0027] \u003d chosen_type"},{"line_number":309,"context_line":"        stat[\u0027max_heads\u0027] \u003d int(self._session.call_xenapi("},{"line_number":310,"context_line":"            \u0027VGPU_type.get_max_heads\u0027, type_ref))"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"bf659307_0ba8aa89","line":308,"range":{"start_line":308,"start_character":28,"end_line":308,"end_character":39},"in_reply_to":"bf659307_040c223f","updated":"2018-03-30 05:54:50.000000000","message":"Hi, Eric. On XenServer, each pgpu group would have a resource provider, each resource provider would only support one vgpu type. For some Nvidia gpu, even they do support multiple vgpu types on one pgpu, we will only allow users to select just one type to support","commit_id":"535854f4870a3792b930c2e40289fe1e6dcc9675"}]}
