Skip to content

Commit 326a642

Browse files
committed
add a noop deploy interface patch
For infrastructure and any other devices that we do not want Ironic to manage, yet they need to be present in the Ironic inventory, we're using fake drivers when enrolling them. This is causing a problem for conductor. This patch will enable us to use noop deploy-interface with driver set to manual-management, which will save resources lookup and management that Ironic is doing.
1 parent 5cd9c8e commit 326a642

File tree

3 files changed

+86
-1
lines changed

3 files changed

+86
-1
lines changed

components/ironic/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ conf:
5151
default_deploy_interface: direct
5252
enabled_bios_interfaces: no-bios,redfish,idrac-redfish,ilo
5353
enabled_boot_interfaces: http-ipxe,ipxe,redfish-virtual-media,redfish-https,idrac-redfish-virtual-media,ilo-virtual-media,ilo-uefi-https,ilo-ipxe
54-
enabled_deploy_interfaces: direct,ramdisk
54+
enabled_deploy_interfaces: direct,ramdisk,noop
5555
enabled_firmware_interfaces: redfish,no-firmware
5656
enabled_hardware_types: redfish,idrac,ilo5,ilo
5757
enabled_inspect_interfaces: redfish,agent,idrac-redfish,ilo
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
from ironic.common import states
2+
from ironic.drivers import base
3+
4+
5+
class NoDeploy(base.DeployInterface):
6+
"""Deploy interface that does nothing and succeeds.
7+
8+
This interface allows Ironic to manage bare metal nodes for inventory,
9+
lifecycle tracking, and resource management without performing actual OS
10+
deployment operations.
11+
12+
All methods succeed immediately without performing actual operations.
13+
Node state transitions occur as expected by Ironic's state machine.
14+
"""
15+
16+
def get_properties(self):
17+
"""Return the properties of the interface.
18+
19+
Returns:
20+
dict: Empty dictionary as no configuration is required.
21+
"""
22+
return {}
23+
24+
def validate(self, task):
25+
"""Validate the driver-specific Node deployment info.
26+
27+
This method intentionally accepts any node configuration for noop deploy.
28+
29+
Args:
30+
task: A TaskManager instance containing the node to act on.
31+
"""
32+
pass
33+
34+
@base.deploy_step(priority=100)
35+
def deploy(self, task):
36+
"""Perform a deployment to a node.
37+
38+
This method returns None to indicate synchronous success without
39+
performing any actual deployment operations.
40+
41+
Args:
42+
task: A TaskManager instance containing the node to act on.
43+
44+
Returns:
45+
None: Indicates synchronous completion.
46+
"""
47+
return None
48+
49+
def tear_down(self, task):
50+
"""Tear down a previous deployment on the task's node.
51+
52+
Args:
53+
task: A TaskManager instance containing the node to act on.
54+
55+
Returns:
56+
states.DELETED: Indicates the node is torn down.
57+
"""
58+
return states.DELETED
59+
60+
def prepare(self, task):
61+
"""Prepare the deployment environment for the task's node.
62+
63+
Args:
64+
task: A TaskManager instance containing the node to act on.
65+
"""
66+
pass
67+
68+
def clean_up(self, task):
69+
"""Clean up the deployment environment for the task's node.
70+
71+
Args:
72+
task: A TaskManager instance containing the node to act on.
73+
"""
74+
pass
75+
76+
def take_over(self, task):
77+
"""Take over management of this task's node from a dead conductor.
78+
79+
Args:
80+
task: A TaskManager instance containing the node to act on.
81+
"""
82+
pass

python/ironic-understack/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ resource-class = "ironic_understack.resource_class:ResourceClassHook"
2323
redfish-understack = "ironic_understack.redfish_inspect_understack:UnderstackRedfishInspect"
2424
idrac-redfish-understack = "ironic_understack.redfish_inspect_understack:UnderstackDracRedfishInspect"
2525

26+
[project.entry-points."ironic.hardware.interfaces.deploy"]
27+
noop = "ironic_understack.noop_deploy:NoDeploy"
28+
2629
[dependency-groups]
2730
test = [
2831
"pytest>=8.3.2,<9",

0 commit comments

Comments
 (0)