Scheduler

The cinder.scheduler.manager Module

Scheduler Service

class SchedulerManager(scheduler_driver=None, service_name=None, *args, **kwargs)

Bases: cinder.manager.Manager

Chooses a host to create volumes.

SchedulerManager.RPC_API_VERSION = '1.7'
SchedulerManager.create_consistencygroup(context, topic, group_id, request_spec_list=None, filter_properties_list=None)
SchedulerManager.create_volume(context, topic, volume_id, snapshot_id=None, image_id=None, request_spec=None, filter_properties=None)
SchedulerManager.get_pools(context, filters=None)

Get active pools from scheduler’s cache.

SchedulerManager.init_host()
SchedulerManager.manage_existing(context, topic, volume_id, request_spec, filter_properties=None)

Ensure that the host exists and can accept the volume.

SchedulerManager.migrate_volume_to_host(context, topic, volume_id, host, force_host_copy, request_spec, filter_properties=None)

Ensure that the host exists and can accept the volume.

SchedulerManager.request_service_capabilities(context)
SchedulerManager.retype(context, topic, volume_id, request_spec, filter_properties=None)

Schedule the modification of a volume’s type.

Parameters:
  • context – the request context
  • topic – the topic listened on
  • volume_id – the ID of the volume to retype
  • request_spec – parameters for this retype request
  • filter_properties – parameters to filter by
SchedulerManager.target = <Target version=1.7>
SchedulerManager.update_service_capabilities(context, service_name=None, host=None, capabilities=None, **kwargs)

Process a capability update from a service node.

The cinder.scheduler.driver Module

Scheduler base class that all Schedulers should inherit from

class Scheduler

Bases: object

The base class that all Scheduler classes should inherit from.

Scheduler.find_retype_host(context, request_spec, filter_properties=None, migration_policy='never')

Find a host that can accept the volume with its new type.

Scheduler.get_pools(context, filters)

Must override schedule method for scheduler to work.

Scheduler.host_passes_filters(context, volume_id, host, filter_properties)

Check if the specified host passes the filters.

Scheduler.schedule(context, topic, method, *_args, **_kwargs)

Must override schedule method for scheduler to work.

Scheduler.schedule_create_consistencygroup(context, group_id, request_spec_list, filter_properties_list)

Must override schedule method for scheduler to work.

Scheduler.schedule_create_volume(context, request_spec, filter_properties)

Must override schedule method for scheduler to work.

Scheduler.update_service_capabilities(service_name, host, capabilities)

Process a capability update from a service node.

group_update_db(context, group_id, host)

Set the host and the scheduled_at field of a consistencygroup.

Returns:A Consistencygroup with the updated fields set properly.
volume_update_db(context, volume_id, host)

Set the host and set the scheduled_at field of a volume.

Returns:A Volume with the updated fields set properly.

The cinder.scheduler.filter_scheduler Driver

The FilterScheduler is for creating volumes. You can customize this scheduler by specifying your own volume Filters and Weighing Functions.

class FilterScheduler(*args, **kwargs)

Bases: cinder.scheduler.driver.Scheduler

Scheduler that can be used for filtering and weighing.

FilterScheduler.find_retype_host(context, request_spec, filter_properties=None, migration_policy='never')

Find a host that can accept the volume with its new type.

FilterScheduler.get_pools(context, filters)
FilterScheduler.host_passes_filters(context, host, request_spec, filter_properties)

Check if the specified host passes the filters.

FilterScheduler.populate_filter_properties(request_spec, filter_properties)

Stuff things into filter_properties. Can be overridden in a subclass to add more data.

FilterScheduler.schedule(context, topic, method, *args, **kwargs)

The schedule() contract requires we return the one best-suited host for this request.

FilterScheduler.schedule_create_consistencygroup(context, group_id, request_spec_list, filter_properties_list)
FilterScheduler.schedule_create_volume(context, request_spec, filter_properties)

Tests

The scheduler_unittest Module

Table Of Contents

Previous topic

API Endpoint

Next topic

Fake Drivers

This Page