)]}'
{"nova/virt/xenapi/driver.py":[{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"eb1b797eb3ff470ee62881aa7ffeebb2b52d6c8b","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                # If this GPU group supports display heads, we also create"},{"line_number":475,"context_line":"                # inventory data for it. The allocation granularity is"},{"line_number":476,"context_line":"                # *heads_per_vgpu*."},{"line_number":477,"context_line":"                vgpu_inv[fields.ResourceClass.VGPU_DISPLAY_HEAD] \u003d {"},{"line_number":478,"context_line":"                    \u0027total\u0027: total_heads,"},{"line_number":479,"context_line":"                    \u0027min_unit\u0027: heads_per_vgpu,"},{"line_number":480,"context_line":"                    \u0027max_unit\u0027: heads_per_vgpu,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff82abbf_e8d44aeb","line":477,"updated":"2017-11-28 08:51:50.000000000","message":"Just realized there is a problem here. The display heads are not independent resources. Instead it\u0027s bound tightly with resourceClass.VGPU. e.g. If some flavor requests VGPU without specifying VGPU_DISPLAY_HEAD, it only consumes VGPU resources from the view of placement. But actually the available display heads got reduced also.","commit_id":"5e371d1a48f40228064969be8ac2cef4f0a33d6d"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"609aecffd33b9ea9160d1aa1a55b93d5155b2033","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                # If this GPU group supports display heads, we also create"},{"line_number":475,"context_line":"                # inventory data for it. The allocation granularity is"},{"line_number":476,"context_line":"                # *heads_per_vgpu*."},{"line_number":477,"context_line":"                vgpu_inv[fields.ResourceClass.VGPU_DISPLAY_HEAD] \u003d {"},{"line_number":478,"context_line":"                    \u0027total\u0027: total_heads,"},{"line_number":479,"context_line":"                    \u0027min_unit\u0027: heads_per_vgpu,"},{"line_number":480,"context_line":"                    \u0027max_unit\u0027: heads_per_vgpu,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff82abbf_476999f6","line":477,"in_reply_to":"ff82abbf_e8d44aeb","updated":"2017-11-28 16:32:20.000000000","message":"Per the discussion at here: http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2017-11-28.log.html\n\nThe proposed resolution is to:\n1. always define VGPU_DISPLAY_HEAD in flavor regardless whether users will use display heads or not;\n2. use custom trait - e.g.CUSTOM_NO_DISPLAY_HEAD in flavor to cover cases where display head is not supported by the vGPUs.\n\nThis should be documented.","commit_id":"5e371d1a48f40228064969be8ac2cef4f0a33d6d"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fe039eae1f6dcc17b67ef68f1813b26903ca2124","unresolved":false,"context_lines":[{"line_number":460,"context_line":"            total_vgpus \u003d total_per_grp * grp_size"},{"line_number":461,"context_line":"            total_heads \u003d heads_per_vgpu * total_vgpus"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        if total_vgpus \u003e 0:"},{"line_number":464,"context_line":"            # Only create inventory for vGPU when driver can supply vGPUs."},{"line_number":465,"context_line":"            # At the moment, XenAPI can support up to one vGPU per VM,"},{"line_number":466,"context_line":"            # so max_unit is 1."},{"line_number":467,"context_line":"            vgpu_inv[fields.ResourceClass.VGPU] \u003d {"},{"line_number":468,"context_line":"                \u0027total\u0027: total_vgpus,"},{"line_number":469,"context_line":"                \u0027min_unit\u0027: 1,"},{"line_number":470,"context_line":"                \u0027max_unit\u0027: 1,"},{"line_number":471,"context_line":"                \u0027step_size\u0027: 1,"},{"line_number":472,"context_line":"            }"},{"line_number":473,"context_line":"            if total_heads \u003e 0:"},{"line_number":474,"context_line":"                # TODO(jianghuaw): When we support traits, we will create"},{"line_number":475,"context_line":"                # a custom trait - e.g. CUSTOM_NO_DISPLAY_HEAD for the case"},{"line_number":476,"context_line":"                # that there is no display heads, so that we can schedule"},{"line_number":477,"context_line":"                # resource providers basing on ResourceClass.VGPU and"},{"line_number":478,"context_line":"                # CUSTOM_NO_DISPLAY_HEAD ."},{"line_number":479,"context_line":"                # If this GPU group supports display heads, we also create"},{"line_number":480,"context_line":"                # inventory data for it. The allowed request amount is always"},{"line_number":481,"context_line":"                # equal to *heads_per_vgpu*."},{"line_number":482,"context_line":"                vgpu_inv[fields.ResourceClass.VGPU_DISPLAY_HEAD] \u003d {"},{"line_number":483,"context_line":"                    \u0027total\u0027: total_heads,"},{"line_number":484,"context_line":"                    \u0027min_unit\u0027: heads_per_vgpu,"},{"line_number":485,"context_line":"                    \u0027max_unit\u0027: heads_per_vgpu,"},{"line_number":486,"context_line":"                    \u0027step_size\u0027: heads_per_vgpu,"},{"line_number":487,"context_line":"                }"},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"        return vgpu_inv"},{"line_number":490,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff82abbf_0c2f1f88","line":487,"range":{"start_line":463,"start_character":0,"end_line":487,"end_character":17},"updated":"2017-11-29 09:29:33.000000000","message":"backspace this part to make it as a part of `if vgpu_stats:`?","commit_id":"76be00a6c1824a5ec12380b01fecc3a0f349625d"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"05966c807a33c83f4f32673a751859338b3d8f11","unresolved":false,"context_lines":[{"line_number":460,"context_line":"            total_vgpus \u003d total_per_grp * grp_size"},{"line_number":461,"context_line":"            total_heads \u003d heads_per_vgpu * total_vgpus"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"        if total_vgpus \u003e 0:"},{"line_number":464,"context_line":"            # Only create inventory for vGPU when driver can supply vGPUs."},{"line_number":465,"context_line":"            # At the moment, XenAPI can support up to one vGPU per VM,"},{"line_number":466,"context_line":"            # so max_unit is 1."},{"line_number":467,"context_line":"            vgpu_inv[fields.ResourceClass.VGPU] \u003d {"},{"line_number":468,"context_line":"                \u0027total\u0027: total_vgpus,"},{"line_number":469,"context_line":"                \u0027min_unit\u0027: 1,"},{"line_number":470,"context_line":"                \u0027max_unit\u0027: 1,"},{"line_number":471,"context_line":"                \u0027step_size\u0027: 1,"},{"line_number":472,"context_line":"            }"},{"line_number":473,"context_line":"            if total_heads \u003e 0:"},{"line_number":474,"context_line":"                # TODO(jianghuaw): When we support traits, we will create"},{"line_number":475,"context_line":"                # a custom trait - e.g. CUSTOM_NO_DISPLAY_HEAD for the case"},{"line_number":476,"context_line":"                # that there is no display heads, so that we can schedule"},{"line_number":477,"context_line":"                # resource providers basing on ResourceClass.VGPU and"},{"line_number":478,"context_line":"                # CUSTOM_NO_DISPLAY_HEAD ."},{"line_number":479,"context_line":"                # If this GPU group supports display heads, we also create"},{"line_number":480,"context_line":"                # inventory data for it. The allowed request amount is always"},{"line_number":481,"context_line":"                # equal to *heads_per_vgpu*."},{"line_number":482,"context_line":"                vgpu_inv[fields.ResourceClass.VGPU_DISPLAY_HEAD] \u003d {"},{"line_number":483,"context_line":"                    \u0027total\u0027: total_heads,"},{"line_number":484,"context_line":"                    \u0027min_unit\u0027: heads_per_vgpu,"},{"line_number":485,"context_line":"                    \u0027max_unit\u0027: heads_per_vgpu,"},{"line_number":486,"context_line":"                    \u0027step_size\u0027: heads_per_vgpu,"},{"line_number":487,"context_line":"                }"},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"        return vgpu_inv"},{"line_number":490,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff82abbf_9a0d6cea","line":487,"range":{"start_line":463,"start_character":0,"end_line":487,"end_character":17},"in_reply_to":"ff82abbf_0c2f1f88","updated":"2017-12-01 01:58:14.000000000","message":"Thanks. I see you point, but I\u0027d love to avoid nested layers which is not a must.\nThis part can only depends on \"total_vgpus \u003e 0\" - no vGPUs then not update vgpu_inv and the following heads inv. So I\u0027d keep it is.\nBut I will consider to return {} early if vgpu_stats is None or empty dict if other change needed.","commit_id":"76be00a6c1824a5ec12380b01fecc3a0f349625d"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"dcd58d624f9303f9939ffd387b4ca4a748b11597","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        grp_info \u003d vgpu_stats[grps[0]]"},{"line_number":469,"context_line":"        total_per_grp \u003d grp_info[\u0027total\u0027]"},{"line_number":470,"context_line":"        heads_per_vgpu \u003d grp_info[\u0027max_heads\u0027]"},{"line_number":471,"context_line":"        total_vgpus \u003d total_per_grp * grp_size"},{"line_number":472,"context_line":"        total_heads \u003d heads_per_vgpu * total_vgpus"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"        if total_vgpus \u003e 0:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df87a7cf_3606321e","line":471,"range":{"start_line":471,"start_character":8,"end_line":471,"end_character":46},"updated":"2017-12-08 03:27:17.000000000","message":"Because even we have more then 1 group, they are using the same vgpu, so we can use multiplication, right?","commit_id":"0a8fe4ddb816895be9f7ae435b214c96a9595d2b"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"cd0303e4911201b8d104cbf5287bbda8bdc5d4a9","unresolved":false,"context_lines":[{"line_number":468,"context_line":"        grp_info \u003d vgpu_stats[grps[0]]"},{"line_number":469,"context_line":"        total_per_grp \u003d grp_info[\u0027total\u0027]"},{"line_number":470,"context_line":"        heads_per_vgpu \u003d grp_info[\u0027max_heads\u0027]"},{"line_number":471,"context_line":"        total_vgpus \u003d total_per_grp * grp_size"},{"line_number":472,"context_line":"        total_heads \u003d heads_per_vgpu * total_vgpus"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"        if total_vgpus \u003e 0:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df87a7cf_f66a0ab1","line":471,"range":{"start_line":471,"start_character":8,"end_line":471,"end_character":46},"in_reply_to":"df87a7cf_3606321e","updated":"2017-12-08 03:34:43.000000000","message":"Yes.","commit_id":"0a8fe4ddb816895be9f7ae435b214c96a9595d2b"},{"author":{"_account_id":18529,"name":"Dongdong Pei","email":"peidongdong121@163.com","username":"dongdongpei"},"change_message_id":"b90cba22b0f7fb8e7bbc5edd58e5cd812f340e3a","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        # must contain the same vGPU type. So just add them up."},{"line_number":475,"context_line":"        grps \u003d list(vgpu_stats.keys())"},{"line_number":476,"context_line":"        grp_size \u003d len(grps)"},{"line_number":477,"context_line":"        grp_info \u003d vgpu_stats[grps[0]]"},{"line_number":478,"context_line":"        total_per_grp \u003d grp_info[\u0027total\u0027]"},{"line_number":479,"context_line":"        heads_per_vgpu \u003d grp_info[\u0027max_heads\u0027]"},{"line_number":480,"context_line":"        total_vgpus \u003d total_per_grp * grp_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf8cb3f7_e8137cb7","line":477,"range":{"start_line":477,"start_character":8,"end_line":477,"end_character":38},"updated":"2017-12-22 07:24:29.000000000","message":"If CONF.devices.enabled_vgpu_types is None, vgpu_stats will be {}, this will cause an IndexError. Same as below.","commit_id":"42ec3db25a6ddf3d911724e5e7b1f33b2624bf85"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"c79753bf67024090c4a083f7a5ff21eda8c62730","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        # must contain the same vGPU type. So just add them up."},{"line_number":475,"context_line":"        grps \u003d list(vgpu_stats.keys())"},{"line_number":476,"context_line":"        grp_size \u003d len(grps)"},{"line_number":477,"context_line":"        grp_info \u003d vgpu_stats[grps[0]]"},{"line_number":478,"context_line":"        total_per_grp \u003d grp_info[\u0027total\u0027]"},{"line_number":479,"context_line":"        heads_per_vgpu \u003d grp_info[\u0027max_heads\u0027]"},{"line_number":480,"context_line":"        total_vgpus \u003d total_per_grp * grp_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_272db0fd","line":477,"range":{"start_line":477,"start_character":8,"end_line":477,"end_character":38},"in_reply_to":"9f91af0f_4b0904db","updated":"2018-01-08 10:07:38.000000000","message":"Dongdong, thanks for the comment.\nBob, thanks for the advice.\n\nBut TBH, I guess that\u0027s the right way to check if the value is None or an empty dict with\n if not vgpu_stats:","commit_id":"42ec3db25a6ddf3d911724e5e7b1f33b2624bf85"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3e169ea2d05fe408a297700beee7b3ed048f5bae","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        # must contain the same vGPU type. So just add them up."},{"line_number":475,"context_line":"        grps \u003d list(vgpu_stats.keys())"},{"line_number":476,"context_line":"        grp_size \u003d len(grps)"},{"line_number":477,"context_line":"        grp_info \u003d vgpu_stats[grps[0]]"},{"line_number":478,"context_line":"        total_per_grp \u003d grp_info[\u0027total\u0027]"},{"line_number":479,"context_line":"        heads_per_vgpu \u003d grp_info[\u0027max_heads\u0027]"},{"line_number":480,"context_line":"        total_vgpus \u003d total_per_grp * grp_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f91af0f_4b0904db","line":477,"range":{"start_line":477,"start_character":8,"end_line":477,"end_character":38},"in_reply_to":"bf8cb3f7_22f9674c","updated":"2018-01-05 10:00:41.000000000","message":"Might be worth making that more explicit (e.g. \"if vgpu_stats is None or len(vgpu_stats) \u003d\u003d 0\")?","commit_id":"42ec3db25a6ddf3d911724e5e7b1f33b2624bf85"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"1df63520e672c9b117085a28420d129eef92b459","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        # must contain the same vGPU type. So just add them up."},{"line_number":475,"context_line":"        grps \u003d list(vgpu_stats.keys())"},{"line_number":476,"context_line":"        grp_size \u003d len(grps)"},{"line_number":477,"context_line":"        grp_info \u003d vgpu_stats[grps[0]]"},{"line_number":478,"context_line":"        total_per_grp \u003d grp_info[\u0027total\u0027]"},{"line_number":479,"context_line":"        heads_per_vgpu \u003d grp_info[\u0027max_heads\u0027]"},{"line_number":480,"context_line":"        total_vgpus \u003d total_per_grp * grp_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf8cb3f7_22f9674c","line":477,"range":{"start_line":477,"start_character":8,"end_line":477,"end_character":38},"in_reply_to":"bf8cb3f7_e8137cb7","updated":"2017-12-25 07:04:51.000000000","message":"Dongdong, it should stop at line-464 if it\u0027s in that case.","commit_id":"42ec3db25a6ddf3d911724e5e7b1f33b2624bf85"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"eedc34aac9a944f4f2f241b2b42c6615d5c1c57d","unresolved":false,"context_lines":[{"line_number":460,"context_line":""},{"line_number":461,"context_line":"    def _get_vgpu_inventory(self, vgpu_stats):"},{"line_number":462,"context_line":"        # Get inventory data for VGPU basing on vgpu_stats."},{"line_number":463,"context_line":"        if not vgpu_stats:"},{"line_number":464,"context_line":"            # Stop early if no vgpu_stats."},{"line_number":465,"context_line":"            return None"},{"line_number":466,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5f93b717_27cb8c1e","line":463,"range":{"start_line":463,"start_character":8,"end_line":463,"end_character":26},"updated":"2018-01-29 12:52:15.000000000","message":"suggestion is to use if vgpu_stats is None or len(vgpu_stats) \u003d\u003d 0:","commit_id":"0a97733f24740f69907eff69679ad780e235af93"}],"releasenotes/notes/vgpu-18da86834c90f041.yaml":[{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"dcd58d624f9303f9939ffd387b4ca4a748b11597","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    The operators should specify a vGPU resource and the display heads in the"},{"line_number":29,"context_line":"    flavor\u0027s extra_specs:"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    * nova flavor-key \u003cflavor-id\u003e set resources:VGPU\u003d1 resources:VGPU_DISPLAY_HEAD\u003d2"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    Then users can use the flavor to boot instances with a vGPU attached."},{"line_number":34,"context_line":"    At the moment, XenServer doesn\u0027t support multiple vGPUs for a single"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"df87a7cf_b31ed4b8","line":31,"range":{"start_line":31,"start_character":54,"end_line":31,"end_character":84},"updated":"2017-12-08 03:27:17.000000000","message":"Just one question, if the \"max-heads ( RO): 2\", then in flavor\u0027s extra_specs, user can set either 1 or 2? Since in get_inventory(), you have updated the correct data, so scheduler can schedule the correct node for VM?","commit_id":"0a8fe4ddb816895be9f7ae435b214c96a9595d2b"},{"author":{"_account_id":17922,"name":"Huan Xie","email":"huan.xie@citrix.com","username":"huan"},"change_message_id":"d636f49ef3ab81413ff1268b2ac0400f4fb5aee8","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    The operators should specify a vGPU resource and the display heads in the"},{"line_number":29,"context_line":"    flavor\u0027s extra_specs:"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    * nova flavor-key \u003cflavor-id\u003e set resources:VGPU\u003d1 resources:VGPU_DISPLAY_HEAD\u003d2"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    Then users can use the flavor to boot instances with a vGPU attached."},{"line_number":34,"context_line":"    At the moment, XenServer doesn\u0027t support multiple vGPUs for a single"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"df87a7cf_bca8e11f","line":31,"range":{"start_line":31,"start_character":54,"end_line":31,"end_character":84},"in_reply_to":"df87a7cf_16968e94","updated":"2017-12-08 06:08:33.000000000","message":"clear, thanks","commit_id":"0a8fe4ddb816895be9f7ae435b214c96a9595d2b"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"cd0303e4911201b8d104cbf5287bbda8bdc5d4a9","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    The operators should specify a vGPU resource and the display heads in the"},{"line_number":29,"context_line":"    flavor\u0027s extra_specs:"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    * nova flavor-key \u003cflavor-id\u003e set resources:VGPU\u003d1 resources:VGPU_DISPLAY_HEAD\u003d2"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    Then users can use the flavor to boot instances with a vGPU attached."},{"line_number":34,"context_line":"    At the moment, XenServer doesn\u0027t support multiple vGPUs for a single"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"df87a7cf_16968e94","line":31,"range":{"start_line":31,"start_character":54,"end_line":31,"end_character":84},"in_reply_to":"df87a7cf_b31ed4b8","updated":"2017-12-08 03:34:43.000000000","message":"No. It can only use 2 for \"max-heads: 2\". At the moment, if VM consumed a vGPU which support max-heads\u003d2, it also consumed 2 display heads even the 2nd display head is not used by users. That\u0027s the current logic and it\u0027s restricted via the set_size at:\nhttps://review.openstack.org/#/c/523342/1/nova/virt/xenapi/driver.py@481","commit_id":"0a8fe4ddb816895be9f7ae435b214c96a9595d2b"}]}
