Skip to content

Commit 2c431d8

Browse files
committed
Use the redfish (out-of-band) inspection for newly enrolled nodes
This affects newly enrolled nodes, or nodes that have been re-enrolled, perhaps following maintenance, after hardware changes, or after being migrated to a new location or different network ports. We first want to do the out-of-band inspection which will enumerate the ports in the server and create ironic baremetal ports. Once that is complete we would want to do the agent inspection which will set the correct local_link_info for those ports.
1 parent 5cbfe74 commit 2c431d8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

python/understack-workflows/understack_workflows/ironic_node.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
def create_or_update(bmc: Bmc, name: str, manufacturer: str) -> IronicNodeConfiguration:
1515
"""Note interfaces/ports are not synced here, that happens elsewhere."""
1616
client = IronicClient()
17-
driver = _driver_for(manufacturer)
17+
driver, inspect_interface = _driver_for(manufacturer)
1818

1919
try:
2020
ironic_node = client.get_node(name)
2121
logger.debug(
2222
"Using existing baremetal node %s with name %s", ironic_node.uuid, name
2323
)
24-
update_ironic_node(client, bmc, ironic_node, name, driver)
24+
update_ironic_node(client, bmc, ironic_node, name, driver, inspect_interface)
2525
# Return node as IronicNodeConfiguration (duck typing - Node has same attrs)
2626
return ironic_node # type: ignore[return-value]
2727
except ironicclient.common.apiclient.exceptions.NotFound:
2828
logger.debug("Baremetal Node with name %s not found in Ironic, creating.", name)
29-
return create_ironic_node(client, bmc, name, driver)
29+
return create_ironic_node(client, bmc, name, driver, inspect_interface)
3030

3131

32-
def update_ironic_node(client, bmc, ironic_node, name, driver):
32+
def update_ironic_node(client, bmc, ironic_node, name, driver, inspect_interface):
3333
if ironic_node.provision_state not in STATES_ALLOWING_UPDATES:
3434
logger.info(
3535
"Baremetal node %s is in %s provision_state, so no updates are allowed",
@@ -46,7 +46,7 @@ def update_ironic_node(client, bmc, ironic_node, name, driver):
4646
f"driver_info/redfish_username={bmc.username}",
4747
f"driver_info/redfish_password={bmc.password}",
4848
"boot_interface=http-ipxe",
49-
"inspect_interface=agent",
49+
f"inspect_interface={inspect_interface}",
5050
]
5151

5252
patches = args_array_to_patch("add", updates)
@@ -61,6 +61,7 @@ def create_ironic_node(
6161
bmc: Bmc,
6262
name: str,
6363
driver: str,
64+
inspect_interface: str,
6465
) -> IronicNodeConfiguration:
6566
# Return node as IronicNodeConfiguration (duck typing - Node has same attrs)
6667
return client.create_node( # type: ignore[return-value]
@@ -74,13 +75,14 @@ def create_ironic_node(
7475
"redfish_password": bmc.password,
7576
},
7677
"boot_interface": "http-ipxe",
77-
"inspect_interface": "agent",
78+
"inspect_interface": inspect_interface,
7879
}
7980
)
8081

8182

82-
def _driver_for(manufacturer: str) -> str:
83+
def _driver_for(manufacturer: str) -> tuple[str, str]:
84+
"""Answer the (driver, inspect_interface) for this server."""
8385
if manufacturer.startswith("Dell"):
84-
return "idrac"
86+
return ("idrac", "idrac-redfish")
8587
else:
86-
return "redfish"
88+
return ("redfish", "redfish")

0 commit comments

Comments
 (0)