manila.scheduler.manager
Module¶manila.scheduler.base_handler
Module¶A common base for handling extension classes.
Used by BaseFilterHandler and BaseWeightHandler
BaseHandler
(modifier_class_type, modifier_namespace)Bases: object
Base class to handle loading filter and weight classes.
get_all_classes
()manila.scheduler.host_manager
Module¶manila.scheduler.rpcapi
Module¶manila.scheduler.scheduler_options
Module¶SchedulerOptions monitors a local .json file for changes and loads it if needed. This file is converted to a data structure and passed into the filtering and weighing functions which can use it for dynamic configuration.
SchedulerOptions
Bases: object
Monitor and load local .json file for filtering and weighing.
SchedulerOptions monitors a local .json file for changes and loads it if needed. This file is converted to a data structure and passed into the filtering and weighing functions which can use it for dynamic configuration.
get_configuration
(filename=None)Check the json file for changes and load it if needed.
manila.scheduler.drivers.filter
Module¶manila.scheduler.drivers.base
Module¶manila.scheduler.drivers.chance
Module¶manila.scheduler.drivers.simple
Module¶manila.scheduler.filters.availability_zone
Filter¶AvailabilityZoneFilter
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Filters Hosts by availability zone.
host_passes
(host_state, filter_properties)run_filter_once_per_request
= Truemanila.scheduler.filters.base
Filter¶Filter support
BaseFilter
Bases: object
Base class for all filter classes.
filter_all
(filter_obj_list, filter_properties)Yield objects that pass the filter.
Can be overridden in a subclass, if you need to base filtering decisions on all objects. Otherwise, one can just override _filter_one() to filter a single object.
run_filter_for_index
(index)Check if filter needs to be run for the “index-th” instance.
Return True if the filter needs to be run for the “index-th” instance in a request. Only need to override this if a filter needs anything other than “first only” or “all” behaviour.
run_filter_once_per_request
= FalseBaseFilterHandler
(modifier_class_type, modifier_namespace)Bases: manila.scheduler.base_handler.BaseHandler
Base class to handle loading filter classes.
This class should be subclassed where one needs to use filters.
get_filtered_objects
(filter_classes, objs, filter_properties, index=0)Get objects after filter
Parameters: |
|
---|
manila.scheduler.filters.base_host
Filter¶Scheduler host filters
BaseHostFilter
Bases: manila.scheduler.filters.base.BaseFilter
Base class for host filters.
host_passes
(host_state, filter_properties)Return True if the HostState passes the filter, otherwise False.
Override this in a subclass.
HostFilterHandler
(namespace)Bases: manila.scheduler.filters.base.BaseFilterHandler
manila.scheduler.filters.capabilities
Filter¶CapabilitiesFilter
Bases: manila.scheduler.filters.base_host.BaseHostFilter
HostFilter to work with resource (instance & volume) type records.
host_passes
(host_state, filter_properties)Return a list of hosts that can create resource_type.
manila.scheduler.filters.capacity
Filter¶CapacityFilter
Bases: manila.scheduler.filters.base_host.BaseHostFilter
CapacityFilter filters based on share host’s capacity utilization.
host_passes
(host_state, filter_properties)Return True if host has sufficient capacity.
manila.scheduler.filters.extra_specs_ops
Filter¶match
(value, req)manila.scheduler.filters.ignore_attempted_hosts
Filter¶IgnoreAttemptedHostsFilter
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Filter out previously attempted hosts
A host passes this filter if it has not already been attempted for scheduling. The scheduler needs to add previously attempted hosts to the ‘retry’ key of filter_properties in order for this to work correctly. For example:
{
'retry': {
'hosts': ['host1', 'host2'],
'num_attempts': 3,
}
}
host_passes
(host_state, filter_properties)Skip nodes that have already been attempted.
manila.scheduler.filters.json
Filter¶JsonFilter
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Host Filter to allow simple JSON-based grammar for selecting hosts.
commands
= {'<': <function _less_than at 0x7fd4999f6a28>, '<=': <function _less_than_equal at 0x7fd4999f6b90>, '=': <function _equals at 0x7fd4999f69b0>, '>': <function _greater_than at 0x7fd4999f6aa0>, '>=': <function _greater_than_equal at 0x7fd4999f6c08>, 'and': <function _and at 0x7fd4999f6d70>, 'in': <function _in at 0x7fd4999f6b18>, 'not': <function _not at 0x7fd4999f6c80>, 'or': <function _or at 0x7fd4999f6cf8>}host_passes
(host_state, filter_properties)Filters hosts.
Return a list of hosts that can fulfill the requirements specified in the query.
manila.scheduler.filters.retry
Filter¶RetryFilter
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Filter out already tried nodes for scheduling purposes.
host_passes
(host_state, filter_properties)Skip nodes that have already been attempted.
manila.scheduler.weighers.base
Weigher¶Pluggable Weighing support
BaseWeigher
Bases: object
Base class for pluggable weighers.
The attributes maxval and minval can be specified to set up the maximum and minimum values for the weighed objects. These values will then be taken into account in the normalization step, instead of taking the values from the calculated weighers.
maxval
= Noneminval
= Noneweigh_objects
(weighed_obj_list, weight_properties)Weigh multiple objects.
Override in a subclass if you need access to all objects in order to calculate weighers. Do not modify the weight of an object here, just return a list of weighers.
weight_multiplier
()How weighted this weigher should be.
Override this method in a subclass, so that the returned value is read from a configuration option to permit operators specify a multiplier for the weigher.
BaseWeightHandler
(modifier_class_type, modifier_namespace)Bases: manila.scheduler.base_handler.BaseHandler
get_weighed_objects
(weigher_classes, obj_list, weighing_properties)Return a sorted (descending), normalized list of WeighedObjects.
object_class
alias of WeighedObject
WeighedObject
(obj, weight)Bases: object
Object with weight information.
normalize
(weight_list, minval=None, maxval=None)Normalize the values in a list between 0 and 1.0.
The normalization is made regarding the lower and upper values present in weight_list. If the minval and/or maxval parameters are set, these values will be used instead of the minimum and maximum from the list.
If all the values are equal, they are normalized to 0.
manila.scheduler.weighers.base_host
Weigher¶Scheduler host weighers
BaseHostWeigher
Bases: manila.scheduler.weighers.base.BaseWeigher
Base class for host weighers.
HostWeightHandler
(namespace)Bases: manila.scheduler.weighers.base.BaseWeightHandler
object_class
alias of WeighedHost
WeighedHost
(obj, weight)Bases: manila.scheduler.weighers.base.WeighedObject
to_dict
()manila.scheduler.weighers.capacity
Weigher¶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 shares 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.
CapacityWeigher
Bases: manila.scheduler.weighers.base_host.BaseHostWeigher
weigh_objects
(weighed_obj_list, weight_properties)weight_multiplier
()Override the weight multiplier.
manila.scheduler.weighers.pool
Weigher¶Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.