Skip to content

Commit bb97016

Browse files
committed
Update BIOS settings to disable SecureBoot
We were previously deferring BIOS settings until after agent inspection. Most of the settings are to support PXE boot, and were not required for our virtual-media-based agent inspection. Setting of SecureBoot is actually important for virtual-media boot, so we now set BIOS settings ahead of every boot: 1) basic settings to support virtual-media boot, (disable SecureBoot) 2) once pxe_interface is known, we update BIOS settings a second time to configure that.
1 parent c2a9c50 commit bb97016

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎python/understack-workflows/tests/test_enroll_server.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def test_enrol_happy_path_uses_virtual_media_inspect_and_flips_back(mocker):
251251
bmc_set_hostname.assert_called_once_with(fake_bmc, "None", "Dell-ABC123")
252252

253253
# BIOS settings configured exactly once, using pxe_enabled port BIOS names.
254-
update_dell_bios_settings.assert_called_once_with(
254+
update_dell_bios_settings.assert_any_call(
255255
fake_bmc,
256256
pxe_interface="NIC.Integrated.1-1",
257257
)

‎python/understack-workflows/understack_workflows/bmc_bios.py‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
logger = logging.getLogger(__name__)
77

88

9-
def required_bios_settings(pxe_interface: str) -> dict[str, str]:
9+
def required_bios_settings(pxe_interface: str | None) -> dict[str, str]:
1010
"""Return Bios settings map for BMC."""
11-
return {
11+
settings = {
1212
# at this time ironic conductor returns http URLs
1313
# when its serving data from its own http server
1414
"HttpDev1TlsMode": "None",
@@ -22,15 +22,20 @@ def required_bios_settings(pxe_interface: str) -> dict[str, str]:
2222
"OS-BMC.1.AdminState": "Disabled",
2323
# This closes down IPMI, which we don't use anyhow:
2424
"IPMILan.1.Enable": "Disabled",
25+
# We must disable secureboot for IPA to work
26+
"SecureBoot": "Disabled",
2527
# PXE is enabled by default on DELL, but we don't use it:
2628
"PxeDev1EnDis": "Disabled",
27-
# Configure exactly one HTTP port for booting:
28-
"HttpDev1Interface": pxe_interface,
2929
"HttpDev1EnDis": "Enabled",
3030
"HttpDev2EnDis": "Disabled",
3131
"HttpDev3EnDis": "Disabled",
3232
"HttpDev4EnDis": "Disabled",
3333
}
34+
if pxe_interface:
35+
# Configure exactly one HTTP port for booting:
36+
settings["HttpDev1Interface"] = pxe_interface
37+
38+
return settings
3439

3540

3641
def required_change_for_bios_setting(
@@ -77,7 +82,7 @@ def required_change_for_bios_setting(
7782
return required_value
7883

7984

80-
def update_dell_bios_settings(bmc: Bmc, pxe_interface: str) -> dict:
85+
def update_dell_bios_settings(bmc: Bmc, pxe_interface: str | None) -> dict:
8186
"""Check and update BIOS settings to standard as required.
8287
8388
Any changes take effect on next server reboot.

‎python/understack-workflows/understack_workflows/main/enroll_server.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ def enroll(
112112
# port data is set up in a manner that suits the Neutron algorithm. If a
113113
# normal PXE/HTTP port is available then we use it instead:
114114

115-
virtual_media = not bool(ironic_node.pxe_enabled_bios_name(node))
116-
agent_inspection(node, virtual_media=virtual_media)
115+
pxe_interface = ironic_node.pxe_enabled_bios_name(node)
116+
update_dell_bios_settings(bmc, pxe_interface=pxe_interface)
117+
agent_inspection(node, virtual_media=not pxe_interface)
117118

118119
pxe_interface = ironic_node.pxe_enabled_bios_name(node)
119120
if not pxe_interface:

0 commit comments

Comments
 (0)