Merge "Update Provisioning Improvements"

This commit is contained in:
Zuul 2018-03-09 03:26:44 +00:00 committed by Gerrit Code Review
commit 3111f1e96e

View File

@ -315,34 +315,37 @@ reporting the `allocated_capacity_gb` field.
Automatic over subscription ratio calculation Automatic over subscription ratio calculation
--------------------------------------------- ---------------------------------------------
To allow automatic over subscription ratio calculation we will add a new To allow automatic over subscription ratio calculation we will make existing
configuration option named `auto_max_over_subscription_ratio` that will configuration option `max_over_subscription_ratio` into a polymorphic option
instruct Cinder to use configured `max_over_subscription_ratio` as a starting that accepts not only integers and floats, but also a new string value `auto`
that will instruct Cinder to use our default value of 20 as the starting
reference when the backend is empty and then, when there is data calculate the reference when the backend is empty and then, when there is data calculate the
current value on each driver stats report with the following formula:: current value on each driver stats report with the following formula::
adjusted_total = `total_capacity_gb` x (1 - (`reserved_percentage` / 100.0)) ratio = 1 + (`provisioned_capacity_gb` /
ratio = `provisioned_capacity_gb` / adjusted_total - `free_capacity_gb` (`total_capacity_gb` - `free_capacity_gb` + 1))
If the driver is not reporting `provisioned_capacity_gb` then we'll proceed to If the driver is not reporting `provisioned_capacity_gb` then we'll proceed to
use the `allocated_capacity_gb` instead:: use the `allocated_capacity_gb` instead::
adjusted_total = `total_capacity_gb` x (1 - (`reserved_percentage` / 100.0)) ratio = 1 + (`allocated_capacity_gb` /
ratio = `allocated_capacity_gb` / adjusted_total - `free_capacity_gb` (`total_capacity_gb` - `free_capacity_gb` + 1))
This new configuration option will be independent of the drivers and it will be We are not considering the reserved capacity in this formula because the
part of Cinder's core code, so if `auto_max_over_subscription_ratio` is not scheduler's capacity filter already takes it into consideration when
defined or set to `False` then Cinder will continue behaving as it is now calculating the virtual free capacity.
(returning the `max_over_subscription_ratio` that is reported by the driver or
the one configured by default if not present). But if it is set to True it
will always return calculated ratio as explained.
There are a couple of drivers that are already doing this, Pure and Kaminario's There are a couple of drivers that are already doing this, Pure and Kaminario's
K2, but with different configuration options, K2, but with different configuration options,
`pure_automatic_max_oversubscription_ratio` and `pure_automatic_max_oversubscription_ratio` and
`auto_calc_max_oversubscription_ratio` respectively, so we'll deprecate those `auto_calc_max_oversubscription_ratio` respectively, so those configuration
configuration options and remove the code within those drivers when we add the options will take precedence, if configured, over this new feature, but we'll
generic code to Cinder. encourage vendors to deprecate those options.
Drivers that are making use of the `max_over_subscription_ratio` in a non
compatible way will raise an error and fail to start, logging an appropriate
message if configured with this new feature.
Provisioning calculations Provisioning calculations
------------------------- -------------------------
@ -416,23 +419,26 @@ failures on creating volumes until we correct the values of
`reserved_percentage` and `max_over_subscription_ratio` in our cloud to the `reserved_percentage` and `max_over_subscription_ratio` in our cloud to the
right values, since we may have been using incorrect ones. right values, since we may have been using incorrect ones.
Two new configuration options will be added: A configuration option will be modified:
* `auto_max_over_subscription_ratio`: Boolean value that will instruct Cinder * `max_over_subscription_ratio`: Changes its type from Float to String and
to automatically calculate the over subscription ratio based on current usage adds a new possible value, `auto`, that will enable this new feature.
instead of using a fixed value.
A new configuration options will be added:
* `over_provisioning_calculation`: Will allow to select what kind of * `over_provisioning_calculation`: Will allow to select what kind of
calculations the `CapacityFilter` does to determine if there is space for a calculations the `CapacityFilter` does to determine if there is space for a
volume in a backend. Acceptable values are `standard` and `cinder`. Default volume in a backend. Acceptable values are `standard` and `cinder`. Default
values will be `cinder`. values will be `cinder`.
Developer impact Developer impact
---------------- ----------------
Driver maintainer will need to verify, and fix if necessary, their stat reports Driver maintainer will need to verify, and fix if necessary, their stat reports
for `allocated_capacity_gb` and `provisioned_capacity_gb` unless they start for `allocated_capacity_gb` and `provisioned_capacity_gb` and if they are using
using the new `auto_max_over_subscription_ratio` configuration option. `max_over_subscription_ratio` in a non compatible way they should fix their
driver so that it supports the feature.
Implementation Implementation
============== ==============