From d48bba18a7cebc57e63f5b2c5a1e939654de0883 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 9 Aug 2017 10:53:53 -0700 Subject: [PATCH] Mark Chance and Caching schedulers as deprecated FilterScheduler with Placement should replace both of these. Mark them as deprecated now so the timer starts. Change-Id: Ia7ff98ff28b7265058845e46b277317a2bfc96d2 --- nova/conf/scheduler.py | 4 ++-- nova/scheduler/caching_scheduler.py | 6 ++++++ nova/scheduler/chance.py | 8 ++++++++ .../notes/scheduler-deprecation-20d035193c7392e4.yaml | 9 +++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/scheduler-deprecation-20d035193c7392e4.yaml diff --git a/nova/conf/scheduler.py b/nova/conf/scheduler.py index 3aefed75bd1f..7d3c628e39f0 100644 --- a/nova/conf/scheduler.py +++ b/nova/conf/scheduler.py @@ -46,8 +46,8 @@ Other options are: * 'caching_scheduler' which aggressively caches the system state for better individual scheduler performance at the risk of more retries when running - multiple schedulers. -* 'chance_scheduler' which simply picks a host at random. + multiple schedulers. [DEPRECATED] +* 'chance_scheduler' which simply picks a host at random. [DEPRECATED] * 'fake_scheduler' which is used for testing. Possible values: diff --git a/nova/scheduler/caching_scheduler.py b/nova/scheduler/caching_scheduler.py index 52cab73cc9cf..e53c42e777fa 100644 --- a/nova/scheduler/caching_scheduler.py +++ b/nova/scheduler/caching_scheduler.py @@ -16,8 +16,12 @@ import collections import itertools +from oslo_log import log as logging + from nova.scheduler import filter_scheduler +LOG = logging.getLogger(__name__) + class CachingScheduler(filter_scheduler.FilterScheduler): """Scheduler to test aggressive caching of the host list. @@ -58,6 +62,8 @@ class CachingScheduler(filter_scheduler.FilterScheduler): def __init__(self, *args, **kwargs): super(CachingScheduler, self).__init__(*args, **kwargs) self.all_host_states = None + LOG.warning('CachingScheduler is deprecated in Pike and will be ' + 'removed in a subsequent release.') def run_periodic_tasks(self, context): """Called from a periodic tasks in the manager.""" diff --git a/nova/scheduler/chance.py b/nova/scheduler/chance.py index 44d9c746836e..1be05be8f807 100644 --- a/nova/scheduler/chance.py +++ b/nova/scheduler/chance.py @@ -21,6 +21,8 @@ Chance (Random) Scheduler implementation import random +from oslo_log import log as logging + from nova.compute import rpcapi as compute_rpcapi import nova.conf from nova import exception @@ -28,6 +30,7 @@ from nova.i18n import _ from nova.scheduler import driver CONF = nova.conf.CONF +LOG = logging.getLogger(__name__) class ChanceScheduler(driver.Scheduler): @@ -35,6 +38,11 @@ class ChanceScheduler(driver.Scheduler): USES_ALLOCATION_CANDIDATES = False + def __init__(self, *args, **kwargs): + super(ChanceScheduler, self).__init__(*args, **kwargs) + LOG.warning('ChanceScheduler is deprecated in Pike and will be ' + 'removed in a subsequent release.') + def _filter_hosts(self, hosts, spec_obj): """Filter a list of hosts based on RequestSpec.""" diff --git a/releasenotes/notes/scheduler-deprecation-20d035193c7392e4.yaml b/releasenotes/notes/scheduler-deprecation-20d035193c7392e4.yaml new file mode 100644 index 000000000000..ce604db46a14 --- /dev/null +++ b/releasenotes/notes/scheduler-deprecation-20d035193c7392e4.yaml @@ -0,0 +1,9 @@ +--- +deprecations: + - | + The CachingScheduler and ChanceScheduler drivers are deprecated in Pike. + These are not integrated with the placement service, and their primary + purpose (speed over correctness) should be addressed by the default + FilterScheduler going forward. If ChanceScheduler behavior is desired + (i.e. speed trumps correctness) then configuring the FilterScheduler with + no enabled filters should approximate that behavior.