Drop support for custom schedulers
We deprecated this functionality in Ussuri and can now remove it. It's highly unlikely that there exists a functioning alternative to this scheduler and it's not something we can really support nowadays. Change-Id: I546d3d329a69acaad3ada48ccbfddf3a274b6ce2 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -27,7 +27,7 @@ import nova.conf
|
|||||||
from nova.conf import remote_debug
|
from nova.conf import remote_debug
|
||||||
from nova import config
|
from nova import config
|
||||||
from nova import objects
|
from nova import objects
|
||||||
from nova.scheduler import rpcapi as scheduler_rpcapi
|
from nova.scheduler import rpcapi
|
||||||
from nova import service
|
from nova import service
|
||||||
from nova import version
|
from nova import version
|
||||||
|
|
||||||
@@ -44,13 +44,11 @@ def main():
|
|||||||
|
|
||||||
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
|
gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
|
||||||
|
|
||||||
server = service.Service.create(binary='nova-scheduler',
|
server = service.Service.create(
|
||||||
topic=scheduler_rpcapi.RPC_TOPIC)
|
binary='nova-scheduler', topic=rpcapi.RPC_TOPIC)
|
||||||
|
|
||||||
# Determine the number of workers; if not specified in config, default
|
# Determine the number of workers; if not specified in config, default
|
||||||
# to ncpu for the FilterScheduler and 1 for everything else.
|
# to number of CPUs
|
||||||
workers = CONF.scheduler.workers
|
workers = CONF.scheduler.workers or processutils.get_worker_count()
|
||||||
if not workers:
|
|
||||||
workers = (processutils.get_worker_count()
|
|
||||||
if CONF.scheduler.driver == 'filter_scheduler' else 1)
|
|
||||||
service.serve(server, workers=workers)
|
service.serve(server, workers=workers)
|
||||||
service.wait()
|
service.wait()
|
||||||
|
|||||||
@@ -22,39 +22,6 @@ scheduler_group = cfg.OptGroup(name="scheduler",
|
|||||||
title="Scheduler configuration")
|
title="Scheduler configuration")
|
||||||
|
|
||||||
scheduler_opts = [
|
scheduler_opts = [
|
||||||
cfg.StrOpt("driver",
|
|
||||||
default="filter_scheduler",
|
|
||||||
deprecated_name="scheduler_driver",
|
|
||||||
deprecated_group="DEFAULT",
|
|
||||||
deprecated_for_removal=True,
|
|
||||||
deprecated_since='21.0.0',
|
|
||||||
deprecated_reason="""
|
|
||||||
nova no longer provides any in-tree filters except for the 'filter_scheduler'
|
|
||||||
scheduler. This filter is considered flexible and pluggable enough for all use
|
|
||||||
cases and can be extended through the use of custom, out-of-tree filters and
|
|
||||||
weighers along with powerful, in-tree filters like the
|
|
||||||
'AggregateInstanceExtraSpecsFilter' and 'ComputeCapabilitiesFilter' filters.
|
|
||||||
""",
|
|
||||||
help="""
|
|
||||||
The class of the driver used by the scheduler. This should be chosen from one
|
|
||||||
of the entrypoints under the namespace 'nova.scheduler.driver' of file
|
|
||||||
'setup.cfg'. If nothing is specified in this option, the 'filter_scheduler' is
|
|
||||||
used.
|
|
||||||
|
|
||||||
Possible values:
|
|
||||||
|
|
||||||
* Any of the drivers included in Nova:
|
|
||||||
|
|
||||||
* filter_scheduler
|
|
||||||
|
|
||||||
* You may also set this to the entry point name of a custom scheduler driver,
|
|
||||||
but you will be responsible for creating and maintaining it in your
|
|
||||||
``setup.cfg`` file.
|
|
||||||
|
|
||||||
Related options:
|
|
||||||
|
|
||||||
* workers
|
|
||||||
"""),
|
|
||||||
cfg.IntOpt("periodic_task_interval",
|
cfg.IntOpt("periodic_task_interval",
|
||||||
default=60,
|
default=60,
|
||||||
help="""
|
help="""
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ from oslo_log import log as logging
|
|||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_service import periodic_task
|
from oslo_service import periodic_task
|
||||||
from stevedore import driver
|
|
||||||
|
|
||||||
import nova.conf
|
import nova.conf
|
||||||
from nova import exception
|
from nova import exception
|
||||||
@@ -34,6 +33,7 @@ from nova import objects
|
|||||||
from nova.objects import host_mapping as host_mapping_obj
|
from nova.objects import host_mapping as host_mapping_obj
|
||||||
from nova import quota
|
from nova import quota
|
||||||
from nova.scheduler.client import report
|
from nova.scheduler.client import report
|
||||||
|
from nova.scheduler import filter_scheduler
|
||||||
from nova.scheduler import request_filter
|
from nova.scheduler import request_filter
|
||||||
from nova.scheduler import utils
|
from nova.scheduler import utils
|
||||||
|
|
||||||
@@ -56,11 +56,7 @@ class SchedulerManager(manager.Manager):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.placement_client = report.SchedulerReportClient()
|
self.placement_client = report.SchedulerReportClient()
|
||||||
self.driver = driver.DriverManager(
|
self.driver = filter_scheduler.FilterScheduler()
|
||||||
'nova.scheduler.driver',
|
|
||||||
CONF.scheduler.driver,
|
|
||||||
invoke_on_load=True
|
|
||||||
).driver
|
|
||||||
|
|
||||||
super(SchedulerManager, self).__init__(
|
super(SchedulerManager, self).__init__(
|
||||||
service_name='scheduler', *args, **kwargs
|
service_name='scheduler', *args, **kwargs
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ class ServersTestBase(integrated_helpers._IntegratedTestBase):
|
|||||||
enabled_filters = CONF.filter_scheduler.enabled_filters
|
enabled_filters = CONF.filter_scheduler.enabled_filters
|
||||||
enabled_filters += self.ADDITIONAL_FILTERS
|
enabled_filters += self.ADDITIONAL_FILTERS
|
||||||
|
|
||||||
self.flags(driver='filter_scheduler', group='scheduler')
|
|
||||||
self.flags(enabled_filters=enabled_filters, group='filter_scheduler')
|
self.flags(enabled_filters=enabled_filters, group='filter_scheduler')
|
||||||
|
|
||||||
return self.start_service('scheduler')
|
return self.start_service('scheduler')
|
||||||
|
|||||||
@@ -44,16 +44,6 @@ class SchedulerManagerInitTestCase(test.NoDBTestCase):
|
|||||||
driver = self.manager_cls().driver
|
driver = self.manager_cls().driver
|
||||||
self.assertIsInstance(driver, filter_scheduler.FilterScheduler)
|
self.assertIsInstance(driver, filter_scheduler.FilterScheduler)
|
||||||
|
|
||||||
@mock.patch.object(host_manager.HostManager, '_init_instance_info')
|
|
||||||
@mock.patch.object(host_manager.HostManager, '_init_aggregates')
|
|
||||||
def test_init_nonexist_schedulerdriver(self,
|
|
||||||
mock_init_agg,
|
|
||||||
mock_init_inst):
|
|
||||||
self.flags(driver='nonexist_scheduler', group='scheduler')
|
|
||||||
# The entry point has to be defined in setup.cfg and nova-scheduler has
|
|
||||||
# to be deployed again before using a custom value.
|
|
||||||
self.assertRaises(RuntimeError, self.manager_cls)
|
|
||||||
|
|
||||||
|
|
||||||
class SchedulerManagerTestCase(test.NoDBTestCase):
|
class SchedulerManagerTestCase(test.NoDBTestCase):
|
||||||
"""Test case for scheduler manager."""
|
"""Test case for scheduler manager."""
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Support for custom scheduler drivers, deprecated since the 21.0.0 (Ussuri)
|
||||||
|
release, has been removed. The default ``filter_scheduler`` is now
|
||||||
|
considered performant enough to suit all use cases. Users with specific
|
||||||
|
requirements that they feel are not met by the filter scheduler should
|
||||||
|
contact the nova developers to discuss their issue.
|
||||||
|
- |
|
||||||
|
The ``[scheduler] scheduler_driver`` config option has been removed, along
|
||||||
|
with the ``nova.scheduler.driver`` setuptools entrypoint.
|
||||||
@@ -64,8 +64,6 @@ nova.api.extra_spec_validators =
|
|||||||
vmware = nova.api.validation.extra_specs.vmware
|
vmware = nova.api.validation.extra_specs.vmware
|
||||||
nova.compute.monitors.cpu =
|
nova.compute.monitors.cpu =
|
||||||
virt_driver = nova.compute.monitors.cpu.virt_driver:Monitor
|
virt_driver = nova.compute.monitors.cpu.virt_driver:Monitor
|
||||||
nova.scheduler.driver =
|
|
||||||
filter_scheduler = nova.scheduler.filter_scheduler:FilterScheduler
|
|
||||||
console_scripts =
|
console_scripts =
|
||||||
nova-api = nova.cmd.api:main
|
nova-api = nova.cmd.api:main
|
||||||
nova-api-metadata = nova.cmd.api_metadata:main
|
nova-api-metadata = nova.cmd.api_metadata:main
|
||||||
|
|||||||
Reference in New Issue
Block a user