Scheduler Service
Bases: manila.manager.Manager
Chooses a host to create shares.
Get a list of hosts from the HostManager.
Get active pools from the scheduler’s cache.
Get the normalized set of capabilities for this zone.
Ensure that the host exists and can accept the share.
Ensure that the host exists and can accept the share.
Process a capability update from a service node.
A common base for handling extension classes.
Used by BaseFilterHandler and BaseWeightHandler
Bases: object
Base class to handle loading filter and weight classes.
Manage hosts in the current zone.
Bases: object
Base HostManager class.
Returns a dict of all the hosts the HostManager knows about.
Each of the consumable resources in HostState are populated with capabilities scheduler received from RPC.
Filter hosts and return only ones passing all filters.
Returns a dict of all pools on all hosts HostManager knows about.
Weigh the hosts.
alias of HostState
Update the per-service capabilities based on this notification.
Bases: object
Mutable and immutable information tracked for a host.
Incrementally update host state from an share.
Update information about a host from its share_node info.
‘capability’ is the status info reported by share backend, a typical capability looks like this:
capability = {
'share_backend_name': 'Local NFS', # 'vendor_name': 'OpenStack', # backend level
'driver_version': '1.0', # mandatory/fixed
'storage_protocol': 'NFS', #/ stats&capabilities
'active_shares': 10, # 'IOPS_provisioned': 30000, # optional custom
'fancy_capability_1': 'eat', # stats & capabilities
'fancy_capability_2': 'drink', #/
'pools':[
{
'pool_name': '1st pool', # 'total_capacity_gb': 500, # mandatory stats
'free_capacity_gb': 230, # for pools
'allocated_capacity_gb': 270, # |
'qos': 'False', # |
'reserved_percentage': 0, #/
'dying_disks': 100, # 'super_hero_1': 'spider-man', # optional custom
'super_hero_2': 'flash', # stats &
'super_hero_3': 'neoncat', # capabilities
'super_hero_4': 'green lantern', #/
},
{
'pool_name': '2nd pool',
'total_capacity_gb': 1024,
'free_capacity_gb': 1024,
'allocated_capacity_gb': 0,
'qos': 'False',
'reserved_percentage': 0,
'dying_disks': 200,
'super_hero_1': 'superman',
'super_hero_2': 'Hulk',
}]
}
Update storage pools information from backend reported info.
Bases: manila.scheduler.host_manager.HostState
Update information about a pool from its share_node info.
Bases: UserDict.IterableUserDict
A read-only dict.
Client side of the scheduler manager RPC API.
Bases: object
Client side of the scheduler rpc API.
API version history:
1.0 - Initial version. 1.1 - Add get_pools method 1.2 - Introduce Share Instances. Replace create_share() with create_share_instance() 1.3 - Add create_consistency_group method 1.4 - Add migrate_share_to_host method 1.5 - Add create_share_replica 1.6 - Add manage_share
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.
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.
Check the json file for changes and load it if needed.
The FilterScheduler is for creating shares. You can customize this scheduler by specifying your own share Filters and Weighing Functions.
Bases: manila.scheduler.drivers.base.Scheduler
Scheduler that can be used for filtering and weighing.
Stuff things into filter_properties.
Can be overridden in a subclass to add more data.
Scheduler base class that all Schedulers should inherit from
Bases: object
The base class that all Scheduler classes should inherit from.
Get a list of hosts from the HostManager.
Must override schedule method for scheduler to work.
Get the normalized set of capabilities for the services.
Must override schedule method for migration to work.
Return the list of hosts that have a running service for topic.
Must override schedule method for scheduler to work.
Must override schedule method for scheduler to work.
Must override schedule method for create replica to work.
Must override schedule method for scheduler to work.
Process a capability update from a service node.
Set the host and set the updated_at field of a consistency group.
Returns: | A CG with the updated fields set properly. |
---|
Set the host and the scheduled_at field of a share replica.
Returns: | A Share Replica with the updated fields set. |
---|
Set the host and set the scheduled_at field of a share.
Returns: | A Share with the updated fields set properly. |
---|
Chance (Random) Scheduler implementation
Bases: manila.scheduler.drivers.base.Scheduler
Implements Scheduler as a random node selector.
Picks a host that is up at random.
Simple Scheduler
Bases: manila.scheduler.drivers.chance.ChanceScheduler
Implements Naive Scheduler that tries to find least loaded host.
Picks a host that is up and has the fewest shares.
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Filters Hosts by availability zone.
Filter support
Bases: object
Base class for all filter classes.
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.
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.
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 objects after filter
Parameters: |
|
---|
Scheduler host filters
Bases: manila.scheduler.filters.base.BaseFilter
Base class for host filters.
Return True if the HostState passes the filter, otherwise False.
Override this in a subclass.
Bases: manila.scheduler.filters.base.BaseFilterHandler
Bases: manila.scheduler.filters.base_host.BaseHostFilter
HostFilter to work with resource (instance & volume) type records.
Return a list of hosts that can create resource_type.
Bases: manila.scheduler.filters.base_host.BaseHostFilter
CapacityFilter filters based on share host’s capacity utilization.
Return True if host has sufficient capacity.
Bases: manila.scheduler.filters.base_host.BaseHostFilter
ConsistencyGroupFilter filters host based on compatibility with CG.
Return True if host will work with desired consistency group.
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,
}
}
Skip nodes that have already been attempted.
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Host Filter to allow simple JSON-based grammar for selecting hosts.
Filters hosts.
Return a list of hosts that can fulfill the requirements specified in the query.
Bases: manila.scheduler.filters.base_host.BaseHostFilter
Filter out already tried nodes for scheduling purposes.
Skip nodes that have already been attempted.
Pluggable Weighing support
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.
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.
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.
Bases: manila.scheduler.base_handler.BaseHandler
Return a sorted (descending), normalized list of WeighedObjects.
alias of WeighedObject
Bases: object
Object with weight information.
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.
Scheduler host weighers
Bases: manila.scheduler.weighers.base.BaseWeigher
Base class for host weighers.
Bases: manila.scheduler.weighers.base.BaseWeightHandler
alias of WeighedHost
Bases: manila.scheduler.weighers.base.WeighedObject
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.
Bases: manila.scheduler.weighers.base_host.BaseHostWeigher
Override the weight multiplier.
Bases: manila.scheduler.weighers.base_host.BaseHostWeigher
Override the weight multiplier.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.