Deprecate bare metal filters

This change deprecates the Exact filters, and two options commonly used
to enable them. Custom resource classes should be used instead.

Change-Id: I843353427c90142a366ae9ca63ee4298b4f3ecd4
This commit is contained in:
Dmitry Tantsur 2017-08-10 16:36:06 +02:00
parent 9a66d039a1
commit b4295ef049
5 changed files with 43 additions and 0 deletions

View File

@ -291,6 +291,13 @@ Related options:
],
deprecated_name="baremetal_scheduler_default_filters",
deprecated_group="DEFAULT",
deprecated_for_removal=True,
deprecated_reason="""
These filters were used to overcome some of the baremetal scheduling
limitations in Nova prior to the use of the Placement API. Now scheduling will
use the custom resource class defined for each baremetal node to make its
selection.
""",
help="""
Filters used for filtering baremetal hosts.
@ -313,6 +320,13 @@ Related options:
cfg.BoolOpt("use_baremetal_filters",
deprecated_name="scheduler_use_baremetal_filters",
deprecated_group="DEFAULT",
deprecated_for_removal=True,
deprecated_reason="""
These filters were used to overcome some of the baremetal scheduling
limitations in Nova prior to the use of the Placement API. Now scheduling will
use the custom resource class defined for each baremetal node to make its
selection.
""",
default=False,
help="""
Enable baremetal filters.

View File

@ -25,6 +25,11 @@ LOG = logging.getLogger(__name__)
class ExactCoreFilter(filters.BaseHostFilter):
"""Exact Core Filter."""
def __init__(self, *args, **kwargs):
super(ExactCoreFilter, self).__init__(*args, **kwargs)
LOG.warning('ExactCoreFilter is deprecated in Pike and will be '
'removed in a subsequent release.')
def host_passes(self, host_state, spec_obj):
"""Return True if host has the exact number of CPU cores."""
if not host_state.vcpus_total:

View File

@ -23,6 +23,11 @@ LOG = logging.getLogger(__name__)
class ExactDiskFilter(filters.BaseHostFilter):
"""Exact Disk Filter."""
def __init__(self, *args, **kwargs):
super(ExactDiskFilter, self).__init__(*args, **kwargs)
LOG.warning('ExactDiskFilter is deprecated in Pike and will be '
'removed in a subsequent release.')
def host_passes(self, host_state, spec_obj):
"""Return True if host has the exact amount of disk available."""
requested_disk = (1024 * (spec_obj.root_gb +

View File

@ -23,6 +23,11 @@ LOG = logging.getLogger(__name__)
class ExactRamFilter(filters.BaseHostFilter):
"""Exact RAM Filter."""
def __init__(self, *args, **kwargs):
super(ExactRamFilter, self).__init__(*args, **kwargs)
LOG.warning('ExactRamFilter is deprecated in Pike and will be '
'removed in a subsequent release.')
def host_passes(self, host_state, spec_obj):
"""Return True if host has the exact amount of RAM available."""
requested_ram = spec_obj.memory_mb

View File

@ -0,0 +1,14 @@
---
deprecations:
- |
The configuration options ``baremetal_enabled_filters`` and
``use_baremetal_filters`` are deprecated in Pike and should only be used if
your deployment still contains nodes that have not had their resource_class
attribute set. See `Ironic release notes <https://docs.openstack.org/releasenotes/ironic/>`_
for upgrade concerns.
- |
The following scheduler filters are deprecated in Pike: ``ExactRamFilter``,
``ExactCoreFilter`` and ``ExactDiskFilter`` and should only be used if your
deployment still contains nodes that have not had their resource_class
attribute set. See `Ironic release notes <https://docs.openstack.org/releasenotes/ironic/>`_
for upgrade concerns.