From 588194d785b1bb52e53ed159c5d8645bf3a28b7d Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Tue, 30 Jul 2019 12:18:13 +0000 Subject: [PATCH] Deprecate Aggregate[Core|Ram|Disk]Filters The Aggregate[Core|Ram|Disk]Filters have not worked correctly since ocata, this change deprecates them for removal next cycle. http://lists.openstack.org/pipermail/openstack-dev/2018-January/126283.html Related-Bug: #1804125 Change-Id: Ibfbfdae9e6ec93f772631a84e8969f4e11da8aee --- doc/source/admin/configuration/schedulers.rst | 38 +++++++++++++++++++ doc/source/user/filter-scheduler.rst | 6 +-- nova/scheduler/filters/core_filter.py | 11 +++++- nova/scheduler/filters/disk_filter.py | 11 +++++- nova/scheduler/filters/ram_filter.py | 11 +++++- ...ore-ram-disk-filters-59b9c430c5c26153.yaml | 11 ++++++ 6 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/deprecate-aggregate-core-ram-disk-filters-59b9c430c5c26153.yaml diff --git a/doc/source/admin/configuration/schedulers.rst b/doc/source/admin/configuration/schedulers.rst index 937805cf82a2..ef48882d91e2 100644 --- a/doc/source/admin/configuration/schedulers.rst +++ b/doc/source/admin/configuration/schedulers.rst @@ -152,6 +152,20 @@ The following sections describe the available compute filters. AggregateCoreFilter ------------------- +.. deprecated:: 20.0.0 + + ``AggregateCoreFilter`` is deprecated since the 20.0.0 Train release. + As of the introduction of the placement service in Ocata, the behavior + of this filter :ref:`has changed ` and no longer should be used. + In the 18.0.0 Rocky release nova `automatically mirrors`_ host aggregates + to placement aggregates. + In the 19.0.0 Stein release initial allocation ratios support was added + which allows management of the allocation ratios via the placement API in + addition to the existing capability to manage allocation ratios via the nova + config. See `Allocation ratios`_ for details. + +.. _`automatically mirrors`: https://specs.openstack.org/openstack/nova-specs/specs/rocky/implemented/placement-mirror-host-aggregates.html + Filters host by CPU core numbers with a per-aggregate ``cpu_allocation_ratio`` value. If the per-aggregate value is not found, the value falls back to the global setting. If the host is in more than one aggregate and more than one @@ -163,6 +177,18 @@ Note the ``cpu_allocation_ratio`` :ref:`bug 1804125 ` restriction. AggregateDiskFilter ------------------- +.. deprecated:: 20.0.0 + + ``AggregateDiskFilter`` is deprecated since the 20.0.0 Train release. + As of the introduction of the placement service in Ocata, the behavior + of this filter :ref:`has changed ` and no longer should be used. + In the 18.0.0 Rocky release nova `automatically mirrors`_ host aggregates + to placement aggregates. + In the 19.0.0 Stein release initial allocation ratios support was added + which allows management of the allocation ratios via the placement API in + addition to the existing capability to manage allocation ratios via the nova + config. See `Allocation ratios`_ for details. + Filters host by disk allocation with a per-aggregate ``disk_allocation_ratio`` value. If the per-aggregate value is not found, the value falls back to the global setting. If the host is in more than one aggregate and more than one @@ -297,6 +323,18 @@ used. For information about how to use this filter, see AggregateRamFilter ------------------ +.. deprecated:: 20.0.0 + + ``AggregateRamFilter`` is deprecated since the 20.0.0 Train release. + As of the introduction of the placement service in Ocata, the behavior + of this filter :ref:`has changed ` and no longer should be used. + In the 18.0.0 Rocky release nova `automatically mirrors`_ host aggregates + to placement aggregates. + In the 19.0.0 Stein release initial allocation ratios support was added + which allows management of the allocation ratios via the placement API in + addition to the existing capability to manage allocation ratios via the nova + config. See `Allocation ratios`_ for details. + Filters host by RAM allocation of instances with a per-aggregate ``ram_allocation_ratio`` value. If the per-aggregate value is not found, the value falls back to the global setting. If the host is in more than one diff --git a/doc/source/user/filter-scheduler.rst b/doc/source/user/filter-scheduler.rst index c34cba85fed2..48d9f6b570e0 100644 --- a/doc/source/user/filter-scheduler.rst +++ b/doc/source/user/filter-scheduler.rst @@ -95,7 +95,7 @@ There are many standard filter classes which may be used use a comma. E.g., "value1,value2". All hosts are passed if no extra_specs are specified. * |ComputeFilter| - passes all hosts that are operational and enabled. -* |AggregateCoreFilter| - filters hosts by CPU core number with per-aggregate +* |AggregateCoreFilter| - DEPRECATED; filters hosts by CPU core number with per-aggregate :oslo.config:option:`cpu_allocation_ratio` setting. If no per-aggregate value is found, it will fall back to the global default :oslo.config:option:`cpu_allocation_ratio`. @@ -108,14 +108,14 @@ There are many standard filter classes which may be used and :oslo.config:option:`filter_scheduler.restrict_isolated_hosts_to_isolated_images` flags. * |JsonFilter| - allows simple JSON-based grammar for selecting hosts. -* |AggregateRamFilter| - filters hosts by RAM with per-aggregate +* |AggregateRamFilter| - DEPRECATED; filters hosts by RAM with per-aggregate :oslo.config:option:`ram_allocation_ratio` setting. If no per-aggregate value is found, it will fall back to the global default :oslo.config:option:`ram_allocation_ratio`. If more than one value is found for a host (meaning the host is in two different aggregates with different ratio settings), the minimum value will be used. -* |AggregateDiskFilter| - filters hosts by disk allocation with per-aggregate +* |AggregateDiskFilter| - DEPRECATED; filters hosts by disk allocation with per-aggregate :oslo.config:option:`disk_allocation_ratio` setting. If no per-aggregate value is found, it will fall back to the global default :oslo.config:option:`disk_allocation_ratio`. diff --git a/nova/scheduler/filters/core_filter.py b/nova/scheduler/filters/core_filter.py index f28f4d9eaaad..77df5df67a52 100644 --- a/nova/scheduler/filters/core_filter.py +++ b/nova/scheduler/filters/core_filter.py @@ -24,13 +24,22 @@ LOG = logging.getLogger(__name__) class AggregateCoreFilter(filters.BaseHostFilter): - """AggregateCoreFilter with per-aggregate CPU subscription flag. + """DEPRECATED: AggregateCoreFilter with per-aggregate allocation ratio. Fall back to global cpu_allocation_ratio if no per-aggregate setting found. """ RUN_ON_REBUILD = False + def __init__(self): + super(AggregateCoreFilter, self).__init__() + LOG.warning('The AggregateCoreFilter is deprecated since the 20.0.0 ' + 'Train release. VCPU filtering is performed natively ' + 'using the Placement service when using the ' + 'filter_scheduler driver. Operators should define cpu ' + 'allocation ratios either per host in the nova.conf ' + 'or via the placement API.') + def _get_cpu_allocation_ratio(self, host_state, spec_obj): aggregate_vals = utils.aggregate_values_from_key( host_state, diff --git a/nova/scheduler/filters/disk_filter.py b/nova/scheduler/filters/disk_filter.py index b4b817cbb6a3..8cb0bf09142b 100644 --- a/nova/scheduler/filters/disk_filter.py +++ b/nova/scheduler/filters/disk_filter.py @@ -22,7 +22,7 @@ LOG = logging.getLogger(__name__) class AggregateDiskFilter(filters.BaseHostFilter): - """AggregateDiskFilter with per-aggregate disk allocation ratio flag. + """DEPRECATED: AggregateDiskFilter with per-aggregate disk allocation ratio Fall back to global disk_allocation_ratio if no per-aggregate setting found. @@ -30,6 +30,15 @@ class AggregateDiskFilter(filters.BaseHostFilter): RUN_ON_REBUILD = False + def __init__(self): + super(AggregateDiskFilter, self).__init__() + LOG.warning('The AggregateDiskFilter is deprecated since the 20.0.0 ' + 'Train release. DISK_GB filtering is performed natively ' + 'using the Placement service when using the ' + 'filter_scheduler driver. Operators should define disk ' + 'allocation ratios either per host in the nova.conf ' + 'or via the placement API.') + def _get_disk_allocation_ratio(self, host_state, spec_obj): aggregate_vals = utils.aggregate_values_from_key( host_state, diff --git a/nova/scheduler/filters/ram_filter.py b/nova/scheduler/filters/ram_filter.py index 9717101bfbfa..ce73ae546fdd 100644 --- a/nova/scheduler/filters/ram_filter.py +++ b/nova/scheduler/filters/ram_filter.py @@ -23,13 +23,22 @@ LOG = logging.getLogger(__name__) class AggregateRamFilter(filters.BaseHostFilter): - """AggregateRamFilter with per-aggregate ram subscription flag. + """DEPRECATED: AggregateRamFilter with per-aggregate ram subscription flag. Fall back to global ram_allocation_ratio if no per-aggregate setting found. """ RUN_ON_REBUILD = False + def __init__(self): + super(AggregateRamFilter, self).__init__() + LOG.warning('The AggregateRamFilter is deprecated since the 20.0.0 ' + 'Train release. MEMORY_MB filtering is performed natively ' + 'using the Placement service when using the ' + 'filter_scheduler driver. Operators should define ram ' + 'allocation ratios either per host in the nova.conf ' + 'or via the placement API.') + def _get_ram_allocation_ratio(self, host_state, spec_obj): aggregate_vals = utils.aggregate_values_from_key( host_state, diff --git a/releasenotes/notes/deprecate-aggregate-core-ram-disk-filters-59b9c430c5c26153.yaml b/releasenotes/notes/deprecate-aggregate-core-ram-disk-filters-59b9c430c5c26153.yaml new file mode 100644 index 000000000000..bc1e184bc3b8 --- /dev/null +++ b/releasenotes/notes/deprecate-aggregate-core-ram-disk-filters-59b9c430c5c26153.yaml @@ -0,0 +1,11 @@ +--- +deprecations: + - | + The ``AggregateCoreFilter``, ``AggregateRamFilter`` and + ``AggregateDiskFilter`` are now deprecated. + They will be removed in a future release and should no longer be used. + Their functionality has been replaced with a placement native approach + by combining host aggregate mirroring added in Rocky and initial allocation + ratios added in Stein. See the `scheduler documentation`_ for details. + + .. _`scheduler documentation`: https://docs.openstack.org/nova/latest/admin/configuration/schedulers.html \ No newline at end of file