Skip to content

Commit b8edacd

Browse files
authored
Merge pull request #1599 from rackerlabs/add-ironic-port-category-hack
feat(ironic): ignore ports with the storage category from attachment
2 parents 9f71164 + 0f51564 commit b8edacd

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 60cc94d4c3271efcfd787c6276e306ee14cdce72 Mon Sep 17 00:00:00 2001
2+
From: Doug Goldstein <cardoe@cardoe.com>
3+
Date: Tue, 13 Jan 2026 11:08:04 -0600
4+
Subject: [PATCH] hack: for scheduling purposes ignore ports with category
5+
storage
6+
7+
We want to ignore ports that are in category storage for being eligible
8+
for attachment. This is a hack until TBN arrives and we can utilize
9+
that.
10+
11+
Change-Id: Ibc211ed8e6b9e5933ff657605933efd4c84fb77e
12+
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
13+
---
14+
ironic/drivers/modules/network/common.py | 17 +++++++++++++++++
15+
1 file changed, 17 insertions(+)
16+
17+
diff --git a/ironic/drivers/modules/network/common.py b/ironic/drivers/modules/network/common.py
18+
index 04413663c..1ab3e4dbe 100644
19+
--- a/ironic/drivers/modules/network/common.py
20+
+++ b/ironic/drivers/modules/network/common.py
21+
@@ -34,6 +34,21 @@ LOG = log.getLogger(__name__)
22+
TENANT_VIF_KEY = 'tenant_vif_port_id'
23+
24+
25+
+def _port_category_hack(port_like_obj):
26+
+ """Hack until we get TBN."""
27+
+
28+
+ category = getattr(port_like_obj, "category", "")
29+
+ if category == "network":
30+
+ # if the category is "network", then we want this port
31+
+ return True
32+
+ elif category == "storage":
33+
+ # if the category is "storage", we don't want this port
34+
+ return False
35+
+ else:
36+
+ # if its unset, backwards compat and attempt to use the port
37+
+ return True
38+
+
39+
+
40+
def _vif_attached(port_like_obj, vif_id):
41+
"""Check if VIF is already attached to a port or portgroup.
42+
43+
@@ -130,6 +145,8 @@ def _get_free_portgroups_and_ports(task, vif_id, physnets, vif_info={}):
44+
continue
45+
if not _is_port_physnet_allowed(p, physnets):
46+
continue
47+
+ if not _port_category_hack(p):
48+
+ continue
49+
if p.portgroup_id is None and not portgroup_uuid:
50+
free_port_like_objs.append(p)
51+
else:
52+
--
53+
2.50.1 (Apple Git-155)

containers/ironic/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
0001-Solve-IPMI-call-issue-results-in-UTF-8-format-error-.patch
33
0001-Add-SKU-field-to-Redfish-inspection.patch
44
0001-fix-redfish-inspect-system-product-name.patch
5+
0001-hack-for-scheduling-purposes-ignore-ports-with-categ.patch

0 commit comments

Comments
 (0)