From 071cf9b2dd2233509c3cdb8261c0ee7b391e6b2c Mon Sep 17 00:00:00 2001 From: Vanou Ishii Date: Tue, 25 Oct 2022 01:14:44 -0400 Subject: 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 --- doc/source/admin/drivers/irmc.rst | 21 ++++++++++++++++----- ironic/drivers/modules/irmc/management.py | 4 ++-- .../unit/drivers/modules/irmc/test_management.py | 20 ++++++++++---------- ...h-ironic-default-boot-mode-dde6f65ea084c9e6.yaml | 5 +++++ 4 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/irmc-align-with-ironic-default-boot-mode-dde6f65ea084c9e6.yaml 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..2e4b5ba60 --- /dev/null +++ b/releasenotes/notes/irmc-align-with-ironic-default-boot-mode-dde6f65ea084c9e6.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Modify iRMC driver to use ironic.conf [deploy] default_boot_mode to determine + default boot_mode. -- cgit v1.2.1