)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When extending a volume in a THIN pool, Cinder has no checks of wether the new"},{"line_number":10,"context_line":"allocated space is provisioned by the backend. This allow a tenant, with enough"},{"line_number":11,"context_line":"quota space to extend the volume to a size much higher than the provisioned"},{"line_number":12,"context_line":"space reported byt the backend.  So, before extending a volume, Cinder manager"},{"line_number":13,"context_line":"should check this and make sure to fail such kind od requests."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I1b4db7753d2f9ac383cdd02385186bce2d7c0143"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_bfa5cda2","line":12,"updated":"2016-07-13 03:51:38.000000000","message":"Line should have \u003c\u003d 72 characters.","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When extending a volume in a THIN pool, Cinder has no checks of wether the new"},{"line_number":10,"context_line":"allocated space is provisioned by the backend. This allow a tenant, with enough"},{"line_number":11,"context_line":"quota space to extend the volume to a size much higher than the provisioned"},{"line_number":12,"context_line":"space reported byt the backend.  So, before extending a volume, Cinder manager"},{"line_number":13,"context_line":"should check this and make sure to fail such kind od requests."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I1b4db7753d2f9ac383cdd02385186bce2d7c0143"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_f932be0e","line":12,"in_reply_to":"1aa78d24_bfa5cda2","updated":"2016-07-18 16:56:01.000000000","message":"Done","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":10,"context_line":"allocated space is provisioned by the backend. This allow a tenant, with enough"},{"line_number":11,"context_line":"quota space to extend the volume to a size much higher than the provisioned"},{"line_number":12,"context_line":"space reported byt the backend.  So, before extending a volume, Cinder manager"},{"line_number":13,"context_line":"should check this and make sure to fail such kind od requests."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I1b4db7753d2f9ac383cdd02385186bce2d7c0143"},{"line_number":16,"context_line":"Closes-bug: #1539112"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_1fbb41c5","line":13,"updated":"2016-07-13 03:51:38.000000000","message":"s/od/of","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"allocated space is provisioned by the backend. This allow a tenant, with enough"},{"line_number":11,"context_line":"quota space to extend the volume to a size much higher than the provisioned"},{"line_number":12,"context_line":"space reported byt the backend.  So, before extending a volume, Cinder manager"},{"line_number":13,"context_line":"should check this and make sure to fail such kind od requests."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I1b4db7753d2f9ac383cdd02385186bce2d7c0143"},{"line_number":16,"context_line":"Closes-bug: #1539112"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_d93542f7","line":13,"in_reply_to":"1aa78d24_1fbb41c5","updated":"2016-07-18 16:56:01.000000000","message":"Done","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":16883,"name":"huyang","email":"huyang1@huawei.com","username":"huyang"},"change_message_id":"be3b7a20fecb70d40f2dad46b0aa586146d3ad4c","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix extend volume doesn\u0027t check capacity"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When extending a volume in a THIN pool, Cinder has no checks of wether"},{"line_number":10,"context_line":"the new allocated space is provisioned by the backend. This allow a"},{"line_number":11,"context_line":"tenant, with enough quota space to extend the volume to a size much"},{"line_number":12,"context_line":"higher than the provisioned space reported byt the backend.  So, before"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_e66805bd","line":9,"range":{"start_line":9,"start_character":64,"end_line":9,"end_character":70},"updated":"2016-07-19 01:10:39.000000000","message":"s/wether/whether?","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"cac3f207906cbba96a8331080ee140d704527728","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix extend volume doesn\u0027t check capacity"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When extending a volume in a THIN pool, Cinder has no checks of wether"},{"line_number":10,"context_line":"the new allocated space is provisioned by the backend. This allow a"},{"line_number":11,"context_line":"tenant, with enough quota space to extend the volume to a size much"},{"line_number":12,"context_line":"higher than the provisioned space reported byt the backend.  So, before"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_2e7dbd1c","line":9,"range":{"start_line":9,"start_character":64,"end_line":9,"end_character":70},"in_reply_to":"dada55a8_e66805bd","updated":"2016-07-26 12:48:57.000000000","message":"Done","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":16883,"name":"huyang","email":"huyang1@huawei.com","username":"huyang"},"change_message_id":"be3b7a20fecb70d40f2dad46b0aa586146d3ad4c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When extending a volume in a THIN pool, Cinder has no checks of wether"},{"line_number":10,"context_line":"the new allocated space is provisioned by the backend. This allow a"},{"line_number":11,"context_line":"tenant, with enough quota space to extend the volume to a size much"},{"line_number":12,"context_line":"higher than the provisioned space reported byt the backend.  So, before"},{"line_number":13,"context_line":"extending a volume, Cinder manager should check this and make sure to"},{"line_number":14,"context_line":"fail such kind of requests."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_0660b9cd","line":12,"range":{"start_line":12,"start_character":43,"end_line":12,"end_character":46},"updated":"2016-07-19 01:10:39.000000000","message":"s/byt/by","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"cac3f207906cbba96a8331080ee140d704527728","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When extending a volume in a THIN pool, Cinder has no checks of wether"},{"line_number":10,"context_line":"the new allocated space is provisioned by the backend. This allow a"},{"line_number":11,"context_line":"tenant, with enough quota space to extend the volume to a size much"},{"line_number":12,"context_line":"higher than the provisioned space reported byt the backend.  So, before"},{"line_number":13,"context_line":"extending a volume, Cinder manager should check this and make sure to"},{"line_number":14,"context_line":"fail such kind of requests."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_6e77b53a","line":12,"range":{"start_line":12,"start_character":43,"end_line":12,"end_character":46},"in_reply_to":"dada55a8_0660b9cd","updated":"2016-07-26 12:48:57.000000000","message":"Done","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"}],"cinder/volume/manager.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":2037,"context_line":"        pool \u003d self._get_pool(pool_name)"},{"line_number":2038,"context_line":"        # Makes sure that the extended volume won\u0027t cosume more than"},{"line_number":2039,"context_line":"        # what the backend has provisioned"},{"line_number":2040,"context_line":"        if pool is not None:"},{"line_number":2041,"context_line":"            try:"},{"line_number":2042,"context_line":"                thin_support \u003d pool[\u0027thin_provisioning_support\u0027]"},{"line_number":2043,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_dfe09928","line":2040,"updated":"2016-07-13 03:51:38.000000000","message":"If driver doesn\u0027t support multiple pools, we still need to make sure extend doesn\u0027t go beyond the backend\u0027s capacity.","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":2037,"context_line":"        pool \u003d self._get_pool(pool_name)"},{"line_number":2038,"context_line":"        # Makes sure that the extended volume won\u0027t cosume more than"},{"line_number":2039,"context_line":"        # what the backend has provisioned"},{"line_number":2040,"context_line":"        if pool is not None:"},{"line_number":2041,"context_line":"            try:"},{"line_number":2042,"context_line":"                thin_support \u003d pool[\u0027thin_provisioning_support\u0027]"},{"line_number":2043,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_eb2c69ad","line":2040,"in_reply_to":"1aa78d24_dfe09928","updated":"2016-07-18 16:56:01.000000000","message":"Done","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"4df054aa4cbc6110792cfa6532c218d55471cf38","unresolved":false,"context_lines":[{"line_number":2039,"context_line":"        # what the backend has provisioned"},{"line_number":2040,"context_line":"        if pool is not None:"},{"line_number":2041,"context_line":"            try:"},{"line_number":2042,"context_line":"                thin_support \u003d pool[\u0027thin_provisioning_support\u0027]"},{"line_number":2043,"context_line":"            except KeyError:"},{"line_number":2044,"context_line":"                thin_support \u003d False"},{"line_number":2045,"context_line":"            if thin_support:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_bf04ad49","line":2042,"updated":"2016-07-13 03:56:59.000000000","message":"Another thing I want to mention is that some drivers report both thin_provisioning_support\u003dTrue and thick_provisioning_support\u003dTrue because a pool can provision both thin and thick luns.  In that case if the user wants to create a thick lun, this change will wrongly use the logic to evaluate for thin provisioning.  \nI proposed a spec to partially fix this issue in the scheduler using volume type extra specs:\nhttps://review.openstack.org/#/c/332488/","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":2039,"context_line":"        # what the backend has provisioned"},{"line_number":2040,"context_line":"        if pool is not None:"},{"line_number":2041,"context_line":"            try:"},{"line_number":2042,"context_line":"                thin_support \u003d pool[\u0027thin_provisioning_support\u0027]"},{"line_number":2043,"context_line":"            except KeyError:"},{"line_number":2044,"context_line":"                thin_support \u003d False"},{"line_number":2045,"context_line":"            if thin_support:"}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_cb0c0545","line":2042,"in_reply_to":"1aa78d24_bf04ad49","updated":"2016-07-18 16:56:01.000000000","message":"Done","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":2050,"context_line":"                capacity \u003d float(pool[\u0027total_capacity_gb\u0027])"},{"line_number":2051,"context_line":"                used \u003d capacity - float(pool[\u0027free_capacity_gb\u0027])"},{"line_number":2052,"context_line":"                reserved_size \u003d (capacity * reserved_per / 100)"},{"line_number":2053,"context_line":"                prov_ratio \u003d ((used + reserved_size + new_size) / capacity)"},{"line_number":2054,"context_line":""},{"line_number":2055,"context_line":"                if prov_ratio \u003e max_osr:"},{"line_number":2056,"context_line":"                    msg_info \u003d {\"provisioned_ratio\": prov_ratio,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_7fb24507","line":2053,"updated":"2016-07-13 03:51:38.000000000","message":"Should be:\n\nprov_ratio \u003d (provisioned_capacity_gb+new_size)/capacity\n\nThe problem is some drivers don\u0027t report provisioned_capacity_gb but reports thin_provisioning_support\u003dTrue. At least I spotted a few during code reviews.  Not sure if I missed any.\n\n\"total-free\" is the actual capacity used, not the same as provisioned_capacity which is the virtual capacity.","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":2050,"context_line":"                capacity \u003d float(pool[\u0027total_capacity_gb\u0027])"},{"line_number":2051,"context_line":"                used \u003d capacity - float(pool[\u0027free_capacity_gb\u0027])"},{"line_number":2052,"context_line":"                reserved_size \u003d (capacity * reserved_per / 100)"},{"line_number":2053,"context_line":"                prov_ratio \u003d ((used + reserved_size + new_size) / capacity)"},{"line_number":2054,"context_line":""},{"line_number":2055,"context_line":"                if prov_ratio \u003e max_osr:"},{"line_number":2056,"context_line":"                    msg_info \u003d {\"provisioned_ratio\": prov_ratio,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_ea245961","line":2053,"in_reply_to":"1aa78d24_7fb24507","updated":"2016-07-18 16:56:01.000000000","message":"I shouldn\u0027t I consider the reserved_size in account?\nIndeed there are some drivers that report Thin but not provisioned_capacity_gb. Is it ok if I used the (total_size - total_free)? We need something.","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":2067,"context_line":"                        self.db.volume_update(context, volume.id,"},{"line_number":2068,"context_line":"                                              {\u0027status\u0027: \u0027available\u0027})"},{"line_number":2069,"context_line":"                    except exception.CinderException:"},{"line_number":2070,"context_line":"                        err_msg \u003d (_(\"Failed updating model with driver\""},{"line_number":2071,"context_line":"                                     \"provided model for volume %(id)s.\") %"},{"line_number":2072,"context_line":"                                   {\u0027id\u0027: volume.id})"},{"line_number":2073,"context_line":"                        LOG.error(err_msg)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_bf4dcd3f","line":2070,"updated":"2016-07-13 03:51:38.000000000","message":"Space missing at the end.","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":2067,"context_line":"                        self.db.volume_update(context, volume.id,"},{"line_number":2068,"context_line":"                                              {\u0027status\u0027: \u0027available\u0027})"},{"line_number":2069,"context_line":"                    except exception.CinderException:"},{"line_number":2070,"context_line":"                        err_msg \u003d (_(\"Failed updating model with driver\""},{"line_number":2071,"context_line":"                                     \"provided model for volume %(id)s.\") %"},{"line_number":2072,"context_line":"                                   {\u0027id\u0027: volume.id})"},{"line_number":2073,"context_line":"                        LOG.error(err_msg)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_6e0ec735","line":2070,"in_reply_to":"1aa78d24_bf4dcd3f","updated":"2016-07-18 16:56:01.000000000","message":"Done","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                          resource\u003dvolume)"},{"line_number":2087,"context_line":"            try:"},{"line_number":2088,"context_line":"                self.db.volume_update(context, volume.id,"},{"line_number":2089,"context_line":"                                      {\u0027status\u0027: \u0027available\u0027})"},{"line_number":2090,"context_line":"                raise exception.CinderException(_(\"Volume %s: Error trying \""},{"line_number":2091,"context_line":"                                                  \"to extend volume\") %"},{"line_number":2092,"context_line":"                                                volume.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_f4a81c22","line":2089,"updated":"2016-07-13 03:51:38.000000000","message":"Why changing from \u0027error_extending\u0027 or \u0027available\u0027?  I think the purpose to set it to \u0027error_extending\u0027 when an error occurred is for admin to check what happened to the volume and then admin and reset the status.","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"86eea275d605d3321dc4b244fa4e52c6ce7948e1","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                          resource\u003dvolume)"},{"line_number":2087,"context_line":"            try:"},{"line_number":2088,"context_line":"                self.db.volume_update(context, volume.id,"},{"line_number":2089,"context_line":"                                      {\u0027status\u0027: \u0027available\u0027})"},{"line_number":2090,"context_line":"                raise exception.CinderException(_(\"Volume %s: Error trying \""},{"line_number":2091,"context_line":"                                                  \"to extend volume\") %"},{"line_number":2092,"context_line":"                                                volume.id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"dada55a8_ce72537c","line":2089,"in_reply_to":"1aa78d24_f4a81c22","updated":"2016-07-18 16:56:01.000000000","message":"I did this on purpose to bring this question. It does not make sense in the user POV to try to extend a volume and get it unusable in case the operation fails. I don\u0027t remember when this was discussed. Was this a consensual decision?","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"ea123876347a7f687a931787101533c1eae2e9c0","unresolved":false,"context_lines":[{"line_number":2099,"context_line":"        volume.save()"},{"line_number":2100,"context_line":""},{"line_number":2101,"context_line":"        try:"},{"line_number":2102,"context_line":"            self.stats[\u0027pools\u0027][pool_name][\u0027allocated_capacity_gb\u0027] +\u003d\\"},{"line_number":2103,"context_line":"                size_increase"},{"line_number":2104,"context_line":"        except KeyError:"},{"line_number":2105,"context_line":"            self.stats[\u0027pools\u0027][pool_name] \u003d dict("}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_74426c69","line":2102,"updated":"2016-07-13 03:51:38.000000000","message":"Use () instead of \\","commit_id":"ba9b7059e71c4ce34c567e83043c7be7baf8459c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"91f1d402777179e3dc7dee64e8dd295c514e91e1","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                      extra_specs)"},{"line_number":2087,"context_line":"            # NOTE(erlon): If provisioning_type is set to thick, we use the"},{"line_number":2088,"context_line":"            # thick logic, otherwise, uses the thin logic."},{"line_number":2089,"context_line":"            if extra_specs.get(\u0027provisioning_type\u0027) \u003d\u003d \u0027\u003cis\u003e thick\u0027:"},{"line_number":2090,"context_line":"                reserved_space \u003d math.floor(total_capacity *"},{"line_number":2091,"context_line":"                                            (reserved_per / 100))"},{"line_number":2092,"context_line":"                if (total_free_capacity - reserved_space) \u003c new_size:"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_bfdecf6a","line":2089,"updated":"2016-07-26 03:09:33.000000000","message":"Look at my code patch.  The spec needs an update after the code is merged.  A \":\" is required for this key in extra specs for it to work properly.\n\nif extra_specs.get(\u0027provisioning:type\u0027) \u003d\u003d \u0027thick\u0027:\n\nhttps://review.openstack.org/#/c/315352/5/cinder/scheduler/filters/capacity_filter.py","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"cac3f207906cbba96a8331080ee140d704527728","unresolved":false,"context_lines":[{"line_number":2086,"context_line":"                      extra_specs)"},{"line_number":2087,"context_line":"            # NOTE(erlon): If provisioning_type is set to thick, we use the"},{"line_number":2088,"context_line":"            # thick logic, otherwise, uses the thin logic."},{"line_number":2089,"context_line":"            if extra_specs.get(\u0027provisioning_type\u0027) \u003d\u003d \u0027\u003cis\u003e thick\u0027:"},{"line_number":2090,"context_line":"                reserved_space \u003d math.floor(total_capacity *"},{"line_number":2091,"context_line":"                                            (reserved_per / 100))"},{"line_number":2092,"context_line":"                if (total_free_capacity - reserved_space) \u003c new_size:"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_69476abc","line":2089,"in_reply_to":"dada55a8_bfdecf6a","updated":"2016-07-26 12:48:57.000000000","message":"Done","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"91f1d402777179e3dc7dee64e8dd295c514e91e1","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"                            \"(%(free)s) on host %(host)s (%(reserved)s GB \""},{"line_number":2099,"context_line":"                            \"reserved.)\") % msg_info"},{"line_number":2100,"context_line":"                    _do_extend_rollback()"},{"line_number":2101,"context_line":"                    raise exception.ExtendVolumeError(msg)"},{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"                self._do_extend(context, volume_id, new_size,"},{"line_number":2104,"context_line":"                                reservations, volume)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_bcd25dfe","line":2101,"updated":"2016-07-26 03:09:33.000000000","message":"exception.ExtendVolumeError(reason\u003dmsg)","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"cac3f207906cbba96a8331080ee140d704527728","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"                            \"(%(free)s) on host %(host)s (%(reserved)s GB \""},{"line_number":2099,"context_line":"                            \"reserved.)\") % msg_info"},{"line_number":2100,"context_line":"                    _do_extend_rollback()"},{"line_number":2101,"context_line":"                    raise exception.ExtendVolumeError(msg)"},{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"                self._do_extend(context, volume_id, new_size,"},{"line_number":2104,"context_line":"                                reservations, volume)"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_f33ead89","line":2101,"in_reply_to":"dada55a8_bcd25dfe","updated":"2016-07-26 12:48:57.000000000","message":"Done","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"91f1d402777179e3dc7dee64e8dd295c514e91e1","unresolved":false,"context_lines":[{"line_number":2140,"context_line":"                        \"host %(host)s.\") % msg_info"},{"line_number":2141,"context_line":"                LOG.error(msg)"},{"line_number":2142,"context_line":"                _do_extend_rollback()"},{"line_number":2143,"context_line":"                raise exception.ExtendVolumeError(msg)"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"        # Defaults to standart behaviour assuming as thick."},{"line_number":2146,"context_line":"        avail_capacity \u003d (total_free_capacity -"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_7ce465df","line":2143,"updated":"2016-07-26 03:09:33.000000000","message":"exception.ExtendVolumeError(reason\u003dmsg)","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"cac3f207906cbba96a8331080ee140d704527728","unresolved":false,"context_lines":[{"line_number":2140,"context_line":"                        \"host %(host)s.\") % msg_info"},{"line_number":2141,"context_line":"                LOG.error(msg)"},{"line_number":2142,"context_line":"                _do_extend_rollback()"},{"line_number":2143,"context_line":"                raise exception.ExtendVolumeError(msg)"},{"line_number":2144,"context_line":""},{"line_number":2145,"context_line":"        # Defaults to standart behaviour assuming as thick."},{"line_number":2146,"context_line":"        avail_capacity \u003d (total_free_capacity -"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_d343a911","line":2143,"in_reply_to":"dada55a8_7ce465df","updated":"2016-07-26 12:48:57.000000000","message":"Done","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"91f1d402777179e3dc7dee64e8dd295c514e91e1","unresolved":false,"context_lines":[{"line_number":2152,"context_line":"                                                   \u0027avail\u0027: avail_capacity}"},{"line_number":2153,"context_line":"            LOG.error(msg)"},{"line_number":2154,"context_line":"            _do_extend_rollback()"},{"line_number":2155,"context_line":"            raise exception.ExtendVolumeError(msg)"},{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"        self._do_extend(context, volume_id, new_size, reservations, volume)"},{"line_number":2158,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_3c05cd79","line":2155,"updated":"2016-07-26 03:09:33.000000000","message":"exception.ExtendVolumeError(reason\u003dmsg)","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":10058,"name":"Erlon R. Cruz","email":"erlon.rodrigues.cruz@canonical.com","username":"sombrafam"},"change_message_id":"cac3f207906cbba96a8331080ee140d704527728","unresolved":false,"context_lines":[{"line_number":2152,"context_line":"                                                   \u0027avail\u0027: avail_capacity}"},{"line_number":2153,"context_line":"            LOG.error(msg)"},{"line_number":2154,"context_line":"            _do_extend_rollback()"},{"line_number":2155,"context_line":"            raise exception.ExtendVolumeError(msg)"},{"line_number":2156,"context_line":""},{"line_number":2157,"context_line":"        self._do_extend(context, volume_id, new_size, reservations, volume)"},{"line_number":2158,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_334de53e","line":2155,"in_reply_to":"dada55a8_3c05cd79","updated":"2016-07-26 12:48:57.000000000","message":"Done","commit_id":"4b52779eef8c41e24dd3006c7cd53f02bcf7988c"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"634f7fad142b4eae8af4f00edc3d40396e4f544c","unresolved":false,"context_lines":[{"line_number":2078,"context_line":"                    volume.host, \u0027pool\u0027, True)"},{"line_number":2079,"context_line":""},{"line_number":2080,"context_line":"        new_size \u003d int(new_size)"},{"line_number":2081,"context_line":"        driver_stats \u003d self.driver.get_volume_stats(refresh\u003dTrue)"},{"line_number":2082,"context_line":"        total_free_capacity \u003d self._get_host_stats(driver_stats,"},{"line_number":2083,"context_line":"                                                   \u0027free_capacity_gb\u0027,"},{"line_number":2084,"context_line":"                                                   pool_name)"},{"line_number":2085,"context_line":"        total_capacity \u003d self._get_host_stats(driver_stats,"},{"line_number":2086,"context_line":"                                              \u0027total_capacity_gb\u0027,"},{"line_number":2087,"context_line":"                                              pool_name)"},{"line_number":2088,"context_line":"        reserved_per \u003d self._get_host_stats(driver_stats,"},{"line_number":2089,"context_line":"                                            \u0027reserved_percentage\u0027,"},{"line_number":2090,"context_line":"                                            pool_name, 0)"},{"line_number":2091,"context_line":""},{"line_number":2092,"context_line":"        # If the host says there\u0027s no limits, we extend it to whatever the"},{"line_number":2093,"context_line":"        # request says."},{"line_number":2094,"context_line":"        if total_free_capacity in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":2095,"context_line":"            self._do_extend(context, volume_id, new_size, reservations, volume)"},{"line_number":2096,"context_line":"            return"},{"line_number":2097,"context_line":""},{"line_number":2098,"context_line":"        thin_support \u003d self._get_host_stats(driver_stats,"},{"line_number":2099,"context_line":"                                            \u0027thin_provisioning_support\u0027,"},{"line_number":2100,"context_line":"                                            pool_name)"},{"line_number":2101,"context_line":"        thick_support \u003d self._get_host_stats(driver_stats,"},{"line_number":2102,"context_line":"                                             \u0027thick_provisioning_support\u0027,"},{"line_number":2103,"context_line":"                                             pool_name)"},{"line_number":2104,"context_line":""},{"line_number":2105,"context_line":"        if thin_support and thick_support:"},{"line_number":2106,"context_line":"            vol_type \u003d volume.volume_type_id"},{"line_number":2107,"context_line":"            extra_specs \u003d volume_types.get_volume_type_extra_specs(vol_type)"},{"line_number":2108,"context_line":"            LOG.debug(\u0027Driver reports thin and thick. volume_specs: %s\u0027,"},{"line_number":2109,"context_line":"                      extra_specs)"},{"line_number":2110,"context_line":"            # NOTE(erlon): If provisioning_type is set to thick, we use the"},{"line_number":2111,"context_line":"            # thick logic, otherwise, uses the thin logic."},{"line_number":2112,"context_line":"            if extra_specs.get(\u0027provisioning:type\u0027) \u003d\u003d \u0027thick\u0027:"},{"line_number":2113,"context_line":"                reserved_space \u003d math.floor(total_capacity *"},{"line_number":2114,"context_line":"                                            (reserved_per / 100))"},{"line_number":2115,"context_line":"                if (total_free_capacity - reserved_space) \u003c new_size:"},{"line_number":2116,"context_line":"                    msg_info \u003d {\u0027size\u0027: new_size, \u0027free\u0027: total_free_capacity,"},{"line_number":2117,"context_line":"                                \u0027host\u0027: volume.host,"},{"line_number":2118,"context_line":"                                \u0027reserved\u0027: reserved_space}"},{"line_number":2119,"context_line":"                    msg \u003d _(\"Can\u0027t extend the volume as the new volume size \""},{"line_number":2120,"context_line":"                            \"%(size)s GB is bigger than the available space \""},{"line_number":2121,"context_line":"                            \"(%(free)s) on host %(host)s (%(reserved)s GB \""},{"line_number":2122,"context_line":"                            \"reserved.)\") % msg_info"},{"line_number":2123,"context_line":"                    _do_extend_rollback()"},{"line_number":2124,"context_line":"                    raise exception.ExtendVolumeError(reason\u003dmsg)"},{"line_number":2125,"context_line":""},{"line_number":2126,"context_line":"                self._do_extend(context, volume_id, new_size,"},{"line_number":2127,"context_line":"                                reservations, volume)"},{"line_number":2128,"context_line":"                return"},{"line_number":2129,"context_line":""},{"line_number":2130,"context_line":"        if thin_support:"},{"line_number":2131,"context_line":"            max_osr \u003d self._get_host_stats(driver_stats,"},{"line_number":2132,"context_line":"                                           \u0027max_over_subscription_ratio\u0027,"},{"line_number":2133,"context_line":"                                           pool_name, 20.0)"},{"line_number":2134,"context_line":"            prov_cap \u003d self._get_host_stats(driver_stats,"},{"line_number":2135,"context_line":"                                            \u0027provisioned_capacity_gb\u0027,"},{"line_number":2136,"context_line":"                                            pool_name)"},{"line_number":2137,"context_line":"            # Calculate how much free space is left after taking into account"},{"line_number":2138,"context_line":"            # the reserved space."},{"line_number":2139,"context_line":"            free \u003d (total_free_capacity -"},{"line_number":2140,"context_line":"                    math.floor(total_capacity * (reserved_per / 100)))"},{"line_number":2141,"context_line":"            adjusted_free_virtual \u003d free * max_osr"},{"line_number":2142,"context_line":""},{"line_number":2143,"context_line":"            # Some drivers do not set the provisioned_capacity_gb, so we need"},{"line_number":2144,"context_line":"            # something to decide if the volume will fit."},{"line_number":2145,"context_line":"            if not prov_cap:"},{"line_number":2146,"context_line":"                prov_cap \u003d total_capacity - total_free_capacity"},{"line_number":2147,"context_line":""},{"line_number":2148,"context_line":"            prov_ratio \u003d ((prov_cap + new_size) / total_capacity)"},{"line_number":2149,"context_line":""},{"line_number":2150,"context_line":"            # Makes sure that the extended volume won\u0027t cosume more than"},{"line_number":2151,"context_line":"            # what the backend has provisioned"},{"line_number":2152,"context_line":"            if prov_ratio \u003e max_osr or new_size \u003e adjusted_free_virtual:"},{"line_number":2153,"context_line":"                msg_info \u003d {\"provisioned_ratio\": prov_ratio,"},{"line_number":2154,"context_line":"                            \"oversub_ratio\": max_osr, \"nsz\": new_size,"},{"line_number":2155,"context_line":"                            \"free_virt\": adjusted_free_virtual,"},{"line_number":2156,"context_line":"                            \"host\": volume.host}"},{"line_number":2157,"context_line":"                msg \u003d _(\"Insufficient free space for thin provisioning. \""},{"line_number":2158,"context_line":"                        \"The ratio of provisioned capacity over total \""},{"line_number":2159,"context_line":"                        \"capacity %(provisioned_ratio).2f has exceeded \""},{"line_number":2160,"context_line":"                        \"the maximum over subscription ratio \""},{"line_number":2161,"context_line":"                        \"%(oversub_ratio).2f or the volume size (%(nsz)s) \""},{"line_number":2162,"context_line":"                        \"is bigger than the left space (%(free_virt)s) on \""},{"line_number":2163,"context_line":"                        \"host %(host)s.\") % msg_info"},{"line_number":2164,"context_line":"                LOG.error(msg)"},{"line_number":2165,"context_line":"                _do_extend_rollback()"},{"line_number":2166,"context_line":"                raise exception.ExtendVolumeError(reason\u003dmsg)"},{"line_number":2167,"context_line":""},{"line_number":2168,"context_line":"        # Defaults to standart behaviour assuming as thick."},{"line_number":2169,"context_line":"        avail_capacity \u003d (total_free_capacity -"},{"line_number":2170,"context_line":"                          total_capacity * reserved_per / 100)"},{"line_number":2171,"context_line":""},{"line_number":2172,"context_line":"        if new_size \u003e avail_capacity:"},{"line_number":2173,"context_line":"            msg \u003d _(\"Max capacity reached. Requested: %(sz)s GB, \""},{"line_number":2174,"context_line":"                    \"available: %(avail)s GB.\") % {\u0027sz\u0027: new_size,"},{"line_number":2175,"context_line":"                                                   \u0027avail\u0027: avail_capacity}"},{"line_number":2176,"context_line":"            LOG.error(msg)"},{"line_number":2177,"context_line":"            _do_extend_rollback()"},{"line_number":2178,"context_line":"            raise exception.ExtendVolumeError(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_428b2ec3","line":2175,"range":{"start_line":2081,"start_character":8,"end_line":2175,"end_character":75},"updated":"2016-08-29 18:41:24.000000000","message":"Almost seems like this should go through the scheduler to do this kind of check. Similar to the like create from snapshot and stuff where it hits the scheduler just to make sure the request can be accepted, not really to pick a backend. As-is we\u0027ve got the somewhat confusing (and bug prone) logic for thin provisioning in the volume manager *and* the capacity filter :(","commit_id":"abe291467731b9eced0ced6e715542a997268299"}]}
