From 51eff6010f954efcc87c262f693247bc4c41380a Mon Sep 17 00:00:00 2001
From: Dmitry Tantsur <dtantsur@protonmail.com>
Date: Tue, 26 May 2020 12:56:32 +0200
Subject: [PATCH] Add the noop management interface to the redfish hardware
 type

Apparently, we're hitting similar problems on some hardware that caused
us to add noop to ipmi. Maybe we should make it supported on all
hardware types, but right now it would break iLO. To reduce the scope
of this (hopefully backportable) patch, I'm limiting it to Redfish.

Change-Id: Ia44e5d83a7b2ce660be4822e7908dd75908ccbdd
Story: #2007713
Task: #39849
---
 doc/source/admin/drivers.rst                  | 35 +++++++++++++++++++
 doc/source/admin/drivers/ipmitool.rst         | 25 +------------
 ironic/drivers/redfish.py                     |  3 +-
 .../redfish-noop-mgmt-b61d02b77b1c9d6b.yaml   |  6 ++++
 4 files changed, 44 insertions(+), 25 deletions(-)
 create mode 100644 releasenotes/notes/redfish-noop-mgmt-b61d02b77b1c9d6b.yaml

diff --git a/doc/source/admin/drivers.rst b/doc/source/admin/drivers.rst
index 627702cf28..267409403e 100644
--- a/doc/source/admin/drivers.rst
+++ b/doc/source/admin/drivers.rst
@@ -104,6 +104,41 @@ not compatible with them. There are three ways to deal with this situation:
    .. note:: This feature is available starting with ironic 11.1.0 (Rocky
              series, API version 1.45).
 
+.. _static-boot-order:
+
+Static boot order configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Some hardware is known to misbehave when changing the boot device through the
+BMC. To work around it you can use the ``noop`` management interface
+implementation with the ``ipmi`` and ``redfish`` hardware types. In this case
+the Bare Metal service will not change the boot device for you, leaving
+the pre-configured boot order.
+
+For example, in case of the :ref:`pxe-boot`:
+
+#. Via any available means configure the boot order on the node as follows:
+
+   #. Boot from PXE/iPXE on the provisioning NIC.
+
+      .. warning::
+         If it is not possible to limit network boot to only provisioning NIC,
+         make sure that no other DHCP/PXE servers are accessible by the node.
+
+   #. Boot from hard drive.
+
+#. Make sure the ``noop`` management interface is enabled, for example:
+
+   .. code-block:: ini
+
+    [DEFAULT]
+    enabled_hardware_types = ipmi,redfish
+    enabled_management_interfaces = ipmitool,redfish,noop
+
+#. Change the node to use the ``noop`` management interface::
+
+      openstack baremetal node set <NODE> --management-interface noop
+
 Unsupported drivers
 -------------------
 
diff --git a/doc/source/admin/drivers/ipmitool.rst b/doc/source/admin/drivers/ipmitool.rst
index b6d64f17d5..dd051d9881 100644
--- a/doc/source/admin/drivers/ipmitool.rst
+++ b/doc/source/admin/drivers/ipmitool.rst
@@ -171,30 +171,7 @@ protocol version::
 Static boot order configuration
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Some hardware is known to misbehave when changing the boot device through the
-IPMI protocol. To work around it you can use the ``noop`` management interface
-implementation with the ``ipmi`` hardware type. In this case the Bare Metal
-service will not change the boot device for you, leaving the pre-configured
-boot order.
-
-For example, in case of the :ref:`pxe-boot`:
-
-#. Via any available means configure the boot order on the node as follows:
-
-   #. Boot from PXE/iPXE on the provisioning NIC.
-
-      .. warning::
-         If it is not possible to limit network boot to only provisioning NIC,
-         make sure that no other DHCP/PXE servers are accessible by the node.
-
-   #. Boot from hard drive.
-
-#. Make sure the ``noop`` management interface is enabled, see example in
-   `Enabling the IPMI hardware type`_.
-
-#. Change the node to use the ``noop`` management interface::
-
-      openstack baremetal node set <NODE> --management-interface noop
+See :ref:`static-boot-order`.
 
 .. TODO(lucasagomes): Write about privilege level
 .. TODO(lucasagomes): Write about force boot device
diff --git a/ironic/drivers/redfish.py b/ironic/drivers/redfish.py
index fe082cfe4a..51e34d6be3 100644
--- a/ironic/drivers/redfish.py
+++ b/ironic/drivers/redfish.py
@@ -17,6 +17,7 @@ from ironic.drivers import generic
 from ironic.drivers.modules import inspector
 from ironic.drivers.modules import ipxe
 from ironic.drivers.modules import noop
+from ironic.drivers.modules import noop_mgmt
 from ironic.drivers.modules import pxe
 from ironic.drivers.modules.redfish import bios as redfish_bios
 from ironic.drivers.modules.redfish import boot as redfish_boot
@@ -36,7 +37,7 @@ class RedfishHardware(generic.GenericHardware):
     @property
     def supported_management_interfaces(self):
         """List of supported management interfaces."""
-        return [redfish_mgmt.RedfishManagement]
+        return [redfish_mgmt.RedfishManagement, noop_mgmt.NoopManagement]
 
     @property
     def supported_power_interfaces(self):
diff --git a/releasenotes/notes/redfish-noop-mgmt-b61d02b77b1c9d6b.yaml b/releasenotes/notes/redfish-noop-mgmt-b61d02b77b1c9d6b.yaml
new file mode 100644
index 0000000000..b4ca4e44b4
--- /dev/null
+++ b/releasenotes/notes/redfish-noop-mgmt-b61d02b77b1c9d6b.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    To provide a workaround for incorrect boot order problems on some hardware,
+    the ``redfish`` hardware type now supports the ``noop`` management
+    interface, similarly to IPMI and SNMP.