From fcbedce5581707036626ae7afb94f998ea8ff389 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 26 Mar 2021 17:18:35 +0000 Subject: [PATCH] conf: Deprecate AggregateImagePropertiesIsolation opts The 'AggregateImagePropertiesIsolation' scheduler filter allows users to filter host aggregates by comparing aggregate and image metadata. The '[filter_scheduler] aggregate_image_properties_isolation_namespace' and '[filter_scheduler] aggregate_image_properties_isolation_separator' options purport to allow users to specify a prefix to use for both the aggregate and image metadata keys, allowing users to do e.g.: openstack image set --property customized.os_type=linux $IMAGE openstack aggregate set --property customized.os_type=windows $AGG1 openstack aggregate set --property customized.os_type=linux $AGG2 However, as noted in change If7245a90711bd2ea13095ba26b9bc82ea3e17202, this is no longer possible since we introduced the 'ImageMetaProps' o.vo in Liberty and promptly lost the ability to see any non-o.vo image metadata properties from glance. There's a possibility, however slight, that some people are using namespaces that match actual nova namespaces such as 'hw' and a separator of '_', but those will continue to work just fine. Setting anything else will result in the scheduler filter failing since the image property will always appear to be absent. As a result, these could be outright removed rather than deprecated. We choose to deprecate just so people can see the warnings. Change-Id: Ide763d75e42427a9df3673313895ef47b8727802 Signed-off-by: Stephen Finucane --- nova/conf/scheduler.py | 17 ++++++++++++++--- .../aggregate_image_properties_isolation.py | 13 ++++++++++++- ...iesIsolation-conf-opts-ce601f7c08515586.yaml | 13 +++++++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/deprecated-AggregateImagePropertiesIsolation-conf-opts-ce601f7c08515586.yaml diff --git a/nova/conf/scheduler.py b/nova/conf/scheduler.py index f936e8f97b78..a7dcf3f943cf 100644 --- a/nova/conf/scheduler.py +++ b/nova/conf/scheduler.py @@ -844,11 +844,15 @@ Related options: * ``[filter_scheduler] isolated_images`` * ``[filter_scheduler] isolated_hosts`` """), - # TODO(stephenfin): Consider deprecating these next two options: they're - # effectively useless now that we don't support arbitrary image metadata - # properties cfg.StrOpt( "aggregate_image_properties_isolation_namespace", + deprecated_for_removal=True, + deprecated_since="33.0.0", + deprecated_reason=""" +It no longer possible to filter on arbitrary image metadata properties. Support +for this was removed in 12.0.0 (Liberty). As a result, this option is no longer +useful. +""", help=""" Image property namespace for use in the host aggregate. @@ -873,6 +877,13 @@ Related options: cfg.StrOpt( "aggregate_image_properties_isolation_separator", default=".", + deprecated_for_removal=True, + deprecated_since="33.0.0", + deprecated_reason=""" +It no longer possible to filter on arbitrary image metadata properties. Support +for this was removed in 12.0.0 (Liberty). As a result, this option is no longer +useful. +""", help=""" Separator character(s) for image property namespace and name. diff --git a/nova/scheduler/filters/aggregate_image_properties_isolation.py b/nova/scheduler/filters/aggregate_image_properties_isolation.py index 95f22365fb67..8df8e2f5b32b 100644 --- a/nova/scheduler/filters/aggregate_image_properties_isolation.py +++ b/nova/scheduler/filters/aggregate_image_properties_isolation.py @@ -15,7 +15,6 @@ from oslo_log import log as logging - import nova.conf from nova.scheduler import filters from nova.scheduler.filters import utils @@ -42,6 +41,18 @@ class AggregateImagePropertiesIsolation(filters.BaseHostFilter): cfg_separator = (CONF.filter_scheduler. aggregate_image_properties_isolation_separator) + if cfg_namespace: + LOG.warning( + "It is no longer possible to filter on arbitrary image " + "metadata properties, which includes standard properties " + "prefixed with '[filter_scheduler] " + "aggregate_image_properties_isolation_namespace'. " + "You should unset this option and consider using the isolated " + "aggregate filtering feature instead. " + "See '[scheduler] enable_isolated_aggregate_filtering' for " + "more information." + ) + image_props = spec_obj.image.properties if spec_obj.image else {} metadata = utils.aggregate_metadata_get_by_host(host_state) diff --git a/releasenotes/notes/deprecated-AggregateImagePropertiesIsolation-conf-opts-ce601f7c08515586.yaml b/releasenotes/notes/deprecated-AggregateImagePropertiesIsolation-conf-opts-ce601f7c08515586.yaml new file mode 100644 index 000000000000..d5085fceb57c --- /dev/null +++ b/releasenotes/notes/deprecated-AggregateImagePropertiesIsolation-conf-opts-ce601f7c08515586.yaml @@ -0,0 +1,13 @@ +--- +deprecations: + - | + The ``[filter_scheduler] aggregate_image_properties_isolation_namespace`` + and ``[filter_scheduler] aggregate_image_properties_isolation_separator`` + config options have been deprecated for removal. These have been + effectively unusable since the 12.0.0 (Liberty) release, which removed the + ability for the ``AggregateImagePropertiesIsolation`` scheduler filter to + filter on any non-standard image metadata property. Users who require this + functionality should consider enforcing `aggregate isolation using + placement traits`__. + + __ https://docs.openstack.org/nova/latest/reference/isolate-aggregates.html