Merge "Mark Chance and Caching schedulers as deprecated"

This commit is contained in:
Jenkins 2017-08-10 10:57:36 +00:00 committed by Gerrit Code Review
commit fc472decb8
4 changed files with 25 additions and 2 deletions

View File

@ -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:

View File

@ -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."""

View File

@ -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."""

View File

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