From 018a7dcaed2271d37a883ca0a4aa31e228308be0 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 22 Aug 2024 13:03:15 +0200 Subject: [PATCH] Better handle missing inspection_network Currently, if the inspection network is not provided, neutron-based network interfaces fail with something like: Driver redfish does not support inspection (disabled or not implemented) This is utterly misleading. Use a hand-crafted error message instead. Same for the PXE boot interface. Also add missing documentation. Change-Id: I79086db1c270e02a6c74b870acc336e8da54dea3 --- doc/source/admin/inspection/managed.rst | 9 +++++++++ doc/source/install/enrollment.rst | 3 +++ ironic/common/neutron.py | 5 +++-- ironic/drivers/modules/pxe_base.py | 5 +++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/source/admin/inspection/managed.rst b/doc/source/admin/inspection/managed.rst index b44b672196..6ddb4a0238 100644 --- a/doc/source/admin/inspection/managed.rst +++ b/doc/source/admin/inspection/managed.rst @@ -14,6 +14,15 @@ is the only way to conduct inspection using :ref:`redfish-virtual-media` or with :doc:`/admin/dhcp-less`. This mode is engaged automatically when the node has sufficient information to configure boot (e.g. ports in case of iPXE). +For network interfaces based on OpenStack Networking (e.g. ``flat`` and +``neutron``), the UUID or name of the inspection network must be provided via +configuration or ``driver_info``, for example: + +.. code-block:: ini + + [neutron] + inspection_network = + There are a few configuration options that tune managed inspection, the most important is ``extra_kernel_params``, which allows adding kernel parameters for inspection specifically. This is where you can configure diff --git a/doc/source/install/enrollment.rst b/doc/source/install/enrollment.rst index b2e15979d6..2e1e3a4eb4 100644 --- a/doc/source/install/enrollment.rst +++ b/doc/source/install/enrollment.rst @@ -230,6 +230,9 @@ and may be combined if desired. --driver-info cleaning_network=$CLEAN_UUID_OR_NAME \ --driver-info provisioning_network=$PROVISION_UUID_OR_NAME + If you use :doc:`managed inspection `, you may + also configure ``inspection_network`` the same way. + See :doc:`configure-tenant-networks` for details. #. You must also inform the Bare Metal service of the network interface cards diff --git a/ironic/common/neutron.py b/ironic/common/neutron.py index b322cd0ee0..6a994381c6 100644 --- a/ironic/common/neutron.py +++ b/ironic/common/neutron.py @@ -1020,10 +1020,11 @@ class NeutronNetworkInterfaceMixin(object): """ try: self.get_inspection_network_uuid(task) - except exception.MissingParameterValue: + except exception.MissingParameterValue as exc: # Fall back to non-managed in-band inspection raise exception.UnsupportedDriverExtension( - driver=task.node.driver, extension='inspection') + _("Insufficient information provided for managed " + "inspection: %s") % exc) def get_servicing_network_uuid(self, task): servicing_network = ( diff --git a/ironic/drivers/modules/pxe_base.py b/ironic/drivers/modules/pxe_base.py index 32528339c4..e5082fa30c 100644 --- a/ironic/drivers/modules/pxe_base.py +++ b/ironic/drivers/modules/pxe_base.py @@ -441,10 +441,11 @@ class PXEBaseMixin(object): """ try: self._validate_common(task) - except exception.MissingParameterValue: + except exception.MissingParameterValue as exc: # Fall back to non-managed in-band inspection raise exception.UnsupportedDriverExtension( - driver=task.node.driver, extension='inspection') + _("Insufficient information provided for managed " + "inspection: %s") % exc) _RETRY_ALLOWED_STATES = {states.DEPLOYWAIT, states.CLEANWAIT, states.RESCUEWAIT}