The cinder.scheduler.weights.capacity Module

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.

  1. 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.

class AllocatedCapacityWeigher

Bases: cinder.openstack.common.scheduler.weights.BaseHostWeigher

weight_multiplier()

Override the weight multiplier.

class CapacityWeigher

Bases: cinder.openstack.common.scheduler.weights.BaseHostWeigher

weigh_objects(weighed_obj_list, weight_properties)

Override the weigh objects.

This override calls the parent to do the weigh objects and then replaces any infinite weights with a value that is a multiple of the delta between the min and max values.

NOTE(jecarey): the infinite weight value is only used when the smallest value is being favored (negative multiplier). When the largest weight value is being used a weight of -1 is used instead. See _weigh_object method.

weight_multiplier()

Override the weight multiplier.

Previous topic

The cinder.scheduler.scheduler_options Module

Next topic

The cinder.scheduler.weights.chance Module

Project Source

This Page