)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"in Manila. This is similar to the same feature in Cinder."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I3e45ad23a83591bf16adff7f21c3ce19325e7e91"},{"line_number":13,"context_line":"partial-implements: blueprint oversubscription-in-thin-provisioning"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa32b979_f2715877","line":13,"updated":"2015-06-16 21:42:57.000000000","message":"Why partial?  Would it be good to mention in the above mention?","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f78c6dc8ad3beaafded1f99331f976ee4924b9a7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"in Manila. This is similar to the same feature in Cinder."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I3e45ad23a83591bf16adff7f21c3ce19325e7e91"},{"line_number":13,"context_line":"partial-implements: blueprint oversubscription-in-thin-provisioning"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa32b979_3b13695e","line":13,"in_reply_to":"fa32b979_f2715877","updated":"2015-06-21 19:48:54.000000000","message":"Because I need to change the generic driver to provide a reference implementation.  I should probably still mark this one as implements and mark the change for generic driver as partial, otherwise the bp will be open forever.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"}],"manila/scheduler/filters/capacity_filter.py":[{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"d5a21cc796f60e9166fb903bfa185dda98e9035f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class CapacityFilter(filters.BaseHostFilter):"},{"line_number":32,"context_line":"    \"\"\"CapacityFilter filters based on share host\u0027s capacity utilization.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def host_passes(self, host_state, filter_properties):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3bdb69ef","line":31,"updated":"2015-06-21 23:35:52.000000000","message":"You basically rewrote this class in this patch (no problem there!), but the unit test coverage fell from 90% to 81%.  Would you mind filling in some of those gaps, please?  It looks like the capacity filter tests are in test_host_filters.py, although they should probably be split out and moved into tests/scheduler/filters/test_capacity_filter.py.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class CapacityFilter(filters.BaseHostFilter):"},{"line_number":32,"context_line":"    \"\"\"CapacityFilter filters based on share host\u0027s capacity utilization.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def host_passes(self, host_state, filter_properties):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_5cb292e6","line":31,"in_reply_to":"fa32b979_3bdb69ef","updated":"2015-06-23 17:35:01.000000000","message":"Sure. Will add more unit tests.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            # also won\u0027t work. So the back-ends cannot serve the request."},{"line_number":60,"context_line":"            if reserved \u003d\u003d 0:"},{"line_number":61,"context_line":"                return True"},{"line_number":62,"context_line":"            return False"},{"line_number":63,"context_line":"        total \u003d float(total_space)"},{"line_number":64,"context_line":"        if total \u003c\u003d 0:"},{"line_number":65,"context_line":"            LOG.warning(_LW(\"Insufficient free space for share creation. \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_b5b97a17","line":62,"updated":"2015-06-16 21:42:57.000000000","message":"I would just \"return reserved \u003d\u003d 0\", but I guess it is better to let the code match the Cinder code.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            # also won\u0027t work. So the back-ends cannot serve the request."},{"line_number":60,"context_line":"            if reserved \u003d\u003d 0:"},{"line_number":61,"context_line":"                return True"},{"line_number":62,"context_line":"            return False"},{"line_number":63,"context_line":"        total \u003d float(total_space)"},{"line_number":64,"context_line":"        if total \u003c\u003d 0:"},{"line_number":65,"context_line":"            LOG.warning(_LW(\"Insufficient free space for share creation. \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_cc2ef38b","line":62,"in_reply_to":"fa32b979_b5b97a17","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            return False"},{"line_number":70,"context_line":"        # Calculate how much free space is left after taking into account"},{"line_number":71,"context_line":"        # the reserved space."},{"line_number":72,"context_line":"        free \u003d free_space - math.floor(total * reserved)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        msg_args \u003d {\"host\": host_state.host,"},{"line_number":75,"context_line":"                    \"requested\": share_size,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_1524e65d","line":72,"updated":"2015-06-16 21:42:57.000000000","message":"math.ceil() would reserve space and round up.  floor() reserves less than the requested amount.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            return False"},{"line_number":70,"context_line":"        # Calculate how much free space is left after taking into account"},{"line_number":71,"context_line":"        # the reserved space."},{"line_number":72,"context_line":"        free \u003d free_space - math.floor(total * reserved)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        msg_args \u003d {\"host\": host_state.host,"},{"line_number":75,"context_line":"                    \"requested\": share_size,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_6c9c87c0","line":72,"in_reply_to":"fa32b979_1524e65d","updated":"2015-06-23 17:35:01.000000000","message":"I see what you meant now. Used floor for the entire formula.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Only evaluate using max_over_subscription_ratio if"},{"line_number":79,"context_line":"        # thin_provisioning_support is True. Check if the ratio of"},{"line_number":80,"context_line":"        # provisioned capacity over total capacity has exceeded over"},{"line_number":81,"context_line":"        # subscription ratio."},{"line_number":82,"context_line":"        if (host_state.thin_provisioning_support and"},{"line_number":83,"context_line":"                host_state.max_over_subscription_ratio \u003e 1):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3501ea6a","line":80,"updated":"2015-06-16 21:42:57.000000000","message":"s/has exceeded/would exceed/","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Only evaluate using max_over_subscription_ratio if"},{"line_number":79,"context_line":"        # thin_provisioning_support is True. Check if the ratio of"},{"line_number":80,"context_line":"        # provisioned capacity over total capacity has exceeded over"},{"line_number":81,"context_line":"        # subscription ratio."},{"line_number":82,"context_line":"        if (host_state.thin_provisioning_support and"},{"line_number":83,"context_line":"                host_state.max_over_subscription_ratio \u003e 1):"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_8cef8b1d","line":80,"in_reply_to":"fa32b979_3501ea6a","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                LOG.warning(_LW("},{"line_number":88,"context_line":"                    \"Insufficient free space for thin provisioning. \""},{"line_number":89,"context_line":"                    \"The ratio of provisioned capacity over total capacity \""},{"line_number":90,"context_line":"                    \"%(provisioned_ratio).2f has exceeded the maximum over \""},{"line_number":91,"context_line":"                    \"subscription ratio %(oversub_ratio).2f on host \""},{"line_number":92,"context_line":"                    \"%(host)s.\"),"},{"line_number":93,"context_line":"                    {\"provisioned_ratio\": provisioned_ratio,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_95d9d624","line":90,"updated":"2015-06-16 21:42:57.000000000","message":"Not \"has exceeded\".  \"would exceed\" only if the share of share_size was created here -- but it won\u0027t be.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                LOG.warning(_LW("},{"line_number":88,"context_line":"                    \"Insufficient free space for thin provisioning. \""},{"line_number":89,"context_line":"                    \"The ratio of provisioned capacity over total capacity \""},{"line_number":90,"context_line":"                    \"%(provisioned_ratio).2f has exceeded the maximum over \""},{"line_number":91,"context_line":"                    \"subscription ratio %(oversub_ratio).2f on host \""},{"line_number":92,"context_line":"                    \"%(host)s.\"),"},{"line_number":93,"context_line":"                    {\"provisioned_ratio\": provisioned_ratio,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_6cea4711","line":90,"in_reply_to":"fa32b979_95d9d624","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                return False"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                # Thin provisioning is still allowed if free \u003e 0."},{"line_number":99,"context_line":"                return free \u003e 0"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        if free \u003c share_size:"},{"line_number":102,"context_line":"            LOG.warning(_LW(\"Insufficient free space for share creation \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_d528bee4","line":99,"updated":"2015-06-16 21:42:57.000000000","message":"Seems like if free \u003c\u003d 0 would be a good thing to check before doing all this.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"81c454f2c47058a1f0194c521408f0acf3d48566","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                return False"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                # Thin provisioning is still allowed if free \u003e 0."},{"line_number":99,"context_line":"                return free \u003e 0"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        if free \u003c share_size:"},{"line_number":102,"context_line":"            LOG.warning(_LW(\"Insufficient free space for share creation \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_7dcc6561","line":99,"in_reply_to":"fa32b979_7b1fb15b","updated":"2015-06-22 17:16:20.000000000","message":"I was just suggesting that testing for free \u003e 0 (or opposite) could be right after we get the free space (and debug msg).  No need to even consider the over-provisioning conditions if we see free \u003c\u003d 0.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                return False"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                # Thin provisioning is still allowed if free \u003e 0."},{"line_number":99,"context_line":"                return free \u003e 0"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        if free \u003c share_size:"},{"line_number":102,"context_line":"            LOG.warning(_LW(\"Insufficient free space for share creation \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_99c02c52","line":99,"in_reply_to":"fa32b979_7dcc6561","updated":"2015-06-23 17:35:01.000000000","message":"What you are saying is correct.  This is what I think.  This condition is already covered here and below. We have evaluation for thin provisioning first, followed by thick.  I think that is more straight-forward and readable than adding another check before the thin evaluation. That was why I was asked to move the thick evaluation after thin in Cinder.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f78c6dc8ad3beaafded1f99331f976ee4924b9a7","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                return False"},{"line_number":97,"context_line":"            else:"},{"line_number":98,"context_line":"                # Thin provisioning is still allowed if free \u003e 0."},{"line_number":99,"context_line":"                return free \u003e 0"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        if free \u003c share_size:"},{"line_number":102,"context_line":"            LOG.warning(_LW(\"Insufficient free space for share creation \""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_7b1fb15b","line":99,"in_reply_to":"fa32b979_d528bee4","updated":"2015-06-21 19:48:54.000000000","message":"This line will return False if free\u003c\u003d0.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        LOG.debug(\"Space information for share creation \""},{"line_number":108,"context_line":"                  \"on host %(host)s (requested / avail): \""},{"line_number":109,"context_line":"                  \"%(requested)s/%(available)s\", msg_args)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_355d6a79","line":109,"updated":"2015-06-16 21:42:57.000000000","message":"This should be moved up (or duplicated?) because we get this nice debug message on when not doing over-provisioning.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        LOG.debug(\"Space information for share creation \""},{"line_number":108,"context_line":"                  \"on host %(host)s (requested / avail): \""},{"line_number":109,"context_line":"                  \"%(requested)s/%(available)s\", msg_args)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_4c84230a","line":109,"in_reply_to":"fa32b979_1b1d45bd","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"d5a21cc796f60e9166fb903bfa185dda98e9035f","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        LOG.debug(\"Space information for share creation \""},{"line_number":108,"context_line":"                  \"on host %(host)s (requested / avail): \""},{"line_number":109,"context_line":"                  \"%(requested)s/%(available)s\", msg_args)"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_1b1d45bd","line":109,"in_reply_to":"fa32b979_355d6a79","updated":"2015-06-21 23:35:52.000000000","message":"+1","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"12d9aa38c4bd6660abebf60c7654331c92ba249c","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        if (host_state.thin_provisioning_support and"},{"line_number":88,"context_line":"                host_state.max_over_subscription_ratio \u003e\u003d 1):"},{"line_number":89,"context_line":"            provisioned_ratio \u003d ((host_state.provisioned_capacity_gb +"},{"line_number":90,"context_line":"                                  share_size) / total)"},{"line_number":91,"context_line":"            if provisioned_ratio \u003e host_state.max_over_subscription_ratio:"},{"line_number":92,"context_line":"                LOG.warning(_LW("},{"line_number":93,"context_line":"                    \"Insufficient free space for thin provisioning. \""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_36672527","line":90,"updated":"2015-07-05 01:23:24.000000000","message":"s/total/(total - total * reserved))/ would be better here in my opinion. Since we have a reserved percentage configured I think it should be taken into account here for overprovisioning. You could still go into the reserve, but your the ratio would at least consider it.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f4c3cc216e7a9586c8fe1b6acb53852f96a52a77","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        if (host_state.thin_provisioning_support and"},{"line_number":88,"context_line":"                host_state.max_over_subscription_ratio \u003e\u003d 1):"},{"line_number":89,"context_line":"            provisioned_ratio \u003d ((host_state.provisioned_capacity_gb +"},{"line_number":90,"context_line":"                                  share_size) / total)"},{"line_number":91,"context_line":"            if provisioned_ratio \u003e host_state.max_over_subscription_ratio:"},{"line_number":92,"context_line":"                LOG.warning(_LW("},{"line_number":93,"context_line":"                    \"Insufficient free space for thin provisioning. \""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_e60ad61f","line":90,"in_reply_to":"ba3cc151_36672527","updated":"2015-07-09 02:27:29.000000000","message":"So reserved is taken into consideration in the else block on line 106. \"free\" has \"reserved\" subtracted already.  \"provisioned_ratio\" should be measured against the total.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"12d9aa38c4bd6660abebf60c7654331c92ba249c","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        elif host_state.thin_provisioning_support:"},{"line_number":109,"context_line":"            LOG.warning(_LW(\"Invalid max_over_subscription_ratio: %(ratio)s. \""},{"line_number":110,"context_line":"                            \"Valid value should be \u003e\u003d 1.\"),"},{"line_number":111,"context_line":"                        {\"ratio\": host_state.max_over_subscription_ratio})"},{"line_number":112,"context_line":"            return False"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if free \u003c share_size:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_f670ddde","line":111,"updated":"2015-07-05 01:23:24.000000000","message":"This is an invalid config. I\u0027m not aware of a better way to draw attention to it. Maybe at least log it as an error? Should it be trapped in a config opt check?","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f4c3cc216e7a9586c8fe1b6acb53852f96a52a77","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        elif host_state.thin_provisioning_support:"},{"line_number":109,"context_line":"            LOG.warning(_LW(\"Invalid max_over_subscription_ratio: %(ratio)s. \""},{"line_number":110,"context_line":"                            \"Valid value should be \u003e\u003d 1.\"),"},{"line_number":111,"context_line":"                        {\"ratio\": host_state.max_over_subscription_ratio})"},{"line_number":112,"context_line":"            return False"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if free \u003c share_size:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_06ea5a0f","line":111,"in_reply_to":"ba3cc151_f670ddde","updated":"2015-07-09 02:27:29.000000000","message":"I could log an error.  Driver should check this.  I could add a check in the base driver.  Other drivers can call this from the base class.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class CapacityFilter(filters.BaseHostFilter):"},{"line_number":32,"context_line":"    \"\"\"CapacityFilter filters based on share host\u0027s capacity utilization.\"\"\""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":35,"context_line":"        \"\"\"Return True if host has sufficient capacity.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_bab27747","line":32,"updated":"2015-07-09 08:36:11.000000000","message":"this","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":35,"context_line":"        \"\"\"Return True if host has sufficient capacity.\"\"\""},{"line_number":36,"context_line":"        share_size \u003d filter_properties.get(\u0027size\u0027)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        if host_state.free_capacity_gb is None:"},{"line_number":39,"context_line":"            # Fail Safe"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_fa931fa1","line":36,"updated":"2015-07-09 08:36:11.000000000","message":"this","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        if host_state.free_capacity_gb is None:"},{"line_number":39,"context_line":"            # Fail Safe"},{"line_number":40,"context_line":"            LOG.error(_LE(\"Free capacity not set: \""},{"line_number":41,"context_line":"                          \"share node info collection broken.\"))"},{"line_number":42,"context_line":"            return False"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        free_space \u003d host_state.free_capacity_gb"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_ba4ef735","line":41,"updated":"2015-07-09 08:36:11.000000000","message":"and this and all similar should be in separate preceding patch.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        if host_state.free_capacity_gb is None:"},{"line_number":39,"context_line":"            # Fail Safe"},{"line_number":40,"context_line":"            LOG.error(_LE(\"Free capacity not set: \""},{"line_number":41,"context_line":"                          \"share node info collection broken.\"))"},{"line_number":42,"context_line":"            return False"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        free_space \u003d host_state.free_capacity_gb"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_359162f2","line":41,"in_reply_to":"ba3cc151_ba4ef735","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        free_space \u003d host_state.free_capacity_gb"},{"line_number":45,"context_line":"        total_space \u003d host_state.total_capacity_gb"},{"line_number":46,"context_line":"        reserved \u003d float(host_state.reserved_percentage) / 100"},{"line_number":47,"context_line":"        if free_space in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":48,"context_line":"            # NOTE(zhiteng) for those back-ends cannot report actual"},{"line_number":49,"context_line":"            # available capacity, we assume it is able to serve the"},{"line_number":50,"context_line":"            # request.  Even if it was not, the retry mechanism is"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_9a18d31f","line":47,"updated":"2015-07-09 08:36:11.000000000","message":"In explicitly defined small things like this better to use tuple. It is about ten times faster.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        free_space \u003d host_state.free_capacity_gb"},{"line_number":45,"context_line":"        total_space \u003d host_state.total_capacity_gb"},{"line_number":46,"context_line":"        reserved \u003d float(host_state.reserved_percentage) / 100"},{"line_number":47,"context_line":"        if free_space in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":48,"context_line":"            # NOTE(zhiteng) for those back-ends cannot report actual"},{"line_number":49,"context_line":"            # available capacity, we assume it is able to serve the"},{"line_number":50,"context_line":"            # request.  Even if it was not, the retry mechanism is"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_15bf7e61","line":47,"in_reply_to":"ba3cc151_9a18d31f","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            # request.  Even if it was not, the retry mechanism is"},{"line_number":51,"context_line":"            # able to handle the failure by rescheduling"},{"line_number":52,"context_line":"            return True"},{"line_number":53,"context_line":"        elif total_space in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":54,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"},{"line_number":55,"context_line":"            # is 0, we assume the back-ends can serve the request."},{"line_number":56,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_7ad86f53","line":53,"updated":"2015-07-09 08:36:11.000000000","message":"ditto","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            # request.  Even if it was not, the retry mechanism is"},{"line_number":51,"context_line":"            # able to handle the failure by rescheduling"},{"line_number":52,"context_line":"            return True"},{"line_number":53,"context_line":"        elif total_space in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":54,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"},{"line_number":55,"context_line":"            # is 0, we assume the back-ends can serve the request."},{"line_number":56,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_d5b83678","line":53,"in_reply_to":"ba3cc151_7ad86f53","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            # able to handle the failure by rescheduling"},{"line_number":52,"context_line":"            return True"},{"line_number":53,"context_line":"        elif total_space in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":54,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"},{"line_number":55,"context_line":"            # is 0, we assume the back-ends can serve the request."},{"line_number":56,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"},{"line_number":57,"context_line":"            # is not 0, we cannot calculate the reserved space."}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_bac11750","line":54,"updated":"2015-07-09 08:36:11.000000000","message":"Please, add type of message and author:\n\n\"\"\"\n\nNOTE(foouser): barmessage\n\n\"\"\"","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            # able to handle the failure by rescheduling"},{"line_number":52,"context_line":"            return True"},{"line_number":53,"context_line":"        elif total_space in [\u0027infinite\u0027, \u0027unknown\u0027]:"},{"line_number":54,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"},{"line_number":55,"context_line":"            # is 0, we assume the back-ends can serve the request."},{"line_number":56,"context_line":"            # If total_space is \u0027infinite\u0027 or \u0027unknown\u0027 and reserved"},{"line_number":57,"context_line":"            # is not 0, we cannot calculate the reserved space."}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_75ae0a31","line":54,"in_reply_to":"ba3cc151_bac11750","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"}],"manila/scheduler/host_manager.py":[{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        self.total_capacity_gb \u003d 0"},{"line_number":111,"context_line":"        self.free_capacity_gb \u003d None"},{"line_number":112,"context_line":"        self.reserved_percentage \u003d 0"},{"line_number":113,"context_line":"        self.allocated_capacity_gb \u003d 0"},{"line_number":114,"context_line":"        # The apparent allocated space indicating how much capacity"},{"line_number":115,"context_line":"        # has been provisioned. This could be the sum of sizes of"},{"line_number":116,"context_line":"        # all shares on a backend, which could be greater than or"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_5ac9eb24","line":113,"updated":"2015-07-09 08:36:11.000000000","message":"Where are these changes are covered with unit tests?","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        self.total_capacity_gb \u003d 0"},{"line_number":111,"context_line":"        self.free_capacity_gb \u003d None"},{"line_number":112,"context_line":"        self.reserved_percentage \u003d 0"},{"line_number":113,"context_line":"        self.allocated_capacity_gb \u003d 0"},{"line_number":114,"context_line":"        # The apparent allocated space indicating how much capacity"},{"line_number":115,"context_line":"        # has been provisioned. This could be the sum of sizes of"},{"line_number":116,"context_line":"        # all shares on a backend, which could be greater than or"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_55a50645","line":113,"in_reply_to":"ba3cc151_5ac9eb24","updated":"2015-07-10 04:07:41.000000000","message":"Added tests in test_host_manager.py.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"}],"manila/scheduler/weights/capacity.py":[{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                total_space \u003d\u003d \u0027infinite\u0027 or total_space \u003d\u003d \u0027unknown\u0027):"},{"line_number":60,"context_line":"            # (zhiteng) \u0027infinite\u0027 and \u0027unknown\u0027 are treated the same"},{"line_number":61,"context_line":"            # here, for sorting purpose."},{"line_number":62,"context_line":"            free \u003d float(\u0027inf\u0027)"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            total \u003d float(total_space)"},{"line_number":65,"context_line":"            if host_state.thin_provisioning_support:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_78a8c98d","line":62,"updated":"2015-06-16 21:42:57.000000000","message":"Why don\u0027t we treat \u0027infinite\u0027 and \u0027unknown\u0027 as lowest weight like Cinder?  Separate patch I suppose.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"d5a21cc796f60e9166fb903bfa185dda98e9035f","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                total_space \u003d\u003d \u0027infinite\u0027 or total_space \u003d\u003d \u0027unknown\u0027):"},{"line_number":60,"context_line":"            # (zhiteng) \u0027infinite\u0027 and \u0027unknown\u0027 are treated the same"},{"line_number":61,"context_line":"            # here, for sorting purpose."},{"line_number":62,"context_line":"            free \u003d float(\u0027inf\u0027)"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            total \u003d float(total_space)"},{"line_number":65,"context_line":"            if host_state.thin_provisioning_support:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_7bd011ca","line":62,"in_reply_to":"fa32b979_5b3e6db9","updated":"2015-06-21 23:35:52.000000000","message":"Agreed on separate patch.  There isn\u0027t a unit test for the infinite case, but I suppose that can wait for the later patch.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f78c6dc8ad3beaafded1f99331f976ee4924b9a7","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                total_space \u003d\u003d \u0027infinite\u0027 or total_space \u003d\u003d \u0027unknown\u0027):"},{"line_number":60,"context_line":"            # (zhiteng) \u0027infinite\u0027 and \u0027unknown\u0027 are treated the same"},{"line_number":61,"context_line":"            # here, for sorting purpose."},{"line_number":62,"context_line":"            free \u003d float(\u0027inf\u0027)"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            total \u003d float(total_space)"},{"line_number":65,"context_line":"            if host_state.thin_provisioning_support:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_5b3e6db9","line":62,"in_reply_to":"fa32b979_78a8c98d","updated":"2015-06-21 19:48:54.000000000","message":"Yes, that should be in a separate patch.  I thought about it.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                # Calculate virtual free capacity for thin provisioning."},{"line_number":67,"context_line":"                free \u003d (total * host_state.max_over_subscription_ratio"},{"line_number":68,"context_line":"                        - host_state.provisioned_capacity_gb -"},{"line_number":69,"context_line":"                        math.floor(total * reserved))"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_f8a29998","line":69,"updated":"2015-06-16 21:42:57.000000000","message":"should be ceil()","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                # Calculate virtual free capacity for thin provisioning."},{"line_number":67,"context_line":"                free \u003d (total * host_state.max_over_subscription_ratio"},{"line_number":68,"context_line":"                        - host_state.provisioned_capacity_gb -"},{"line_number":69,"context_line":"                        math.floor(total * reserved))"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3957a05b","line":69,"in_reply_to":"fa32b979_7b8251ca","updated":"2015-06-23 17:35:01.000000000","message":"Used math.floor to wrap around the whole formula.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f78c6dc8ad3beaafded1f99331f976ee4924b9a7","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                # Calculate virtual free capacity for thin provisioning."},{"line_number":67,"context_line":"                free \u003d (total * host_state.max_over_subscription_ratio"},{"line_number":68,"context_line":"                        - host_state.provisioned_capacity_gb -"},{"line_number":69,"context_line":"                        math.floor(total * reserved))"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_fb4ae154","line":69,"in_reply_to":"fa32b979_f8a29998","updated":"2015-06-21 19:48:54.000000000","message":"I\u0027m not sure why ceil is better as floor is used in Cinder. I\u0027ll have to take a closer look.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"d5a21cc796f60e9166fb903bfa185dda98e9035f","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                # Calculate virtual free capacity for thin provisioning."},{"line_number":67,"context_line":"                free \u003d (total * host_state.max_over_subscription_ratio"},{"line_number":68,"context_line":"                        - host_state.provisioned_capacity_gb -"},{"line_number":69,"context_line":"                        math.floor(total * reserved))"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_7b8251ca","line":69,"in_reply_to":"fa32b979_fb4ae154","updated":"2015-06-21 23:35:52.000000000","message":"I agree with Mark.  Floor will round towards a smaller value, but you are *subtracting* that value from free, so free space will be larger than it would be without rounding.  I think you never want free space to be rounded up!","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."},{"line_number":73,"context_line":"                free \u003d free_space - math.floor(total * reserved)"},{"line_number":74,"context_line":"        return free"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_38b321eb","line":73,"updated":"2015-06-16 21:42:57.000000000","message":"ceil()","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"d5a21cc796f60e9166fb903bfa185dda98e9035f","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."},{"line_number":73,"context_line":"                free \u003d free_space - math.floor(total * reserved)"},{"line_number":74,"context_line":"        return free"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3b6da932","line":73,"in_reply_to":"fa32b979_38b321eb","updated":"2015-06-21 23:35:52.000000000","message":"+1","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":72,"context_line":"                # account the reserved space."},{"line_number":73,"context_line":"                free \u003d free_space - math.floor(total * reserved)"},{"line_number":74,"context_line":"        return free"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_593dc4db","line":73,"in_reply_to":"fa32b979_3b6da932","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"12d9aa38c4bd6660abebf60c7654331c92ba249c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                free \u003d math.floor("},{"line_number":68,"context_line":"                    total * host_state.max_over_subscription_ratio -"},{"line_number":69,"context_line":"                    host_state.provisioned_capacity_gb -"},{"line_number":70,"context_line":"                    total * reserved)"},{"line_number":71,"context_line":"            else:"},{"line_number":72,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":73,"context_line":"                # account the reserved space."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_361c0577","line":70,"updated":"2015-07-05 01:23:24.000000000","message":"Here I\u0027d say adjusted_total \u003d total - total * reserve and then free \u003d math.floor(adjusted_total * ratio - provisioned_capacity_gb).  So the reserve concept is built in to the overprovisioning concept.  They way you subtract it after applying the 20x reduces the significance of the reserve.  So I think it would be better to consider reserve before the 20x.  (I\u0027m using 20x example as the default ratio).","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f4c3cc216e7a9586c8fe1b6acb53852f96a52a77","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                free \u003d math.floor("},{"line_number":68,"context_line":"                    total * host_state.max_over_subscription_ratio -"},{"line_number":69,"context_line":"                    host_state.provisioned_capacity_gb -"},{"line_number":70,"context_line":"                    total * reserved)"},{"line_number":71,"context_line":"            else:"},{"line_number":72,"context_line":"                # Calculate how much free space is left after taking into"},{"line_number":73,"context_line":"                # account the reserved space."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_c6b0f2ff","line":70,"in_reply_to":"ba3cc151_361c0577","updated":"2015-07-09 02:27:29.000000000","message":"There\u0027s no good way of considering the reserved unless you compare it with used capacity, so I\u0027d prefer to keep it this way.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":37,"context_line":"capacity_weight_opts \u003d ["},{"line_number":38,"context_line":"    cfg.FloatOpt(\u0027capacity_weight_multiplier\u0027,"},{"line_number":39,"context_line":"                 default\u003d1.0,"},{"line_number":40,"context_line":"                 help\u003d\u0027Multiplier used for weighing share capacity. \u0027"},{"line_number":41,"context_line":"                 \u0027Negative numbers mean to stack vs spread.\u0027),"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_badef7d7","line":40,"updated":"2015-07-09 08:36:11.000000000","message":"Same here - separate preceding commit should be.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":37,"context_line":"capacity_weight_opts \u003d ["},{"line_number":38,"context_line":"    cfg.FloatOpt(\u0027capacity_weight_multiplier\u0027,"},{"line_number":39,"context_line":"                 default\u003d1.0,"},{"line_number":40,"context_line":"                 help\u003d\u0027Multiplier used for weighing share capacity. \u0027"},{"line_number":41,"context_line":"                 \u0027Negative numbers mean to stack vs spread.\u0027),"},{"line_number":42,"context_line":"]"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_b56a52ec","line":40,"in_reply_to":"ba3cc151_badef7d7","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"6d6757eb52ca1a23cb0b42c71826d83bf24f85e1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        free_space \u003d host_state.free_capacity_gb"},{"line_number":57,"context_line":"        total_space \u003d host_state.total_capacity_gb"},{"line_number":58,"context_line":"        if (free_space \u003d\u003d \u0027infinite\u0027 or free_space \u003d\u003d \u0027unknown\u0027 or"},{"line_number":59,"context_line":"                total_space \u003d\u003d \u0027infinite\u0027 or total_space \u003d\u003d \u0027unknown\u0027):"},{"line_number":60,"context_line":"            # (zhiteng) \u0027infinite\u0027 and \u0027unknown\u0027 are treated the same"},{"line_number":61,"context_line":"            # here, for sorting purpose."},{"line_number":62,"context_line":"            free \u003d float(\u0027inf\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_cadad44b","line":59,"updated":"2015-07-10 15:33:00.000000000","message":"if {\u0027unknown\u0027, \u0027infinite\u0027}.intersection({total_space, free_space}):","commit_id":"453913ca8c804b51030cf6052f3a5d23da0908a5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e86addbb3c0e6b8d6f197e0f08710fc44999b942","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        free_space \u003d host_state.free_capacity_gb"},{"line_number":57,"context_line":"        total_space \u003d host_state.total_capacity_gb"},{"line_number":58,"context_line":"        if (free_space \u003d\u003d \u0027infinite\u0027 or free_space \u003d\u003d \u0027unknown\u0027 or"},{"line_number":59,"context_line":"                total_space \u003d\u003d \u0027infinite\u0027 or total_space \u003d\u003d \u0027unknown\u0027):"},{"line_number":60,"context_line":"            # (zhiteng) \u0027infinite\u0027 and \u0027unknown\u0027 are treated the same"},{"line_number":61,"context_line":"            # here, for sorting purpose."},{"line_number":62,"context_line":"            free \u003d float(\u0027inf\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba3cc151_4d71daa7","line":59,"in_reply_to":"ba3cc151_cadad44b","updated":"2015-07-10 19:18:02.000000000","message":"Much nicer:).  Thanks!","commit_id":"453913ca8c804b51030cf6052f3a5d23da0908a5"}],"manila/share/driver.py":[{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                 default\u003d20.0,"},{"line_number":66,"context_line":"                 help\u003d\u0027Float representation of the over subscription ratio \u0027"},{"line_number":67,"context_line":"                      \u0027when thin provisioning is involved. Default ratio is \u0027"},{"line_number":68,"context_line":"                      \u002720.0, meaning provisioned capacity can be 20 times of \u0027"},{"line_number":69,"context_line":"                      \u0027the total physical capacity. If the ratio is 10.5, it \u0027"},{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times of the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_78e449e0","line":68,"updated":"2015-06-16 21:42:57.000000000","message":"s/times of/times/","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                 default\u003d20.0,"},{"line_number":66,"context_line":"                 help\u003d\u0027Float representation of the over subscription ratio \u0027"},{"line_number":67,"context_line":"                      \u0027when thin provisioning is involved. Default ratio is \u0027"},{"line_number":68,"context_line":"                      \u002720.0, meaning provisioned capacity can be 20 times of \u0027"},{"line_number":69,"context_line":"                      \u0027the total physical capacity. If the ratio is 10.5, it \u0027"},{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times of the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3c546efc","line":68,"in_reply_to":"fa32b979_78e449e0","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                      \u0027when thin provisioning is involved. Default ratio is \u0027"},{"line_number":68,"context_line":"                      \u002720.0, meaning provisioned capacity can be 20 times of \u0027"},{"line_number":69,"context_line":"                      \u0027the total physical capacity. If the ratio is 10.5, it \u0027"},{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times of the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 will be ignored and \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_f8d059f8","line":70,"updated":"2015-06-16 21:42:57.000000000","message":"s/times of/times/","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                      \u0027when thin provisioning is involved. Default ratio is \u0027"},{"line_number":68,"context_line":"                      \u002720.0, meaning provisioned capacity can be 20 times of \u0027"},{"line_number":69,"context_line":"                      \u0027the total physical capacity. If the ratio is 10.5, it \u0027"},{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times of the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 will be ignored and \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_fc42863d","line":70,"in_reply_to":"fa32b979_f8d059f8","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"7d8efe11b692192916f21409913c8f2426cdf7b7","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                      \u002720.0, meaning provisioned capacity can be 20 times of \u0027"},{"line_number":69,"context_line":"                      \u0027the total physical capacity. If the ratio is 10.5, it \u0027"},{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times of the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 will be ignored and \u0027"},{"line_number":74,"context_line":"                      \u0027the default value will be used instead.\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3801e16a","line":71,"updated":"2015-06-16 21:42:57.000000000","message":"This should just say 1.0 or less will...","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                      \u002720.0, meaning provisioned capacity can be 20 times of \u0027"},{"line_number":69,"context_line":"                      \u0027the total physical capacity. If the ratio is 10.5, it \u0027"},{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times of the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 will be ignored and \u0027"},{"line_number":74,"context_line":"                      \u0027the default value will be used instead.\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_bc487e5d","line":71,"in_reply_to":"fa32b979_3801e16a","updated":"2015-06-23 17:35:01.000000000","message":"Done","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11865,"name":"Clinton Knight","email":"cknight@netapp.com","username":"cknight"},"change_message_id":"d5a21cc796f60e9166fb903bfa185dda98e9035f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 will be ignored and \u0027"},{"line_number":74,"context_line":"                      \u0027the default value will be used instead.\u0027),"},{"line_number":75,"context_line":"]"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"ssh_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_3b54c952","line":74,"updated":"2015-06-21 23:35:52.000000000","message":"IIUC, this seems dangerous.  It seems a ratio lower than 1.0 should just be pegged at 1.0, instead of the default (20.0).\n\nhttps://en.wikipedia.org/wiki/Principle_of_least_astonishment","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"b4c93a02362f4ac5151a0300d074e39fc1c41199","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 will be ignored and \u0027"},{"line_number":74,"context_line":"                      \u0027the default value will be used instead.\u0027),"},{"line_number":75,"context_line":"]"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"ssh_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_1ba78550","line":74,"in_reply_to":"fa32b979_3b54c952","updated":"2015-06-23 17:35:01.000000000","message":"Done. This is wrong. If it is lower than 1.0, it will be treated as 1.0.","commit_id":"e7f4c8789a86e002bbbd93c56fe6bf0afae67033"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"12d9aa38c4bd6660abebf60c7654331c92ba249c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 is invalid.\u0027),"},{"line_number":74,"context_line":"]"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"ssh_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_b67335e7","line":73,"updated":"2015-07-05 01:23:24.000000000","message":"If you accept my suggestion that the ratio calculation should deduct the reserve from the total, then this help would need to mention that.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f4c3cc216e7a9586c8fe1b6acb53852f96a52a77","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                      \u0027means provisioned capacity can be 10.5 times the \u0027"},{"line_number":71,"context_line":"                      \u0027total physical capacity. A ratio of 1.0 means \u0027"},{"line_number":72,"context_line":"                      \u0027provisioned capacity cannot exceed the total physical \u0027"},{"line_number":73,"context_line":"                      \u0027capacity. A ratio lower than 1.0 is invalid.\u0027),"},{"line_number":74,"context_line":"]"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"ssh_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_26e3deda","line":73,"in_reply_to":"ba3cc151_b67335e7","updated":"2015-07-09 02:27:29.000000000","message":"I think the max ratio should be measured against the total, not comparing with the reserved as reserved is relevant to used capacity.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":61,"context_line":"             \"is able to handle share servers and it is desired mode else set \""},{"line_number":62,"context_line":"             \"False. It is set to None by default to make this choice \""},{"line_number":63,"context_line":"             \"intentional.\"),"},{"line_number":64,"context_line":"    cfg.FloatOpt(\u0027max_over_subscription_ratio\u0027,"},{"line_number":65,"context_line":"                 default\u003d20.0,"},{"line_number":66,"context_line":"                 help\u003d\u0027Float representation of the over subscription ratio \u0027"},{"line_number":67,"context_line":"                      \u0027when thin provisioning is involved. Default ratio is \u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_9d1bed72","line":64,"updated":"2015-07-09 08:36:11.000000000","message":"Please, keep indentation same as for neighbour options.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":61,"context_line":"             \"is able to handle share servers and it is desired mode else set \""},{"line_number":62,"context_line":"             \"False. It is set to None by default to make this choice \""},{"line_number":63,"context_line":"             \"intentional.\"),"},{"line_number":64,"context_line":"    cfg.FloatOpt(\u0027max_over_subscription_ratio\u0027,"},{"line_number":65,"context_line":"                 default\u003d20.0,"},{"line_number":66,"context_line":"                 help\u003d\u0027Float representation of the over subscription ratio \u0027"},{"line_number":67,"context_line":"                      \u0027when thin provisioning is involved. Default ratio is \u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_7575aaca","line":64,"in_reply_to":"ba3cc151_9d1bed72","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def check_for_setup_error(self):"},{"line_number":299,"context_line":"        \"\"\"Check for setup error.\"\"\""},{"line_number":300,"context_line":"        max_ratio \u003d self.configuration.safe_get(\u0027max_over_subscription_ratio\u0027)"},{"line_number":301,"context_line":"        if max_ratio \u003c 1.0:"},{"line_number":302,"context_line":"            msg \u003d (_(\"Invalid max_over_subscription_ratio \u0027%s\u0027. \""},{"line_number":303,"context_line":"                     \"Valid value should be \u003e\u003d 1.0.\") % max_ratio)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_dd43b540","line":300,"updated":"2015-07-09 08:36:11.000000000","message":"Not covered with unit tests.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def check_for_setup_error(self):"},{"line_number":299,"context_line":"        \"\"\"Check for setup error.\"\"\""},{"line_number":300,"context_line":"        max_ratio \u003d self.configuration.safe_get(\u0027max_over_subscription_ratio\u0027)"},{"line_number":301,"context_line":"        if max_ratio \u003c 1.0:"},{"line_number":302,"context_line":"            msg \u003d (_(\"Invalid max_over_subscription_ratio \u0027%s\u0027. \""},{"line_number":303,"context_line":"                     \"Valid value should be \u003e\u003d 1.0.\") % max_ratio)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_f52e9aaa","line":300,"in_reply_to":"ba3cc151_dd43b540","updated":"2015-07-10 04:07:41.000000000","message":"This is covered in manila/tests/test_driver.py.\n\nhttps://review.openstack.org/#/c/192044/8/manila/tests/share/test_driver.py","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"}],"manila/tests/scheduler/fakes.py":[{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"12d9aa38c4bd6660abebf60c7654331c92ba249c","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                      \u0027provisioned_capacity_gb\u0027: 1848,"},{"line_number":152,"context_line":"                      \u0027max_over_subscription_ratio\u0027: 1.0,"},{"line_number":153,"context_line":"                      \u0027thin_provisioning_support\u0027: True,"},{"line_number":154,"context_line":"                      \u0027thick_provisioning_support\u0027: True,"},{"line_number":155,"context_line":"                      \u0027reserved_percentage\u0027: 5,"},{"line_number":156,"context_line":"                      \u0027timestamp\u0027: None},"},{"line_number":157,"context_line":"            \u0027host5\u0027: {\u0027total_capacity_gb\u0027: 2048,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_d63919f4","line":154,"updated":"2015-07-05 01:23:24.000000000","message":"So this is capable of using thin or thick. I think this implies that the share type (or driver default) would decide whether to create a thin or think share. The scheduler is assuming thin provisioning for this.  It\u0027s OK to do this with ratio of 1.0 if you add consideration of reserve space.  If the ratio was \u003e1.0, then I think the scheduler would try to over-provision here even though \"thick\" shares could be created. That would be a problem.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"f4c3cc216e7a9586c8fe1b6acb53852f96a52a77","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                      \u0027provisioned_capacity_gb\u0027: 1848,"},{"line_number":152,"context_line":"                      \u0027max_over_subscription_ratio\u0027: 1.0,"},{"line_number":153,"context_line":"                      \u0027thin_provisioning_support\u0027: True,"},{"line_number":154,"context_line":"                      \u0027thick_provisioning_support\u0027: True,"},{"line_number":155,"context_line":"                      \u0027reserved_percentage\u0027: 5,"},{"line_number":156,"context_line":"                      \u0027timestamp\u0027: None},"},{"line_number":157,"context_line":"            \u0027host5\u0027: {\u0027total_capacity_gb\u0027: 2048,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_419ccc69","line":154,"in_reply_to":"ba3cc151_d63919f4","updated":"2015-07-09 02:27:29.000000000","message":"The only way to handle both is to go back to my original Cinder code.  See removed code on line 83-91 on the left hand side:\n\nhttps://review.openstack.org/#/c/185764/8/cinder/scheduler/filters/capacity_filter.py\n\nThat will prevent thick provisioning from being happening if there\u0027s no space to accommodate that, however, that was reported as a bug by many people doing thin provisioning, including people whose arrays support both thin and thick.\n\nThat was the feedback I got after oversubscription feature has been used for a few months.  So I think we should honor that.\n\nAdmin always has to monitor capacity usage and free capacity even after the oversubscription feature is in place because this alone cannot prevent overprovisioning.","commit_id":"19f213017797a437962ea482f4cf290af4fa7184"}],"manila/tests/scheduler/test_capacity_weigher.py":[{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    #         - math.floor(total * reserved))"},{"line_number":63,"context_line":"    def test_default_of_spreading_first(self):"},{"line_number":64,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":67,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":68,"context_line":"        #        free\u003d1024-math.floor(1024*0.1)\u003d922"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_a72433b2","line":65,"updated":"2015-06-26 21:47:06.000000000","message":"The comments below don\u0027t use the correct formula anymore because of the math.floor fix.","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    #         - math.floor(total * reserved))"},{"line_number":63,"context_line":"    def test_default_of_spreading_first(self):"},{"line_number":64,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":67,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":68,"context_line":"        #        free\u003d1024-math.floor(1024*0.1)\u003d922"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_2f36b1b4","line":65,"in_reply_to":"fa32b979_a72433b2","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        # so, host2 should win:"},{"line_number":86,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":87,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8c47d676","line":87,"updated":"2015-06-26 21:47:06.000000000","message":"Xing would say (expected, actual) :)","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"2bcf2ce2681e2aec06049282888d83706a287588","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        # so, host2 should win:"},{"line_number":86,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":87,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_e7c23b34","line":87,"in_reply_to":"fa32b979_8c47d676","updated":"2015-06-26 21:54:15.000000000","message":"Is that Valeriy\u0027s comment?:)  By the way, I don\u0027t review my own code:).","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        # so, host2 should win:"},{"line_number":86,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":87,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_cff385e6","line":87,"in_reply_to":"fa32b979_e7c23b34","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":87,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_capacity_weight_multiplier1(self):"},{"line_number":92,"context_line":"        self.flags(capacity_weight_multiplier\u003d-1.0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_4c730ee8","line":89,"updated":"2015-06-26 21:47:06.000000000","message":"expected, actual","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":87,"context_line":"        self.assertEqual(weighed_host.weight, 1.0)"},{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_capacity_weight_multiplier1(self):"},{"line_number":92,"context_line":"        self.flags(capacity_weight_multiplier\u003d-1.0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8ffd7db3","line":89,"in_reply_to":"fa32b979_4c730ee8","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_capacity_weight_multiplier1(self):"},{"line_number":92,"context_line":"        self.flags(capacity_weight_multiplier\u003d-1.0)"},{"line_number":93,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8cea76ab","line":91,"updated":"2015-06-26 21:47:06.000000000","message":"You should rename this to indicate negative_1 (or stacking).","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        self.assertEqual("},{"line_number":89,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_capacity_weight_multiplier1(self):"},{"line_number":92,"context_line":"        self.flags(capacity_weight_multiplier\u003d-1.0)"},{"line_number":93,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_afe64114","line":91,"in_reply_to":"fa32b979_8cea76ab","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    def test_capacity_weight_multiplier1(self):"},{"line_number":92,"context_line":"        self.flags(capacity_weight_multiplier\u003d-1.0)"},{"line_number":93,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":96,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":97,"context_line":"        #        free\u003d-(1024-math.floor(1024*0.1))\u003d-922"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_473687e8","line":94,"updated":"2015-06-26 21:47:06.000000000","message":"The comments below don\u0027t use the correct formula anymore because of the math.floor fix.","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    def test_capacity_weight_multiplier1(self):"},{"line_number":92,"context_line":"        self.flags(capacity_weight_multiplier\u003d-1.0)"},{"line_number":93,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":96,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":97,"context_line":"        #        free\u003d-(1024-math.floor(1024*0.1))\u003d-922"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_6f191922","line":94,"in_reply_to":"fa32b979_473687e8","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":116,"context_line":"        self.assertEqual(weighed_host.weight, 0.0)"},{"line_number":117,"context_line":"        self.assertEqual("},{"line_number":118,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host4\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_capacity_weight_multiplier2(self):"},{"line_number":121,"context_line":"        self.flags(capacity_weight_multiplier\u003d2.0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8c3ef6d8","line":118,"updated":"2015-06-26 21:47:06.000000000","message":"expected, actual","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":116,"context_line":"        self.assertEqual(weighed_host.weight, 0.0)"},{"line_number":117,"context_line":"        self.assertEqual("},{"line_number":118,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host4\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_capacity_weight_multiplier2(self):"},{"line_number":121,"context_line":"        self.flags(capacity_weight_multiplier\u003d2.0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_8f149de9","line":118,"in_reply_to":"fa32b979_8c3ef6d8","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def test_capacity_weight_multiplier2(self):"},{"line_number":121,"context_line":"        self.flags(capacity_weight_multiplier\u003d2.0)"},{"line_number":122,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":125,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":126,"context_line":"        #        free\u003d(1024-math.floor(1024*0.1))*2\u003d1844"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_676cebd0","line":123,"updated":"2015-06-26 21:47:06.000000000","message":"The comments below don\u0027t use the correct formula anymore because of the math.floor fix.","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def test_capacity_weight_multiplier2(self):"},{"line_number":121,"context_line":"        self.flags(capacity_weight_multiplier\u003d2.0)"},{"line_number":122,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":125,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":126,"context_line":"        #        free\u003d(1024-math.floor(1024*0.1))*2\u003d1844"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_2fd23135","line":123,"in_reply_to":"fa32b979_676cebd0","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        # so, host2 should win:"},{"line_number":144,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":145,"context_line":"        self.assertEqual(weighed_host.weight, 2.0)"},{"line_number":146,"context_line":"        self.assertEqual("},{"line_number":147,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_0c2bc695","line":145,"updated":"2015-06-26 21:47:06.000000000","message":"expected, actual","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        # so, host2 should win:"},{"line_number":144,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":145,"context_line":"        self.assertEqual(weighed_host.weight, 2.0)"},{"line_number":146,"context_line":"        self.assertEqual("},{"line_number":147,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_4fd53519","line":145,"in_reply_to":"fa32b979_0c2bc695","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"76e6e0404df752c4d2f383618da534f874778dbd","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":145,"context_line":"        self.assertEqual(weighed_host.weight, 2.0)"},{"line_number":146,"context_line":"        self.assertEqual("},{"line_number":147,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_ac165a56","line":147,"updated":"2015-06-26 21:47:06.000000000","message":"expected, actual","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0b73d70ba6876ad8242bc9d18496fd0c8d45cc42","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":145,"context_line":"        self.assertEqual(weighed_host.weight, 2.0)"},{"line_number":146,"context_line":"        self.assertEqual("},{"line_number":147,"context_line":"            utils.extract_host(weighed_host.obj.host), \u0027host2\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_efdbe94d","line":147,"in_reply_to":"fa32b979_ac165a56","updated":"2015-06-27 14:01:58.000000000","message":"Done","commit_id":"31e6b0506c07741c81dba651f5f8357364fb5729"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":67,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":68,"context_line":"        #        free\u003dmath.floor(1024-1024*0.1)\u003d922"},{"line_number":69,"context_line":"        #        Normalized to 0.84."},{"line_number":70,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":71,"context_line":"        #        free_capacity_gb\u003d300,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_b5f68f5b","line":68,"updated":"2015-06-28 00:14:24.000000000","message":"921","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"6fe2a4b1ebec833dd176555d4e24b81f6e0141da","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":67,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":68,"context_line":"        #        free\u003dmath.floor(1024-1024*0.1)\u003d922"},{"line_number":69,"context_line":"        #        Normalized to 0.84."},{"line_number":70,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":71,"context_line":"        #        free_capacity_gb\u003d300,"}],"source_content_type":"text/x-python","patch_set":4,"id":"da37b569_81c11a83","line":68,"in_reply_to":"fa32b979_b5f68f5b","updated":"2015-06-28 19:13:39.000000000","message":"Fixed all the math in the comments based on debug results.","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        #        Normalized to 0.84."},{"line_number":70,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":71,"context_line":"        #        free_capacity_gb\u003d300,"},{"line_number":72,"context_line":"        #        free\u003dmath.floor(2048*1.5-1748-2048*0.1)\u003d1120"},{"line_number":73,"context_line":"        #        Normalized to 1.0."},{"line_number":74,"context_line":"        # host3: thin_provisioning_support \u003d False"},{"line_number":75,"context_line":"        #        free_capacity_gb\u003d512,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_159e5b07","line":72,"updated":"2015-06-28 00:14:24.000000000","message":"1119","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        #        Normalized to 0.29."},{"line_number":78,"context_line":"        # host4: thin_provisioning_support \u003d True"},{"line_number":79,"context_line":"        #        free_capacity_gb\u003d200,"},{"line_number":80,"context_line":"        #        free\u003dmath.floor(2048*1.0-2047-2048*0.05)\u003d-101"},{"line_number":81,"context_line":"        #        Normalized to 0.0."},{"line_number":82,"context_line":"        # host5: free_capacity_gb\u003d500,"},{"line_number":83,"context_line":"        #        free\u003dmath.floor(2048*1.0-1548-2048*0.05)\u003d398"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_35a11f47","line":80,"updated":"2015-06-28 00:14:24.000000000","message":"-102","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        #        free\u003dmath.floor(2048*1.0-2047-2048*0.05)\u003d-101"},{"line_number":81,"context_line":"        #        Normalized to 0.0."},{"line_number":82,"context_line":"        # host5: free_capacity_gb\u003d500,"},{"line_number":83,"context_line":"        #        free\u003dmath.floor(2048*1.0-1548-2048*0.05)\u003d398"},{"line_number":84,"context_line":"        #        Normalized to 0.41."},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # so, host2 should win:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_d588f3c8","line":83,"updated":"2015-06-28 00:14:24.000000000","message":"397","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":97,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":98,"context_line":"        #        free\u003d-math.floor(1024-1024*0.1)\u003d-922"},{"line_number":99,"context_line":"        #        Normalized to -0.84."},{"line_number":100,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":101,"context_line":"        #        free_capacity_gb\u003d300,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_f583b7a7","line":98,"updated":"2015-06-28 00:14:24.000000000","message":"-921","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        #        Normalized to -0.84."},{"line_number":100,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":101,"context_line":"        #        free_capacity_gb\u003d300,"},{"line_number":102,"context_line":"        #        free\u003d-math.floor(2048*1.5-1748-2048*0.1)\u003d-1120"},{"line_number":103,"context_line":"        #        Normalized to -1.0."},{"line_number":104,"context_line":"        # host3: thin_provisioning_support \u003d False"},{"line_number":105,"context_line":"        #        free_capacity_gb\u003d512,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_15b5fb7c","line":102,"updated":"2015-06-28 00:14:24.000000000","message":"-1119","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        #        Normalized to -0.29."},{"line_number":108,"context_line":"        # host4: thin_provisioning_support \u003d True"},{"line_number":109,"context_line":"        #        free_capacity_gb\u003d200,"},{"line_number":110,"context_line":"        #        free\u003d-math.floor(2048*1.0-2047-2048*0.05)\u003d101"},{"line_number":111,"context_line":"        #        Normalized to 0.0."},{"line_number":112,"context_line":"        # host5: free_capacity_gb\u003d500,"},{"line_number":113,"context_line":"        #        free\u003d-math.floor(2048*1.0-1548-2048*0.05)\u003d-398"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_d5af9329","line":110,"updated":"2015-06-28 00:14:24.000000000","message":"102","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        #        free\u003d-math.floor(2048*1.0-2047-2048*0.05)\u003d101"},{"line_number":111,"context_line":"        #        Normalized to 0.0."},{"line_number":112,"context_line":"        # host5: free_capacity_gb\u003d500,"},{"line_number":113,"context_line":"        #        free\u003d-math.floor(2048*1.0-1548-2048*0.05)\u003d-398"},{"line_number":114,"context_line":"        #        Normalized to -0.41."},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        # so, host4 should win:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_5562a317","line":113,"updated":"2015-06-28 00:14:24.000000000","message":"-397","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"b3df16949762c4b8cb0977f776aa82834e8b31a9","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":118,"context_line":"        self.assertEqual(0.0, weighed_host.weight)"},{"line_number":119,"context_line":"        self.assertEqual("},{"line_number":120,"context_line":"            \u0027host4\u0027, utils.extract_host(weighed_host.obj.host))"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def test_capacity_weight_multiplier2(self):"},{"line_number":123,"context_line":"        self.flags(capacity_weight_multiplier\u003d2.0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_5025d1ab","line":120,"updated":"2015-06-28 00:54:32.000000000","message":"host4 shouldn\u0027t win because it has no space. It would\u0027ve been filtered out. Maybe this test would be more realistic if you removed the one that would always be filtered.","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"d9d2a687a436ebc77a66ba3168d6653c3d93f30f","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        weighed_host \u003d self._get_weighed_host(hostinfo_list)"},{"line_number":118,"context_line":"        self.assertEqual(0.0, weighed_host.weight)"},{"line_number":119,"context_line":"        self.assertEqual("},{"line_number":120,"context_line":"            \u0027host4\u0027, utils.extract_host(weighed_host.obj.host))"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def test_capacity_weight_multiplier2(self):"},{"line_number":123,"context_line":"        self.flags(capacity_weight_multiplier\u003d2.0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_30592d36","line":120,"in_reply_to":"fa32b979_5025d1ab","updated":"2015-06-28 01:33:25.000000000","message":"0.0 is NOT free space. The non-normalized value, the virtual free capacity (101 or 102), is the real \"free\".  0.0 is a normalized value used for ranking, but not used in filtering.\n\nIn the capacity filter,\n\nThe physical free capacity minus reserved:\nfree \u003d math.floor(200-2048*0.05) \u003d 97.6 \u003e 0\n\nProvisioned ratio:\n(2047+1)/2048 \u003d 1 is equal to the max_over_subscription_ratio\n\nSo this will return True in the capacity filter.","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # host1: thin_provisioning_support \u003d False"},{"line_number":127,"context_line":"        #        free_capacity_gb\u003d1024,"},{"line_number":128,"context_line":"        #        free\u003dmath.floor(1024-1024*0.1)*2\u003d1844"},{"line_number":129,"context_line":"        #        Normalized to 1.68."},{"line_number":130,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":131,"context_line":"        #        free_capacity_gb\u003d300,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_156c1b07","line":128,"updated":"2015-06-28 00:14:24.000000000","message":"1842","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        #        Normalized to 1.68."},{"line_number":130,"context_line":"        # host2: thin_provisioning_support \u003d True"},{"line_number":131,"context_line":"        #        free_capacity_gb\u003d300,"},{"line_number":132,"context_line":"        #        free\u003dmath.floor(2048*1.5-1748-2048*0.1)*2\u003d2240"},{"line_number":133,"context_line":"        #        Normalized to 2.0."},{"line_number":134,"context_line":"        # host3: thin_provisioning_support \u003d False"},{"line_number":135,"context_line":"        #        free_capacity_gb\u003d512,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_356fdffd","line":132,"updated":"2015-06-28 00:14:24.000000000","message":"2238","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        #        Normalized to 0.58."},{"line_number":138,"context_line":"        # host4: thin_provisioning_support \u003d True"},{"line_number":139,"context_line":"        #        free_capacity_gb\u003d200,"},{"line_number":140,"context_line":"        #        free\u003dmath.floor(2048*1.0-2047-2048*0.05)*2\u003d-202"},{"line_number":141,"context_line":"        #        Normalized to 0.0."},{"line_number":142,"context_line":"        # host5: free_capacity_gb\u003d500,"},{"line_number":143,"context_line":"        #        free\u003dmath.floor(2048*1.0-1548-2048*0.05)*2\u003d796"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_d576b3d7","line":140,"updated":"2015-06-28 00:14:24.000000000","message":"-204","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"58835d42e648239cc69ead7abbe2cdecac1e0498","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        #        free\u003dmath.floor(2048*1.0-2047-2048*0.05)*2\u003d-202"},{"line_number":141,"context_line":"        #        Normalized to 0.0."},{"line_number":142,"context_line":"        # host5: free_capacity_gb\u003d500,"},{"line_number":143,"context_line":"        #        free\u003dmath.floor(2048*1.0-1548-2048*0.05)*2\u003d796"},{"line_number":144,"context_line":"        #        Normalized to 0.82."},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        # so, host2 should win:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_95802b8d","line":143,"updated":"2015-06-28 00:14:24.000000000","message":"794","commit_id":"fb7911b574b939848cec633c95458ddf4fa304f1"}],"manila/tests/scheduler/test_host_filters.py":[{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            return ret_value"},{"line_number":47,"context_line":"        self.mock_object(utils, \u0027service_is_up\u0027, fake_service_is_up)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_capacity_filter_passes(self):"},{"line_number":50,"context_line":"        self._stub_service_is_up(True)"},{"line_number":51,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":52,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_9af0d392","line":49,"updated":"2015-07-09 08:36:11.000000000","message":"This","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                    \u0027service\u0027: service})"},{"line_number":59,"context_line":"        self.assertTrue(filt_cls.host_passes(host, filter_properties))"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_capacity_filter_current_host_passes(self):"},{"line_number":62,"context_line":"        self._stub_service_is_up(True)"},{"line_number":63,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":64,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100, \u0027share_exists_on\u0027: \u0027host1#pool1\u0027}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_fa3c7f30","line":61,"updated":"2015-07-09 08:36:11.000000000","message":"and this tests could be combined using magic of \"ddt\".","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                                    \u0027service\u0027: service})"},{"line_number":59,"context_line":"        self.assertTrue(filt_cls.host_passes(host, filter_properties))"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_capacity_filter_current_host_passes(self):"},{"line_number":62,"context_line":"        self._stub_service_is_up(True)"},{"line_number":63,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":64,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100, \u0027share_exists_on\u0027: \u0027host1#pool1\u0027}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_557c26b5","line":61,"in_reply_to":"ba3cc151_fa3c7f30","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                                    \u0027service\u0027: service})"},{"line_number":84,"context_line":"        self.assertFalse(filt_cls.host_passes(host, filter_properties))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def test_capacity_filter_fails_free_capacity_None(self):"},{"line_number":87,"context_line":"        self._stub_service_is_up(True)"},{"line_number":88,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":89,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_ba4277a9","line":86,"updated":"2015-07-09 08:36:11.000000000","message":"Same here.","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                                    \u0027service\u0027: service})"},{"line_number":84,"context_line":"        self.assertFalse(filt_cls.host_passes(host, filter_properties))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def test_capacity_filter_fails_free_capacity_None(self):"},{"line_number":87,"context_line":"        self._stub_service_is_up(True)"},{"line_number":88,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":89,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_f5477a78","line":86,"in_reply_to":"ba3cc151_ba4277a9","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"ed5a8173f95d5d93004ab90ed8deb70f9d5cb0d9","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                                    \u0027service\u0027: service})"},{"line_number":117,"context_line":"        self.assertTrue(filt_cls.host_passes(host, filter_properties))"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def test_capacity_filter_passes_total_infinite(self):"},{"line_number":120,"context_line":"        self._stub_service_is_up(True)"},{"line_number":121,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":122,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_1a0a8379","line":119,"updated":"2015-07-09 08:36:11.000000000","message":"And here and below\n\nIt could take much less code lines using \"ddt\".","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"68cf38883fecf51ebe455c4bed5c7b53fa2fa498","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                                    \u0027service\u0027: service})"},{"line_number":117,"context_line":"        self.assertTrue(filt_cls.host_passes(host, filter_properties))"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def test_capacity_filter_passes_total_infinite(self):"},{"line_number":120,"context_line":"        self._stub_service_is_up(True)"},{"line_number":121,"context_line":"        filt_cls \u003d self.class_map[\u0027CapacityFilter\u0027]()"},{"line_number":122,"context_line":"        filter_properties \u003d {\u0027size\u0027: 100}"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_b541f265","line":119,"in_reply_to":"ba3cc151_1a0a8379","updated":"2015-07-10 04:07:41.000000000","message":"Done","commit_id":"2606f208ef6104d989c4a7611527c079a92a1849"}]}
