diff --git a/containers/ironic/patches/0001-fix-iPXE-boot-interface-neutron-logic-detection.patch b/containers/ironic/patches/0001-fix-iPXE-boot-interface-neutron-logic-detection.patch new file mode 100644 index 000000000..64ee774bc --- /dev/null +++ b/containers/ironic/patches/0001-fix-iPXE-boot-interface-neutron-logic-detection.patch @@ -0,0 +1,59 @@ +From 80418173262b8578710c79d2181c0da9c80b2bd5 Mon Sep 17 00:00:00 2001 +From: Milan Fencik +Date: Mon, 15 Dec 2025 17:46:25 +0000 +Subject: [PATCH] fix: iPXE boot interface neutron logic detection + +The neutron network interface's add_ports_to_network() function only +checked for 'pxe_boot' capability when determining PXE capability, +but iPXE is also a form of PXE booting and should be treated the +same way. This caused inconsistent behavior for boot interfaces like +'http-ipxe' that have 'ipxe_boot' capability but not 'pxe_boot' +capability. + +Without this fix, iPXE boot interfaces were incorrectly treated as +non-PXE capable, causing the neutron interface to create ports for +all baremetal ports with local_link_connection info during cleaning +operations, regardless of their pxe_enabled setting. + +This change updates the pxe_capability detection logic to include +'ipxe_boot' capability alongside 'pxe_boot', ensuring that iPXE +boot interfaces are correctly recognized as PXE-capable. + +As a secondary benefit, this also fixes an inconsistency where the +port deletion logic in remove_ports_from_network() was not using +the same pxe_capability logic as port creation, which did lead +to orphaned neutron ports after cleaning operations. + +Change-Id: I7721f917fb723e8a4cef69e0f7be1ece0238d7ed +Signed-off-by: Milan Fencik +--- + ironic/common/neutron.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/ironic/common/neutron.py b/ironic/common/neutron.py +index 9f95073b7..82cf64375 100644 +--- a/ironic/common/neutron.py ++++ b/ironic/common/neutron.py +@@ -304,7 +304,8 @@ def add_ports_to_network(task, network_uuid, security_groups=None): + """ + client = get_client(context=task.context) + node = task.node +- pxe_capability = 'pxe_boot' in task.driver.boot.capabilities ++ pxe_capability = ('pxe_boot' in task.driver.boot.capabilities ++ or 'ipxe_boot' in task.driver.boot.capabilities) + add_all_ports = CONF.neutron.add_all_ports or not pxe_capability + + # If Security Groups are specified, verify that they exist +@@ -489,7 +490,9 @@ def remove_ports_from_network(task, network_uuid): + :param network_uuid: UUID of a neutron network ports will be deleted from. + :raises: NetworkError + """ +- add_all_ports = CONF.neutron.add_all_ports ++ pxe_capability = ('pxe_boot' in task.driver.boot.capabilities ++ or 'ipxe_boot' in task.driver.boot.capabilities) ++ add_all_ports = CONF.neutron.add_all_ports or not pxe_capability + if not add_all_ports: + macs = [p.address for p in task.ports if p.pxe_enabled] + else: +-- +2.39.2 (Apple Git-143) diff --git a/containers/ironic/patches/series b/containers/ironic/patches/series index 0148cd532..291e76376 100644 --- a/containers/ironic/patches/series +++ b/containers/ironic/patches/series @@ -2,3 +2,4 @@ 0001-Solve-IPMI-call-issue-results-in-UTF-8-format-error-.patch 0001-fix-use-the-correct-path-to-the-image-when-deep-imag.patch 0001-fix-agent-inspection-hooks-failure-does-not-clean-up.patch +0001-fix-iPXE-boot-interface-neutron-logic-detection.patch