From 58388212bc881074d13a9ae5a41c855816bd2d45 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 15 Mar 2023 13:12:20 +0100 Subject: [PATCH] Prepare [inspector]require_managed_boot to change to True in the future Currently, we silently fall back to ironic-inspector managing boot if the boot interface cannot do it. What ironic-inspector does is set the boot device to PXE and issue a reboot request. This was done to keep backward compatibility with how inspection worked before managed boot was introduced. With in-band inspection migrating to Ironic proper, this "unmanaged" mode becomes a more exotic case since it requires additional PXE infrastructure. Additionally, the popularity of Redfish is rapidly growing, and we support pre-populating ports when Redfish is used. As such, the "unmanaged" mode should no longer be allowed by default. This change prepares for the future flip of the default value by issuing a deprecation warning if no explicit value is set for the option. Depends-On: https://review.opendev.org/c/openstack/bifrost/+/877469 Change-Id: I6a13cf62b427c9e5c7d7d9ddc447d60f94592c9a --- ironic/conf/inspector.py | 11 +++++++---- ironic/drivers/modules/inspector/interface.py | 8 ++++++++ .../notes/require-managed-boot-7d8965d4ac5fbd21.yaml | 8 ++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/require-managed-boot-7d8965d4ac5fbd21.yaml diff --git a/ironic/conf/inspector.py b/ironic/conf/inspector.py index a7f89c994e..f790ea074a 100644 --- a/ironic/conf/inspector.py +++ b/ironic/conf/inspector.py @@ -34,11 +34,14 @@ opts = [ help=_('endpoint to use as a callback for posting back ' 'introspection data when boot is managed by ironic. ' 'Standard keystoneauth options are used by default.')), - cfg.BoolOpt('require_managed_boot', default=False, + cfg.BoolOpt('require_managed_boot', default=None, help=_('require that the in-band inspection boot is fully ' - 'managed by ironic. Set this to True if your ' - 'installation of ironic-inspector does not have a ' - 'separate PXE boot environment.')), + 'managed by the node\'s boot interface. Set this to ' + 'True if your installation does not have a separate ' + '(i)PXE boot environment for node discovery. Set ' + 'to False if you need to inspect nodes that are not ' + 'supported by boot interfaces (e.g. because they ' + 'don\'t have ports).')), ] diff --git a/ironic/drivers/modules/inspector/interface.py b/ironic/drivers/modules/inspector/interface.py index e720770036..75d51f9711 100644 --- a/ironic/drivers/modules/inspector/interface.py +++ b/ironic/drivers/modules/inspector/interface.py @@ -164,6 +164,14 @@ def _start_managed_inspection(task): class Inspector(base.InspectInterface): """In-band inspection via ironic-inspector project.""" + def __init__(self): + super().__init__() + if CONF.inspector.require_managed_boot is None: + LOG.warning("The option [inspector]require_managed_boot will " + "change its default value to True in the future. " + "Set it to an explicit boolean value to avoid a " + "potential breakage.") + def get_properties(self): """Return the properties of the interface. diff --git a/releasenotes/notes/require-managed-boot-7d8965d4ac5fbd21.yaml b/releasenotes/notes/require-managed-boot-7d8965d4ac5fbd21.yaml new file mode 100644 index 0000000000..106664b8ea --- /dev/null +++ b/releasenotes/notes/require-managed-boot-7d8965d4ac5fbd21.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + The default value of the ``[inspector]require_managed_boot`` option will + change from ``False`` to ``True`` in the future, causing in-band inspection + to fail if the boot interface cannot prepare the ramdisk boot (e.g. in case + of missing ports). Please set this option to an explicit value to avoid + the behavior change.