From 243ba8513097ca715af738422a9e1249c6a7a1f0 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 24 Aug 2018 19:10:08 -0400 Subject: [PATCH] Deprecate Core/Ram/DiskFilter The time has come. These filters haven't been necessary since Ocata [1] when the filter scheduler started using placement to filter on VCPU, DISK_GB and MEMORY_MB. The only reason to use them with any in-tree scheduler drivers is if using the CachingScheduler which doesn't use placement, but the CachingScheduler itself has been deprecated since Pike [2]. Furthermore, as of change [3] in Stein, the ironic driver no longer reports vcpu/ram/disk inventory for ironic nodes which will make these filters filter out ironic nodes thinking they don't have any inventory. Also, as noted in [4], the DiskFilter does not account for volume-backed instances and may incorrectly filter out a host based on disk inventory when it would otherwise be OK if the instance is not using local disk. The related aggregate filters are left intact for now, see blueprint placement-aggregate-allocation-ratios. [1] Ie12acb76ec5affba536c3c45fbb6de35d64aea1b [2] Ia7ff98ff28b7265058845e46b277317a2bfc96d2 [3] If2b8c1a76d7dbabbac7bb359c9e572cfed510800 [4] I9c2111f7377df65c1fc3c72323f85483b3295989 Change-Id: Id62136d293da55e4bb639635ea5421a33b6c3ea2 Related-Bug: #1787910 --- doc/source/admin/configuration/schedulers.rst | 29 +++++++++++++++++++ .../contributor/testing/libvirt-numa.rst | 2 +- doc/source/user/filter-scheduler.rst | 12 ++++---- nova/scheduler/filters/core_filter.py | 13 ++++++++- nova/scheduler/filters/disk_filter.py | 17 ++++++++++- nova/scheduler/filters/ram_filter.py | 12 ++++++++ ...ore-ram-disk-filters-06a3ce2a820426d9.yaml | 10 +++++++ 7 files changed, 86 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/deprecate-core-ram-disk-filters-06a3ce2a820426d9.yaml diff --git a/doc/source/admin/configuration/schedulers.rst b/doc/source/admin/configuration/schedulers.rst index b868f9e0167d..546dd600c388 100644 --- a/doc/source/admin/configuration/schedulers.rst +++ b/doc/source/admin/configuration/schedulers.rst @@ -301,6 +301,15 @@ In general, you should always enable this filter. CoreFilter ---------- +.. deprecated:: 19.0.0 + + ``CoreFilter`` is deprecated since the 19.0.0 Stein release. VCPU + filtering is performed natively using the Placement service when using the + ``filter_scheduler`` driver. Users of the ``caching_scheduler`` driver may + still rely on this filter but the ``caching_scheduler`` driver is itself + deprecated. Furthermore, enabling CoreFilter may incorrectly filter out + `baremetal nodes`_ which must be scheduled using custom resource classes. + Only schedules instances on hosts if sufficient CPU cores are available. If this filter is not set, the scheduler might over-provision a host based on cores. For example, the virtual cores running on an instance may exceed the @@ -371,6 +380,15 @@ With the API, use the ``os:scheduler_hints`` key. For example: DiskFilter ---------- +.. deprecated:: 19.0.0 + + ``DiskFilter`` is deprecated since the 19.0.0 Stein release. DISK_GB + filtering is performed natively using the Placement service when using the + ``filter_scheduler`` driver. Users of the ``caching_scheduler`` driver may + still rely on this filter but the ``caching_scheduler`` driver is itself + deprecated. Furthermore, enabling DiskFilter may incorrectly filter out + `baremetal nodes`_ which must be scheduled using custom resource classes. + Only schedules instances on hosts if there is sufficient disk space available for root and ephemeral storage. @@ -612,6 +630,17 @@ device requests in the ``extra_specs`` attribute for the flavor. RamFilter --------- +.. deprecated:: 19.0.0 + + ``RamFilter`` is deprecated since the 19.0.0 Stein release. MEMORY_MB + filtering is performed natively using the Placement service when using the + ``filter_scheduler`` driver. Users of the ``caching_scheduler`` driver may + still rely on this filter but the ``caching_scheduler`` driver is itself + deprecated. Furthermore, enabling RamFilter may incorrectly filter out + `baremetal nodes`_ which must be scheduled using custom resource classes. + +.. _baremetal nodes: https://docs.openstack.org/ironic/latest/install/configure-nova-flavors.html + Only schedules instances on hosts that have sufficient RAM available. If this filter is not set, the scheduler may over provision a host based on RAM (for example, the RAM allocated by virtual machine instances may exceed the physical diff --git a/doc/source/contributor/testing/libvirt-numa.rst b/doc/source/contributor/testing/libvirt-numa.rst index b95d72ce18d6..799088787d09 100644 --- a/doc/source/contributor/testing/libvirt-numa.rst +++ b/doc/source/contributor/testing/libvirt-numa.rst @@ -137,7 +137,7 @@ For example: firewall_driver=nova.virt.firewall.NoopFirewallDriver [filter_scheduler] - enabled_filters=RamFilter,ComputeFilter,AvailabilityZoneFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,PciPassthroughFilter,NUMATopologyFilter + enabled_filters=ComputeFilter,AvailabilityZoneFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,PciPassthroughFilter,NUMATopologyFilter EOF $ FORCE=yes ./stack.sh diff --git a/doc/source/user/filter-scheduler.rst b/doc/source/user/filter-scheduler.rst index ffcb04aad531..08642d9a7381 100644 --- a/doc/source/user/filter-scheduler.rst +++ b/doc/source/user/filter-scheduler.rst @@ -95,8 +95,8 @@ 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. -* |CoreFilter| - filters based on CPU core utilization. It passes hosts with - sufficient number of CPU cores. +* |CoreFilter| - DEPRECATED; filters based on CPU core utilization. It passes + hosts with sufficient number of CPU cores. * |AggregateCoreFilter| - filters hosts by CPU core number with per-aggregate ``cpu_allocation_ratio`` setting. If no per-aggregate value is found, it will fall back to the global default ``cpu_allocation_ratio``. If more than one value @@ -105,15 +105,15 @@ There are many standard filter classes which may be used * |IsolatedHostsFilter| - filter based on ``isolated_images``, ``isolated_hosts`` and ``restrict_isolated_hosts_to_isolated_images`` flags. * |JsonFilter| - allows simple JSON-based grammar for selecting hosts. -* |RamFilter| - filters hosts by their RAM. Only hosts with sufficient RAM - to host the instance are passed. +* |RamFilter| - DEPRECATED; filters hosts by their RAM. Only hosts with + sufficient RAM to host the instance are passed. * |AggregateRamFilter| - filters hosts by RAM with per-aggregate ``ram_allocation_ratio`` setting. If no per-aggregate value is found, it will fall back to the global default ``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. -* |DiskFilter| - filters hosts by their disk allocation. Only hosts with sufficient - disk space to host the instance are passed. +* |DiskFilter| - DEPRECATED; filters hosts by their disk allocation. Only + hosts with sufficient disk space to host the instance are passed. ``disk_allocation_ratio`` setting. The virtual disk to physical disk allocation ratio, 1.0 by default. The total allowed allocated disk size will be physical disk multiplied this ratio. diff --git a/nova/scheduler/filters/core_filter.py b/nova/scheduler/filters/core_filter.py index 3feae2a83dca..48fe5eb13610 100644 --- a/nova/scheduler/filters/core_filter.py +++ b/nova/scheduler/filters/core_filter.py @@ -76,7 +76,18 @@ class BaseCoreFilter(filters.BaseHostFilter): class CoreFilter(BaseCoreFilter): - """CoreFilter filters based on CPU core utilization.""" + """DEPRECATED: CoreFilter filters based on CPU core utilization.""" + + def __init__(self): + super(CoreFilter, self).__init__() + LOG.warning('The CoreFilter is deprecated since the 19.0.0 Stein ' + 'release. VCPU filtering is performed natively using the ' + 'Placement service when using the filter_scheduler ' + 'driver. Users of the caching_scheduler driver may still ' + 'rely on this filter but the caching_scheduler driver is ' + 'itself deprecated. Furthermore, enabling CoreFilter ' + 'may incorrectly filter out baremetal nodes which must be ' + 'scheduled using custom resource classes.') def _get_cpu_allocation_ratio(self, host_state, spec_obj): return host_state.cpu_allocation_ratio diff --git a/nova/scheduler/filters/disk_filter.py b/nova/scheduler/filters/disk_filter.py index de8f53580e11..5297c5f9a618 100644 --- a/nova/scheduler/filters/disk_filter.py +++ b/nova/scheduler/filters/disk_filter.py @@ -22,9 +22,23 @@ LOG = logging.getLogger(__name__) class DiskFilter(filters.BaseHostFilter): - """Disk Filter with over subscription flag.""" + """DEPRECATED: Disk Filter with over subscription flag.""" RUN_ON_REBUILD = False + DEPRECATED = True + + def __init__(self): + super(DiskFilter, self).__init__() + if self.DEPRECATED: + LOG.warning('The DiskFilter is deprecated since the 19.0.0 Stein ' + 'release. DISK_GB filtering is performed natively ' + 'using the Placement service when using the ' + 'filter_scheduler driver. Users of the ' + 'caching_scheduler driver may still rely on this ' + 'filter but the caching_scheduler driver is itself ' + 'deprecated. Furthermore, enabling DiskFilter may ' + 'incorrectly filter out baremetal nodes which must be ' + 'scheduled using custom resource classes.') def _get_disk_allocation_ratio(self, host_state, spec_obj): return host_state.disk_allocation_ratio @@ -79,6 +93,7 @@ class AggregateDiskFilter(DiskFilter): """ RUN_ON_REBUILD = False + DEPRECATED = False def _get_disk_allocation_ratio(self, host_state, spec_obj): aggregate_vals = utils.aggregate_values_from_key( diff --git a/nova/scheduler/filters/ram_filter.py b/nova/scheduler/filters/ram_filter.py index f245958e87f5..448b20ba08e4 100644 --- a/nova/scheduler/filters/ram_filter.py +++ b/nova/scheduler/filters/ram_filter.py @@ -68,6 +68,18 @@ class BaseRamFilter(filters.BaseHostFilter): class RamFilter(BaseRamFilter): """Ram Filter with over subscription flag.""" + def __init__(self): + super(RamFilter, self).__init__() + LOG.warning('The RamFilter is deprecated since the 19.0.0 Stein ' + 'release. MEMORY_MB filtering is performed natively ' + 'using the Placement service when using the ' + 'filter_scheduler driver. Users of the ' + 'caching_scheduler driver may still rely on this ' + 'filter but the caching_scheduler driver is itself ' + 'deprecated. Furthermore, enabling RamFilter may ' + 'incorrectly filter out baremetal nodes which must be ' + 'scheduled using custom resource classes.') + def _get_ram_allocation_ratio(self, host_state, spec_obj): return host_state.ram_allocation_ratio diff --git a/releasenotes/notes/deprecate-core-ram-disk-filters-06a3ce2a820426d9.yaml b/releasenotes/notes/deprecate-core-ram-disk-filters-06a3ce2a820426d9.yaml new file mode 100644 index 000000000000..6cd52c466bb7 --- /dev/null +++ b/releasenotes/notes/deprecate-core-ram-disk-filters-06a3ce2a820426d9.yaml @@ -0,0 +1,10 @@ +--- +deprecations: + - | + The ``CoreFilter``, ``DiskFilter`` and ``RamFilter`` are now deprecated. + VCPU, DISK_GB and MEMORY_MB filtering is performed natively using the + Placement service when using the ``filter_scheduler`` driver. Users of the + ``caching_scheduler`` driver may still rely on these filters but the + ``caching_scheduler`` driver is itself deprecated. Furthermore, enabling + these filters may incorrectly filter out baremetal nodes which must be + `scheduled using custom resource classes `_.