summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-02-20 15:37:09 +0000
committerGerrit Code Review <review@openstack.org>2023-02-20 15:37:09 +0000
commit9dad023db856d9e623d56d9d77a70648b4071a40 (patch)
tree41ebe3224ece9975668cb8e0b37e851fdd9e189d
parent1b106d0a29b367eb0ef6f0fa1885ee5681ee2260 (diff)
parent29546c18dccf19d80e2fac866677538d641f8be6 (diff)
downloadironic-9dad023db856d9e623d56d9d77a70648b4071a40.tar.gz
Merge "Align iRMC driver with Ironic's default boot_mode" into bugfix/21.0
-rw-r--r--doc/source/admin/drivers/irmc.rst21
-rw-r--r--ironic/drivers/modules/irmc/management.py4
-rw-r--r--ironic/tests/unit/drivers/modules/irmc/test_management.py20
-rw-r--r--releasenotes/notes/irmc-align-with-ironic-default-boot-mode-dde6f65ea084c9e6.yaml12
4 files changed, 40 insertions, 17 deletions
diff --git a/doc/source/admin/drivers/irmc.rst b/doc/source/admin/drivers/irmc.rst
index 521d464cb..83d7eccb3 100644
--- a/doc/source/admin/drivers/irmc.rst
+++ b/doc/source/admin/drivers/irmc.rst
@@ -123,11 +123,6 @@ Configuration via ``driver_info``
the iRMC with administrator privileges.
- ``driver_info/irmc_password`` property to be ``password`` for
irmc_username.
- - ``properties/capabilities`` property to be ``boot_mode:uefi`` if
- UEFI boot is required.
- - ``properties/capabilities`` property to be ``secure_boot:true`` if
- UEFI Secure Boot is required. Please refer to `UEFI Secure Boot Support`_
- for more information.
* If ``port`` in ``[irmc]`` section of ``/etc/ironic/ironic.conf`` or
``driver_info/irmc_port`` is set to 443, ``driver_info/irmc_verify_ca``
@@ -191,6 +186,22 @@ Configuration via ``driver_info``
- ``driver_info/irmc_snmp_priv_password`` property to be the privacy protocol
pass phrase. The length of pass phrase should be at least 8 characters.
+
+Configuration via ``properties``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* Each node is configured for ``irmc`` hardware type by setting the following
+ ironic node object's properties:
+
+ - ``properties/capabilities`` property to be ``boot_mode:uefi`` if
+ UEFI boot is required, or ``boot_mode:bios`` if Legacy BIOS is required.
+ If this is not set, ``default_boot_mode`` at ``[default]`` section in
+ ``ironic.conf`` will be used.
+ - ``properties/capabilities`` property to be ``secure_boot:true`` if
+ UEFI Secure Boot is required. Please refer to `UEFI Secure Boot Support`_
+ for more information.
+
+
Configuration via ``ironic.conf``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/ironic/drivers/modules/irmc/management.py b/ironic/drivers/modules/irmc/management.py
index 079ae9e44..7f480fd4b 100644
--- a/ironic/drivers/modules/irmc/management.py
+++ b/ironic/drivers/modules/irmc/management.py
@@ -27,9 +27,9 @@ from ironic.conductor import task_manager
from ironic.conductor import utils as manager_utils
from ironic import conf
from ironic.drivers import base
+from ironic.drivers.modules import boot_mode_utils
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules.irmc import common as irmc_common
-from ironic.drivers import utils as driver_utils
irmc = importutils.try_import('scciclient.irmc')
@@ -252,7 +252,7 @@ class IRMCManagement(ipmitool.IPMIManagement):
"Invalid boot device %s specified.") % device)
uefi_mode = (
- driver_utils.get_node_capability(task.node, 'boot_mode') == 'uefi')
+ boot_mode_utils.get_boot_mode(task.node) == 'uefi')
# disable 60 secs timer
timeout_disable = "0x00 0x08 0x03 0x08"
diff --git a/ironic/tests/unit/drivers/modules/irmc/test_management.py b/ironic/tests/unit/drivers/modules/irmc/test_management.py
index c4b152ae9..b2ab5afce 100644
--- a/ironic/tests/unit/drivers/modules/irmc/test_management.py
+++ b/ironic/tests/unit/drivers/modules/irmc/test_management.py
@@ -202,7 +202,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0x80 0x04 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xa0 0x04 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -216,7 +216,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0xc0 0x04 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xe0 0x04 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -231,7 +231,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0x80 0x08 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xa0 0x08 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -245,7 +245,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0xc0 0x08 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xe0 0x08 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -260,7 +260,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0x80 0x20 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xa0 0x20 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -274,7 +274,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0xc0 0x20 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xe0 0x20 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -289,7 +289,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0x80 0x18 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xa0 0x18 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -303,7 +303,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0xc0 0x18 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xe0 0x18 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -318,7 +318,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0x80 0x0c 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xa0 0x0c 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
@@ -332,7 +332,7 @@ class IRMCManagementTestCase(test_common.BaseIRMCTest):
self._test_management_interface_set_boot_device_ok(
None,
params,
- "0x00 0x08 0x05 0xc0 0x0c 0x00 0x00 0x00")
+ "0x00 0x08 0x05 0xe0 0x0c 0x00 0x00 0x00")
self._test_management_interface_set_boot_device_ok(
'bios',
params,
diff --git a/releasenotes/notes/irmc-align-with-ironic-default-boot-mode-dde6f65ea084c9e6.yaml b/releasenotes/notes/irmc-align-with-ironic-default-boot-mode-dde6f65ea084c9e6.yaml
new file mode 100644
index 000000000..2b5f7643f
--- /dev/null
+++ b/releasenotes/notes/irmc-align-with-ironic-default-boot-mode-dde6f65ea084c9e6.yaml
@@ -0,0 +1,12 @@
+---
+fixes:
+ - |
+ Modify iRMC driver to use ironic.conf [deploy] default_boot_mode to determine
+ default boot_mode.
+upgrades:
+ - Existing iRMC nodes without an explicitly set ``capabilities`` ``boot_mode``
+ will change from boot mode ``bios`` to the value of ``[deploy]
+ default_boot_mode`` (which defaults to ``uefi`` since release 18.2.0).
+
+ Explicitly setting ``capabilities`` ``boot_mode:bios`` on existing nodes
+ without any ``boot_mode`` set is recommended.