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
This commit is contained in:
Dmitry Tantsur 2024-08-22 13:03:15 +02:00
parent 501b8f463b
commit 018a7dcaed
No known key found for this signature in database
GPG Key ID: 315B2AF9FD216C60
4 changed files with 18 additions and 4 deletions

View File

@ -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 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). 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 = <NETWORK UUID>
There are a few configuration options that tune managed inspection, the most There are a few configuration options that tune managed inspection, the most
important is ``extra_kernel_params``, which allows adding kernel parameters for important is ``extra_kernel_params``, which allows adding kernel parameters for
inspection specifically. This is where you can configure inspection specifically. This is where you can configure

View File

@ -230,6 +230,9 @@ and may be combined if desired.
--driver-info cleaning_network=$CLEAN_UUID_OR_NAME \ --driver-info cleaning_network=$CLEAN_UUID_OR_NAME \
--driver-info provisioning_network=$PROVISION_UUID_OR_NAME --driver-info provisioning_network=$PROVISION_UUID_OR_NAME
If you use :doc:`managed inspection </admin/inspection/managed>`, you may
also configure ``inspection_network`` the same way.
See :doc:`configure-tenant-networks` for details. See :doc:`configure-tenant-networks` for details.
#. You must also inform the Bare Metal service of the network interface cards #. You must also inform the Bare Metal service of the network interface cards

View File

@ -1020,10 +1020,11 @@ class NeutronNetworkInterfaceMixin(object):
""" """
try: try:
self.get_inspection_network_uuid(task) self.get_inspection_network_uuid(task)
except exception.MissingParameterValue: except exception.MissingParameterValue as exc:
# Fall back to non-managed in-band inspection # Fall back to non-managed in-band inspection
raise exception.UnsupportedDriverExtension( raise exception.UnsupportedDriverExtension(
driver=task.node.driver, extension='inspection') _("Insufficient information provided for managed "
"inspection: %s") % exc)
def get_servicing_network_uuid(self, task): def get_servicing_network_uuid(self, task):
servicing_network = ( servicing_network = (

View File

@ -441,10 +441,11 @@ class PXEBaseMixin(object):
""" """
try: try:
self._validate_common(task) self._validate_common(task)
except exception.MissingParameterValue: except exception.MissingParameterValue as exc:
# Fall back to non-managed in-band inspection # Fall back to non-managed in-band inspection
raise exception.UnsupportedDriverExtension( raise exception.UnsupportedDriverExtension(
driver=task.node.driver, extension='inspection') _("Insufficient information provided for managed "
"inspection: %s") % exc)
_RETRY_ALLOWED_STATES = {states.DEPLOYWAIT, states.CLEANWAIT, _RETRY_ALLOWED_STATES = {states.DEPLOYWAIT, states.CLEANWAIT,
states.RESCUEWAIT} states.RESCUEWAIT}