accounting bug for lvm with thin provisioning and max_over_subscription_ratio=1

Bug #1537162 reported by Chris Friesen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Michael Rowden

Bug Description

The following was discovered on stable/kilo but I think it applies to current master as well.

When using thin provisioning with LVM, the driver reports the actual free space as free_capacity_gb. This means that we could allocate a volume the size of the thin pool, but if we haven't written to it we will still report a large amount in free_capacity_gb.

In the capacity filter there is logic that looks like this:

        if (host_state.thin_provisioning_support and
                host_state.max_over_subscription_ratio > 1):
            <handle thin provisioning case>

        if free < volume_size:
            return False

        return True

The problem is that if we have thin provisioning enabled, but max_over_subscription_ratio set to 1, then we will not use the thin provisioning logic (which would be correct) but rather we look at the "free" value (which doesn't account for space that has been provisioned but not yet consumed).

I think the fix is to change the above to use "host_state.max_over_subscription_ratio >= 1" so that the thin-provisioning-aware code is used for the case when the ratio is 1. If we don't do that, then we'll need to change how the lvm driver reports free space when the ratio is 1.

Changed in cinder:
assignee: nobody → Siva Mullapudi (scmullap)
Changed in cinder:
assignee: Siva Mullapudi (scmullap) → Michael Rowden (mrrowden)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/275408

Changed in cinder:
status: New → In Progress
Changed in cinder:
assignee: Michael Rowden (mrrowden) → Eric Harney (eharney)
Eric Harney (eharney)
Changed in cinder:
assignee: Eric Harney (eharney) → Michael Rowden (mrrowden)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/275408
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c9667987ce8b395b6e5920ad221807706f8b2403
Submitter: Jenkins
Branch: master

commit c9667987ce8b395b6e5920ad221807706f8b2403
Author: Michael Rowden <email address hidden>
Date: Tue Feb 2 13:55:15 2016 -0600

    Correcting thin provisioning behavior

    Currently, if thin provisioning is enabled and
    max_over_subscription_ratio <= 1, the code will not go through the
    thin-provisioning aware code, thereby ignoring any limits from
    max_over_subscription_ratio. The intended behavior of setting
    max_over_subscription_ratio = 1 is to disable over-provisioning.
    Fixed help string to state minimum of 1.0 for
    max_over_subscription_ratio.

    Change-Id: I0ac265905e0613691238e7fcd60853c838118fcc
    Closes-Bug: #1537162
    Co-Authored-By: Siva Mullapudi <email address hidden>

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/cinder 8.0.0.0rc1

This issue was fixed in the openstack/cinder 8.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.