)]}'
{"nova/policies/servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating a server"},{"line_number":160,"context_line":"when the requesting tenant already has other active servers in down cells"},{"line_number":161,"context_line":"whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_9384d358","line":159,"range":{"start_line":159,"start_character":58,"end_line":159,"end_character":66},"updated":"2018-11-08 16:06:57.000000000","message":"Does this also affect resize? We count quota during resize to make sure the new flavor doesn\u0027t make the tenant go over quota.\n\nhttps://github.com/openstack/nova/blob/6e8a69daf14a15fe0b0633f21f4112f19487e9da/nova/compute/api.py#L3426","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f3a4d61d62c4895d8fdd2f8a480043205a68fcca","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating a server"},{"line_number":160,"context_line":"when the requesting tenant already has other active servers in down cells"},{"line_number":161,"context_line":"whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a2149043","line":159,"range":{"start_line":159,"start_character":58,"end_line":159,"end_character":66},"in_reply_to":"3f79a3b5_9384d358","updated":"2018-11-19 10:24:31.000000000","message":"I had not thought of resize, but looks like it would be effected too, let me confirm..","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":160,"context_line":"when the requesting tenant already has other active servers in down cells"},{"line_number":161,"context_line":"whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"This rule defaults to ``rule:admin_api`` and hence only admins by default will"},{"line_number":165,"context_line":"be able to create servers even if they have servers in the down cells at the"},{"line_number":166,"context_line":"risk of wrong quota calculation/overcommitment on allowed quota. Normal users"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b36f8f91","line":163,"updated":"2018-11-08 16:06:57.000000000","message":"Are there also microversion implications for this, i.e. it only works with a given minimum microversion? If so, the doc could be updated in the microversion patch on top of this to note the specific microversion.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f3a4d61d62c4895d8fdd2f8a480043205a68fcca","unresolved":false,"context_lines":[{"line_number":160,"context_line":"when the requesting tenant already has other active servers in down cells"},{"line_number":161,"context_line":"whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"This rule defaults to ``rule:admin_api`` and hence only admins by default will"},{"line_number":165,"context_line":"be able to create servers even if they have servers in the down cells at the"},{"line_number":166,"context_line":"risk of wrong quota calculation/overcommitment on allowed quota. Normal users"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_82fab40d","line":163,"in_reply_to":"3f79a3b5_b36f8f91","updated":"2018-11-19 10:24:31.000000000","message":"Done","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":164,"context_line":"This rule defaults to ``rule:admin_api`` and hence only admins by default will"},{"line_number":165,"context_line":"be able to create servers even if they have servers in the down cells at the"},{"line_number":166,"context_line":"risk of wrong quota calculation/overcommitment on allowed quota. Normal users"},{"line_number":167,"context_line":"will be blocked from server creation unless the rule is changed to state"},{"line_number":168,"context_line":"otherwise."},{"line_number":169,"context_line":"\"\"\","},{"line_number":170,"context_line":"        ["}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_93d93382","line":167,"range":{"start_line":167,"start_character":67,"end_line":167,"end_character":72},"updated":"2018-11-08 16:06:57.000000000","message":"allow","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f3a4d61d62c4895d8fdd2f8a480043205a68fcca","unresolved":false,"context_lines":[{"line_number":164,"context_line":"This rule defaults to ``rule:admin_api`` and hence only admins by default will"},{"line_number":165,"context_line":"be able to create servers even if they have servers in the down cells at the"},{"line_number":166,"context_line":"risk of wrong quota calculation/overcommitment on allowed quota. Normal users"},{"line_number":167,"context_line":"will be blocked from server creation unless the rule is changed to state"},{"line_number":168,"context_line":"otherwise."},{"line_number":169,"context_line":"\"\"\","},{"line_number":170,"context_line":"        ["}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_62f7582a","line":167,"range":{"start_line":167,"start_character":67,"end_line":167,"end_character":72},"in_reply_to":"3f79a3b5_93d93382","updated":"2018-11-19 10:24:31.000000000","message":"Done","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"7da4dff83af8f62b0dcb494d4766f3de931cc112","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            }"},{"line_number":154,"context_line":"        ]),"},{"line_number":155,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating or resizing"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_9b3e88b4","line":156,"range":{"start_line":156,"start_character":7,"end_line":156,"end_character":37},"updated":"2018-11-20 11:44:55.000000000","message":"we recently added consistent naming thing in oslo policy [1] which are also proposed in nova polciy change spec[2]. \n\nCan we make this new policy with considering to consistent naming so that we do not end up changing this policy. \n\ncurrent name become like- os_compute_api:servers:create:cell_down\n\nas per consisten naming suggestion, How about: \ncompute:server:create:cell_down\n\n[1] https://docs.openstack.org/oslo.policy/latest/user/usage.html#naming-policies\n\n[2] https://review.openstack.org/#/c/547850/","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"5bbf83e579344329f91cd750be1481138e1e25ea","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            }"},{"line_number":154,"context_line":"        ]),"},{"line_number":155,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating or resizing"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_9f63adde","line":156,"range":{"start_line":156,"start_character":7,"end_line":156,"end_character":37},"in_reply_to":"3f79a3b5_161ecd5d","updated":"2018-11-22 09:50:45.000000000","message":"that is the plan in my spec 547850 but it is in proposal state.","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"1bed841b17ead8be7a932f5d565102b6a9698483","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            }"},{"line_number":154,"context_line":"        ]),"},{"line_number":155,"context_line":"    policy.DocumentedRuleDefault("},{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating or resizing"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_161ecd5d","line":156,"range":{"start_line":156,"start_character":7,"end_line":156,"end_character":37},"in_reply_to":"3f79a3b5_9b3e88b4","updated":"2018-11-20 12:39:22.000000000","message":"I don\u0027t have a problem with the style change at all. I was just following the suite of existing policies. Does this mean the other policies will be changed to make them adaptable to the new naming scheme ?","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"7da4dff83af8f62b0dcb494d4766f3de931cc112","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating or resizing"},{"line_number":160,"context_line":"a server when the requesting tenant already has other active servers in down"},{"line_number":161,"context_line":"cells whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_9b852856","line":159,"range":{"start_line":159,"start_character":70,"end_line":159,"end_character":78},"updated":"2018-11-20 11:44:55.000000000","message":"is this for resize also ? if so then we should think about naming in different way. we have not thought the case where policy is enfoirced for more than one action or resource.","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"5bbf83e579344329f91cd750be1481138e1e25ea","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating or resizing"},{"line_number":160,"context_line":"a server when the requesting tenant already has other active servers in down"},{"line_number":161,"context_line":"cells whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_6afa9112","line":159,"range":{"start_line":159,"start_character":70,"end_line":159,"end_character":78},"in_reply_to":"3f79a3b5_5b16b059","updated":"2018-11-22 09:50:45.000000000","message":"humm. not exactly in my mind as of now. let\u0027s wait for the final decision on this patch as you mentioned it can be abandon.","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"1bed841b17ead8be7a932f5d565102b6a9698483","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        SERVERS % \u0027create:cell_down\u0027,"},{"line_number":157,"context_line":"        base.RULE_ADMIN_API,"},{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"This rule controls the compute API validation behavior of creating or resizing"},{"line_number":160,"context_line":"a server when the requesting tenant already has other active servers in down"},{"line_number":161,"context_line":"cells whose quota cannot be correctly obtained and would be skipped, thus later"},{"line_number":162,"context_line":"leading to plausible overcommit scenario."}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_5b16b059","line":159,"range":{"start_line":159,"start_character":70,"end_line":159,"end_character":78},"in_reply_to":"3f79a3b5_9b852856","updated":"2018-11-20 12:39:22.000000000","message":"yea any suggestions for a generic one that includes resize and create ?","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"}],"nova/quota.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                    count \u003d resource.count_as_dict(context, project_id)"},{"line_number":178,"context_line":"                    key \u003d \u0027project\u0027"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    # NOTE(melwitt): This assumes a specific signature for"},{"line_number":181,"context_line":"                    # count_as_dict(). Usages used to be records in the"},{"line_number":182,"context_line":"                    # database but now we are counting resources. The"},{"line_number":183,"context_line":"                    # count_as_dict() function signature needs to match this"},{"line_number":184,"context_line":"                    # call, else it should get a conditional in this function."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b31d4f11","line":181,"range":{"start_line":180,"start_character":20,"end_line":181,"end_character":38},"updated":"2018-11-08 16:06:57.000000000","message":"I think this is why tests are failing, you\u0027re breaking the signature contract.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        function, which will be called to determine the current counts"},{"line_number":827,"context_line":"        of the resource."},{"line_number":828,"context_line":""},{"line_number":829,"context_line":"        The counting function will be passed the context, along with"},{"line_number":830,"context_line":"        the extra positional and keyword arguments that are passed to"},{"line_number":831,"context_line":"        Quota.count_as_dict().  It should return a dict specifying the"},{"line_number":832,"context_line":"        count scoped to a project and/or a user."},{"line_number":833,"context_line":""},{"line_number":834,"context_line":"        Example count of instances, cores, or ram returned as a rollup"},{"line_number":835,"context_line":"        of all the resources since we only want to query the instances"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b3e22f01","line":832,"range":{"start_line":829,"start_character":8,"end_line":832,"end_character":48},"updated":"2018-11-08 16:06:57.000000000","message":"This is where you might want to note the special \"cell_down_support\" kwarg that some counting functions may receive and what it means.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":977,"context_line":"                                                project_id,"},{"line_number":978,"context_line":"                                                user_id\u003duser_id)"},{"line_number":979,"context_line":""},{"line_number":980,"context_line":"    def count_as_dict(self, context, resource, cell_down_support\u003dFalse,"},{"line_number":981,"context_line":"                      *args, **kwargs):"},{"line_number":982,"context_line":"        \"\"\"Count a resource and return a dict."},{"line_number":983,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_33ce1fb7","line":980,"range":{"start_line":980,"start_character":47,"end_line":980,"end_character":64},"updated":"2018-11-08 16:06:57.000000000","message":"Document this in the docstring.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":1001,"context_line":"        if not res or not hasattr(res, \u0027count_as_dict\u0027):"},{"line_number":1002,"context_line":"            raise exception.QuotaResourceUnknown(unknown\u003d[resource])"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"        return res.count_as_dict(context, cell_down_support, *args, **kwargs)"},{"line_number":1005,"context_line":""},{"line_number":1006,"context_line":"    # TODO(melwitt): This can be removed once no old code can call"},{"line_number":1007,"context_line":"    # limit_check(). It will be replaced with limit_check_project_and_user()."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_5304fbc4","line":1004,"range":{"start_line":1004,"start_character":42,"end_line":1004,"end_character":59},"updated":"2018-11-08 16:06:57.000000000","message":"I think you need to pass this through as a kwarg.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"07b640e9d45688556a8143dba4fbba48b5a078ef","unresolved":false,"context_lines":[{"line_number":1119,"context_line":"                objects.InstanceList.get_by_filters, cctxt, filters,"},{"line_number":1120,"context_line":"                expected_attrs\u003d[]))"},{"line_number":1121,"context_line":"    instances \u003d objects.InstanceList(objects\u003d[])"},{"line_number":1122,"context_line":"    for greenthread in greenthreads:"},{"line_number":1123,"context_line":"        found \u003d greenthread.wait()"},{"line_number":1124,"context_line":"        instances \u003d instances + found"},{"line_number":1125,"context_line":"    # Count build requests using the same filters to catch group members"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_c9d9da55","line":1122,"updated":"2018-11-15 09:50:59.000000000","message":"I\u0027d think we\u0027d have the same down cell issues here, but we\u0027re not using the scatter/gather utility so we\u0027re not dealing with those failures. Probably worth a TODO to handle down cells here as well.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f3a4d61d62c4895d8fdd2f8a480043205a68fcca","unresolved":false,"context_lines":[{"line_number":1119,"context_line":"                objects.InstanceList.get_by_filters, cctxt, filters,"},{"line_number":1120,"context_line":"                expected_attrs\u003d[]))"},{"line_number":1121,"context_line":"    instances \u003d objects.InstanceList(objects\u003d[])"},{"line_number":1122,"context_line":"    for greenthread in greenthreads:"},{"line_number":1123,"context_line":"        found \u003d greenthread.wait()"},{"line_number":1124,"context_line":"        instances \u003d instances + found"},{"line_number":1125,"context_line":"    # Count build requests using the same filters to catch group members"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_42949c35","line":1122,"in_reply_to":"3f79a3b5_09b592cf","updated":"2018-11-19 10:24:31.000000000","message":"right, I\u0027ll add a TODO/ or just change this to using scatter-gather.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"219a3e10422473300214345d5af01ad41d0312ad","unresolved":false,"context_lines":[{"line_number":1119,"context_line":"                objects.InstanceList.get_by_filters, cctxt, filters,"},{"line_number":1120,"context_line":"                expected_attrs\u003d[]))"},{"line_number":1121,"context_line":"    instances \u003d objects.InstanceList(objects\u003d[])"},{"line_number":1122,"context_line":"    for greenthread in greenthreads:"},{"line_number":1123,"context_line":"        found \u003d greenthread.wait()"},{"line_number":1124,"context_line":"        instances \u003d instances + found"},{"line_number":1125,"context_line":"    # Count build requests using the same filters to catch group members"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_09b592cf","line":1122,"in_reply_to":"3f79a3b5_c9d9da55","updated":"2018-11-15 10:00:51.000000000","message":"Good catch, this is somewhere we need to be resilient to down cells too.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"    return {\u0027project\u0027: {\u0027floating_ips\u0027: count}}"},{"line_number":1151,"context_line":""},{"line_number":1152,"context_line":""},{"line_number":1153,"context_line":"def _instances_cores_ram_count(context, cell_down_support, project_id, user_id\u003dNone,):"},{"line_number":1154,"context_line":"    \"\"\"Get the counts of instances, cores, and ram in the database."},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"    :param context: The request context for database access"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_d341eb09","line":1153,"range":{"start_line":1153,"start_character":40,"end_line":1153,"end_character":57},"updated":"2018-11-08 16:06:57.000000000","message":"docstring for this param\n\nAlso, this is blowing up several things because this is supposed to have a specific signature. I think what you\u0027ll probably need to do is pass this through as a kwarg instead of a required argument.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b1d613a1b319c06aa3c65b302e8e46274b7b734","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"    # TODO(melwitt): In the future, we should query placement for cores/ram"},{"line_number":1170,"context_line":"    # and InstanceMappings for instances."},{"line_number":1171,"context_line":"    # NOTE(tssurya): We only go into those cells in which the tenant has"},{"line_number":1172,"context_line":"    # instances if CONF.api.instance_list_per_project_cells is True and"},{"line_number":1173,"context_line":"    # as a part of the handling-down-cell blueprint, we"},{"line_number":1174,"context_line":"    # also introduce a policy check in the new microversion for (dis-)allowing"},{"line_number":1175,"context_line":"    # server creation if the tenant already has active instances in the down"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_9347f31b","line":1172,"range":{"start_line":1172,"start_character":68,"end_line":1172,"end_character":71},"updated":"2018-11-08 16:06:57.000000000","message":"nit: rather than create a run-on sentence, just make the down-cell policy thing a new sentence, i.e. \"As a part of the handling-down-cell blueprint, ...\".","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3831b51042561897b1430685a527a1afed610b85","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"            if user_id:"},{"line_number":1195,"context_line":"                for resource, count in result[\u0027user\u0027].items():"},{"line_number":1196,"context_line":"                    total_counts[\u0027user\u0027][resource] +\u003d count"},{"line_number":1197,"context_line":"        elif cell_down_support:"},{"line_number":1198,"context_line":"            # TODO(mriedem): Optimize this policy check to only do it once"},{"line_number":1199,"context_line":"            # in the for loop in case there are multiple down cells."},{"line_number":1200,"context_line":"            context.can(servers_policies.SERVERS % \u0027create:cell_down\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_63afac7f","line":1197,"range":{"start_line":1197,"start_character":13,"end_line":1197,"end_character":30},"updated":"2018-11-13 08:25:11.000000000","message":"According to the spec:\n\nhttps://specs.openstack.org/openstack/nova-specs/specs/stein/approved/handling-down-cell_new.html#proposed-change\n\nIf the tenant has instances in a down cell we should fail the server create unless policy passes, correct? I don\u0027t see the failure / error logic in this change.\n\nI also wonder if we are only going to enforce that with the microversion. It seems wrong to make people opt into not cheating their quota limits. Probably something we need to discuss, but I\u0027d think once we have the policy rule and support for handling down cells during the quota check, we should change the behavior, regardless of microversion, to fail server create/resize if the tenant has instances in a down cell and they don\u0027t pass the policy check. Yes it would be an upgrade impacting behavior change, but it\u0027s also a safety measure for multi-cell deployments.\n\nAlso, I think I now realize what you were trying to ask me in IRC about the policy / microversion question; sorry I didn\u0027t fully grasp what you were asking. I think we can probably ignore the microversion for the down-cell quota check since quota checks can fail at any time and this is really fixing a bug / adding a safety measure for multi-cell operations. I will ask the question during the cells v2 session at the summit:\n\nhttps://etherpad.openstack.org/p/BER-cells-v2-updates\n\nBut I think we can ignore microversion for this, which will also make this change a lot simpler since you won\u0027t have to pass that flag down the stack.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce9554d2d0545053cbcc57a5500035c12433d6a0","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"            if user_id:"},{"line_number":1195,"context_line":"                for resource, count in result[\u0027user\u0027].items():"},{"line_number":1196,"context_line":"                    total_counts[\u0027user\u0027][resource] +\u003d count"},{"line_number":1197,"context_line":"        elif cell_down_support:"},{"line_number":1198,"context_line":"            # TODO(mriedem): Optimize this policy check to only do it once"},{"line_number":1199,"context_line":"            # in the for loop in case there are multiple down cells."},{"line_number":1200,"context_line":"            context.can(servers_policies.SERVERS % \u0027create:cell_down\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_c84c4d99","line":1197,"range":{"start_line":1197,"start_character":13,"end_line":1197,"end_character":30},"in_reply_to":"3f79a3b5_227c0021","updated":"2018-11-19 13:02:17.000000000","message":"\u003e well if at the quota check the context.can logic fails the policy will prevent server creation... right ? At least that\u0027s what I saw on devstack..\n\nYeah I forgot that fatal\u003dTrue in context.can so we\u0027d raise Forbidden if the policy check fails.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"f3a4d61d62c4895d8fdd2f8a480043205a68fcca","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"            if user_id:"},{"line_number":1195,"context_line":"                for resource, count in result[\u0027user\u0027].items():"},{"line_number":1196,"context_line":"                    total_counts[\u0027user\u0027][resource] +\u003d count"},{"line_number":1197,"context_line":"        elif cell_down_support:"},{"line_number":1198,"context_line":"            # TODO(mriedem): Optimize this policy check to only do it once"},{"line_number":1199,"context_line":"            # in the for loop in case there are multiple down cells."},{"line_number":1200,"context_line":"            context.can(servers_policies.SERVERS % \u0027create:cell_down\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_227c0021","line":1197,"range":{"start_line":1197,"start_character":13,"end_line":1197,"end_character":30},"in_reply_to":"3f79a3b5_63afac7f","updated":"2018-11-19 10:24:31.000000000","message":"\u003e According to the spec:\n \u003e \n \u003e https://specs.openstack.org/openstack/nova-specs/specs/stein/approved/handling-down-cell_new.html#proposed-change\n \u003e \n \u003e If the tenant has instances in a down cell we should fail the\n \u003e server create unless policy passes, correct? I don\u0027t see the\n \u003e failure / error logic in this change.\n\nwell if at the quota check the context.can logic fails the policy will prevent server creation... right ? At least that\u0027s what I saw on devstack..\n\n \u003e \n \u003e I also wonder if we are only going to enforce that with the\n \u003e microversion. It seems wrong to make people opt into not cheating\n \u003e their quota limits. Probably something we need to discuss, but I\u0027d\n \u003e think once we have the policy rule and support for handling down\n \u003e cells during the quota check, we should change the behavior,\n \u003e regardless of microversion, to fail server create/resize if the\n \u003e tenant has instances in a down cell and they don\u0027t pass the policy\n \u003e check. Yes it would be an upgrade impacting behavior change, but\n \u003e it\u0027s also a safety measure for multi-cell deployments.\n \u003e \n \u003e Also, I think I now realize what you were trying to ask me in IRC\n \u003e about the policy / microversion question; sorry I didn\u0027t fully\n \u003e grasp what you were asking. I think we can probably ignore the\n \u003e microversion for the down-cell quota check since quota checks can\n \u003e fail at any time and this is really fixing a bug / adding a safety\n \u003e measure for multi-cell operations. I will ask the question during\n \u003e the cells v2 session at the summit:\n \u003e \n \u003e https://etherpad.openstack.org/p/BER-cells-v2-updates\n \u003e \n \u003e But I think we can ignore microversion for this, which will also\n \u003e make this change a lot simpler since you won\u0027t have to pass that\n \u003e flag down the stack.\n\nFor me, its totally fine to not include this in the new microversion. The policy could be introduced without the microversion and it would make the change simpler. Also looks like this was agreed during the Berlin summit forum session.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"11948d0c872064b4a748c57f344e2e51332b262f","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"            if user_id:"},{"line_number":1195,"context_line":"                for resource, count in result[\u0027user\u0027].items():"},{"line_number":1196,"context_line":"                    total_counts[\u0027user\u0027][resource] +\u003d count"},{"line_number":1197,"context_line":"        elif cell_down_support:"},{"line_number":1198,"context_line":"            # TODO(mriedem): Optimize this policy check to only do it once"},{"line_number":1199,"context_line":"            # in the for loop in case there are multiple down cells."},{"line_number":1200,"context_line":"            context.can(servers_policies.SERVERS % \u0027create:cell_down\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a342523b","line":1197,"range":{"start_line":1197,"start_character":13,"end_line":1197,"end_character":30},"in_reply_to":"3f79a3b5_c84c4d99","updated":"2018-11-19 13:14:01.000000000","message":"right, which is also why we don\u0027t need to do the following optimization. I think if the first time it fails, the exception will be raised and hence will not go back into the loop - meaning it won\u0027t check multiple times if there are multiple cells which are down.","commit_id":"ffc7d694de1aca84e46de3b4dfbc19d056aacf90"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"7da4dff83af8f62b0dcb494d4766f3de931cc112","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"            if user_id:"},{"line_number":1194,"context_line":"                for resource, count in result[\u0027user\u0027].items():"},{"line_number":1195,"context_line":"                    total_counts[\u0027user\u0027][resource] +\u003d count"},{"line_number":1196,"context_line":"        else:"},{"line_number":1197,"context_line":"            context.can(servers_policies.SERVERS % \u0027create:cell_down\u0027)"},{"line_number":1198,"context_line":"    return total_counts"},{"line_number":1199,"context_line":""},{"line_number":1200,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_7b8a8c65","line":1197,"range":{"start_line":1196,"start_character":0,"end_line":1197,"end_character":70},"updated":"2018-11-20 11:44:55.000000000","message":"as you know, all the policy enforment have been moved on API controller layer side long back. Can we move this check also on API controller side, with passing that info down till here? Not sure how easy that will be, thought ?\n\nspreading policy enforcement all over the code make it hard to maintain and it can eaisly end up enforcing this policy for other APIs also.","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"1bed841b17ead8be7a932f5d565102b6a9698483","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"            if user_id:"},{"line_number":1194,"context_line":"                for resource, count in result[\u0027user\u0027].items():"},{"line_number":1195,"context_line":"                    total_counts[\u0027user\u0027][resource] +\u003d count"},{"line_number":1196,"context_line":"        else:"},{"line_number":1197,"context_line":"            context.can(servers_policies.SERVERS % \u0027create:cell_down\u0027)"},{"line_number":1198,"context_line":"    return total_counts"},{"line_number":1199,"context_line":""},{"line_number":1200,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_5697659c","line":1197,"range":{"start_line":1196,"start_character":0,"end_line":1197,"end_character":70},"in_reply_to":"3f79a3b5_7b8a8c65","updated":"2018-11-20 12:39:22.000000000","message":"\u003e as you know, all the policy enforment have been moved on API\n \u003e controller layer side long back. Can we move this check also on API\n \u003e controller side, with passing that info down till here? Not sure\n \u003e how easy that will be, thought ?\n \u003e \n \u003e spreading policy enforcement all over the code make it hard to\n \u003e maintain and it can eaisly end up enforcing this policy for other\n \u003e APIs also.\n\nhmm yea you have a point, to have the policy check in the API layer, I would have to change the structure of the returning part to include the down_cell_uuids or something upto the top layers. \n\nAnyways from the mailing list perspective I see that melwitt thinks this could be abandoned if the quotas from placement works out this cycle. So I\u0027ll first push the API test patch for the new microversion above this first and wait on this patch for a bit to see the progress of the placement quota spec.","commit_id":"d6172354e1e02d37bfcf37c0748a0dba0f7bd685"}],"nova/tests/unit/test_quota.py":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"ad3cd64947cf50a8534f12ae28a50fa0da2aeeb1","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        self.assertEqual(1, inst[0][0].vcpus)"},{"line_number":175,"context_line":"        # server creation from non-admin will be blocked if a cell in which"},{"line_number":176,"context_line":"        # the tenant has instances is down unless the policy allows it."},{"line_number":177,"context_line":"        self.assertEqual"},{"line_number":178,"context_line":"        self.user_id \u003d \u0027demo\u0027"},{"line_number":179,"context_line":"        self.project_id \u003d \u0027demo\u0027"},{"line_number":180,"context_line":"        self.context \u003d context.RequestContext(self.user_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_c3474e1b","line":177,"range":{"start_line":177,"start_character":8,"end_line":177,"end_character":24},"updated":"2018-11-19 13:26:40.000000000","message":"eesh","commit_id":"5df0a82190310dccd79168e059235c23a2c4f3dc"}]}
