]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix capacity filter to allow oversubscription
authorXing Yang <xing.yang@emc.com>
Wed, 27 May 2015 16:58:04 +0000 (12:58 -0400)
committerXing Yang <xing.yang@emc.com>
Fri, 29 May 2015 18:52:21 +0000 (14:52 -0400)
commit75953752e41819b0d2ca770d4d13ed1ccaec685a
treea90c171a706f03881db0601ac15d6b7cbad93df6
parent275912c6cc28cbb584f0cc660e50d4bb247f3bc9
Fix capacity filter to allow oversubscription

Currently the capacity filter does not allow oversubscrition
if the free physical capacity is less than the new volume size.
This was based on the assumption that a new thinly provisioned
volume will be consumed right away. This assumption does not
allow us to take full advantage of thin provisioning.

The fix is to allow oversubscription if thin provisioning is
supported and max_over_subscription_ratio is greater than or
equal to 1. The free physical capacity will not be used to
compare with the new volume size for a backend that supports
oversubscription in thin provisioning. The oversubscription
ratio and virtual free capacity will still be used to decide
whether a backend can be chosen for thin provisioning.

Closes-Bug: #1458976
Change-Id: I4c8904445654db839c25ded420915f83c3756f94
cinder/scheduler/filters/capacity_filter.py
cinder/tests/unit/scheduler/test_host_filters.py