Deprecate Aggregate[CPU|Ram|Disk]Filters

Their functionality has been replace by placement API so these
filters should no longer used.

Change-Id: I0e7c42fcc907571cba84b1147e63767ccad9088e
This commit is contained in:
Hongbin Lu 2021-07-01 17:39:03 +08:00
parent d8b7b01d76
commit 1f10576673
5 changed files with 37 additions and 6 deletions

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
The ``CPUFilter``, ``RamFilter`` and
``DiskFilter`` 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.

View File

@ -64,10 +64,7 @@ Related options:
cfg.ListOpt("enabled_filters",
default=[
"AvailabilityZoneFilter",
"CPUFilter",
"RamFilter",
"ComputeFilter",
"DiskFilter",
"RuntimeFilter",
],
help="""

View File

@ -21,10 +21,19 @@ LOG = logging.getLogger(__name__)
class CPUFilter(filters.BaseHostFilter):
"""Filter the containers by cpu request"""
"""DEPRECATED: Filter the containers by cpu request"""
run_filter_once_per_request = True
def __init__(self):
super(CPUFilter, self).__init__()
LOG.warning('The CPUFilter is deprecated since the 7.0.0 '
'Wallaby 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 zun.conf '
'or via the placement API.')
def host_passes(self, host_state, container, extra_spec):
if not container.cpu:
return True

View File

@ -21,10 +21,19 @@ LOG = logging.getLogger(__name__)
class DiskFilter(filters.BaseHostFilter):
"""Filter the containers by disk request"""
"""DEPRECATED: Filter the containers by disk request"""
run_filter_once_per_request = True
def __init__(self):
super(DiskFilter, self).__init__()
LOG.warning('The DiskFilter is deprecated since the 7.0.0 '
'Wallaby 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 zun.conf '
'or via the placement API.')
def host_passes(self, host_state, container, extra_spec):
if not hasattr(container, 'disk') or not container.disk:
return True

View File

@ -21,10 +21,19 @@ LOG = logging.getLogger(__name__)
class RamFilter(filters.BaseHostFilter):
"""Filter the containers by memory request"""
"""DEPRECATED: Filter the containers by memory request"""
run_filter_once_per_request = True
def __init__(self):
super(RamFilter, self).__init__()
LOG.warning('The RamFilter is deprecated since the 7.0.0 '
'Wallaby 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 zun.conf '
'or via the placement API.')
def host_passes(self, host_state, container, extra_spec):
if not container.memory:
return True