diff --git a/cinder/scheduler/weights/capacity.py b/cinder/scheduler/weights/capacity.py index 61da8243a03..daeb7f24c7e 100644 --- a/cinder/scheduler/weights/capacity.py +++ b/cinder/scheduler/weights/capacity.py @@ -15,30 +15,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -""" -Weighers that weigh hosts by their capacity, including following two -weighers: - -1. Capacity Weigher. Weigh hosts by their virtual or actual free capacity. - -For thin provisioning, weigh hosts by their virtual free capacity calculated -by the total capacity multiplied by the max over subscription ratio and -subtracting the provisioned capacity; Otherwise, weigh hosts by their actual -free capacity, taking into account the reserved space. - -The default is to spread volumes across all hosts evenly. If you prefer -stacking, you can set the 'capacity_weight_multiplier' option to a negative -number and the weighing has the opposite effect of the default. - -2. Allocated Capacity Weigher. Weigh hosts by their allocated capacity. - -The default behavior is to place new volume to the host allocated the least -space. This weigher is intended to simulate the behavior of SimpleScheduler. -If you prefer to place volumes to host allocated the most space, you can -set the 'allocated_capacity_weight_multiplier' option to a positive number -and the weighing has the opposite effect of the default. -""" - import math @@ -67,6 +43,18 @@ OFFSET_MULT = 100 class CapacityWeigher(weights.BaseHostWeigher): + """Capacity Weigher weighs hosts by their virtual or actual free capacity. + + For thin provisioning, weigh hosts by their virtual free capacity + calculated by the total capacity multiplied by the max over subscription + ratio and subtracting the provisioned capacity; Otherwise, weigh hosts by + their actual free capacity, taking into account the reserved space. + + The default is to spread volumes across all hosts evenly. If you prefer + stacking, you can set the ``capacity_weight_multiplier`` option to a + negative number and the weighing has the opposite effect of the default. + + """ def weight_multiplier(self): """Override the weight multiplier.""" return CONF.capacity_weight_multiplier @@ -138,6 +126,15 @@ class CapacityWeigher(weights.BaseHostWeigher): class AllocatedCapacityWeigher(weights.BaseHostWeigher): + """Allocated Capacity Weigher weighs hosts by their allocated capacity. + + The default behavior is to place new volume to the host allocated the least + space. This weigher is intended to simulate the behavior of + SimpleScheduler. If you prefer to place volumes to host allocated the most + space, you can set the ``allocated_capacity_weight_multiplier`` option to a + positive number and the weighing has the opposite effect of the default. + """ + def weight_multiplier(self): """Override the weight multiplier.""" return CONF.allocated_capacity_weight_multiplier diff --git a/cinder/scheduler/weights/chance.py b/cinder/scheduler/weights/chance.py index 809e7548da6..901c2a4e17c 100644 --- a/cinder/scheduler/weights/chance.py +++ b/cinder/scheduler/weights/chance.py @@ -11,12 +11,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -""" -Chance Weigher. Assign random weights to hosts. - -Used to spread volumes randomly across a list of equally suitable hosts. -""" - import random @@ -24,5 +18,9 @@ from cinder.scheduler import weights class ChanceWeigher(weights.BaseHostWeigher): + """Chance Weigher assigns random weights to hosts. + + Used to spread volumes randomly across a list of equally suitable hosts. + """ def _weigh_object(self, host_state, weight_properties): return random.random() diff --git a/cinder/scheduler/weights/volume_number.py b/cinder/scheduler/weights/volume_number.py index 0a3a510b90f..cd641ddbf9f 100644 --- a/cinder/scheduler/weights/volume_number.py +++ b/cinder/scheduler/weights/volume_number.py @@ -12,15 +12,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -"""Weighers that weigh hosts by volume number in backends: - -1. Volume Number Weigher. Weigh hosts by their volume number. - -The default is to spread volumes across all hosts evenly. If you prefer -stacking, you can set the 'volume_number_multiplier' option to a positive -number and the weighing has the opposite effect of the default. -""" - from oslo_config import cfg @@ -40,6 +31,13 @@ CONF.register_opts(volume_number_weight_opts) class VolumeNumberWeigher(weights.BaseHostWeigher): + """Weigher that weighs hosts by volume number in backends. + + The default is to spread volumes across all hosts evenly. If you prefer + stacking, you can set the ``volume_number_multiplier`` option to a positive + number and the weighing has the opposite effect of the default. + """ + def weight_multiplier(self): """Override the weight multiplier.""" return CONF.volume_number_multiplier diff --git a/doc/source/database_architecture.rst b/doc/source/database_architecture.rst deleted file mode 100644 index 9a635118453..00000000000 --- a/doc/source/database_architecture.rst +++ /dev/null @@ -1,9 +0,0 @@ -============================== - Cinder Database Architecture -============================== - -Cinder Database Backends -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. list-plugins:: cinder.database.migration_backend - :detailed: diff --git a/doc/source/oslo-middleware.rst b/doc/source/oslo-middleware.rst deleted file mode 100644 index 60aa9ba8e1e..00000000000 --- a/doc/source/oslo-middleware.rst +++ /dev/null @@ -1,6 +0,0 @@ -========================== - Oslo Middleware -========================== - -.. list-plugins:: oslo_middleware - :detailed: