diff options
author | Vanou Ishii <ishii.vanou@fujitsu.com> | 2022-10-25 01:14:44 -0400 |
---|---|---|
committer | Riccardo Pittau <elfosardo@gmail.com> | 2022-12-12 09:32:45 +0000 |
commit | 0ac3894c137d187bae0a5aee1852a5526fb776df (patch) | |
tree | e952d9afd990dff7ead852a5b037934e6d2b74c2 | |
parent | ca56a06d4d3d2f80c1515e0e6e1c1c5c91196a4a (diff) | |
download | ironic-0ac3894c137d187bae0a5aee1852a5526fb776df.tar.gz |
Align iRMC driver with Ironic's default boot_mode
This commit modifies iRMC driver to use ironic.conf [deploy]
default_boot_mode as default value of boot_mode.
Before this commit, iRMC driver assumes Legacy BIOS as default
boot_mode and value of default_boot_mode doesn't have any effect
on iRMC driver's behavior.
Story: 2010381
Task: 46643
Change-Id: Ic5a235785a1a2bb37fef38bd3a86f40125acb3d9
4 files changed, 39 insertions, 17 deletions
diff --git a/doc/source/admin/drivers/irmc.rst b/doc/source/admin/drivers/irmc.rst index a839e3d91..d99d84209 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`` @@ -201,6 +196,21 @@ Configuration via ``driver_info`` will be ignored. If you want to set passwords, please update python-scciclient to some newer version (>= 0.12.2). +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. |