Skip to content

Commit 1ddf92f

Browse files
authored
Merge pull request redhat-performance#414 from grafuls/development
fix: blade host overrides
2 parents 8f670cc + 0335109 commit 1ddf92f

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,11 @@ We format the key strings with the following criteria:
676676
```
677677
{host_type}_[{rack}_[{ULocation}_[{blade}_]]]{model}_interfaces
678678
```
679-
With rack, ULocation and blade being optional in a hierarchical fashion otherwise mandatory, ergo you can't define blade without ULocation and so forth. host_type and model values are always mandatory.
679+
Additionally we can do a blade only override like:
680+
```
681+
{host_type}_[{blade}_]{model}_interfaces
682+
```
683+
With rack, ULocation and blade being optional in a hierarchical fashion otherwise mandatory with the exception of the blade, as we can now use the blade independently from rack and ULocation. host_type and model values are always mandatory.
680684
681685
#### Example for director type overrides:
682686

config/idrac_interfaces.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#
55
# Also see /opt/quads/quads/config.py SUPPORTED list if adding system types.
66
#
7-
director_fc640_b01_interfaces: NIC.ChassisSlot.8-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
8-
director_fc640_b02_interfaces: NIC.ChassisSlot.4-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
9-
director_fc640_b03_interfaces: NIC.ChassisSlot.6-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
10-
director_fc640_b04_interfaces: NIC.ChassisSlot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
7+
director_b01_fc640_interfaces: NIC.ChassisSlot.8-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
8+
director_b02_fc640_interfaces: NIC.ChassisSlot.4-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
9+
director_b03_fc640_interfaces: NIC.ChassisSlot.6-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
10+
director_b04_fc640_interfaces: NIC.ChassisSlot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
1111
director_r630_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Slot.2-1-1
1212
director_r640_interfaces: NIC.Slot.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
1313
director_r650_interfaces: NIC.Slot.1-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
@@ -20,10 +20,10 @@ director_r750_interfaces: NIC.Slot.3-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
2020
director_7425_interfaces: NIC.Integrated.1-1-1,NIC.Integrated.1-2-1,NIC.Slot.7-2-1,NIC.Slot.7-1-1,NIC.Integrated.1-3-1,HardDisk.List.1-1
2121
director_7525_interfaces: NIC.Integrated.1-1-1,NIC.Integrated.1-2-1,NIC.Slot.6-1-1,NIC.Slot.6-2-1,NIC.Embedded.1-1-1,HardDisk.List.1-1
2222
director_r930_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
23-
foreman_fc640_b01_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.8-1-1
24-
foreman_fc640_b02_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.4-1-1
25-
foreman_fc640_b03_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.6-1-1
26-
foreman_fc640_b04_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.2-1-1
23+
foreman_b01_fc640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.8-1-1
24+
foreman_b02_fc640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.4-1-1
25+
foreman_b03_fc640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.6-1-1
26+
foreman_b04_fc640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.ChassisSlot.2-1-1
2727
foreman_r630_interfaces: NIC.Slot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-2-1
2828
foreman_r640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Slot.1-2-1
2929
foreman_r650_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Slot.1-1-1
@@ -40,10 +40,10 @@ foreman_r930_interfaces: NIC.Integrated.1-3-1,HardDisk.List.1-1,NIC.Integrated.1
4040
# Expanding rest of models as a workaround for issue #239
4141
uefi_r630_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Slot.2-1-1
4242
uefi_r640_interfaces: NIC.Integrated.1-1-1,HardDisk.List.1-1,NIC.Slot.1-1-1
43-
uefi_fc640_b01_interfaces: NIC.ChassisSlot.8-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
44-
uefi_fc640_b02_interfaces: NIC.ChassisSlot.4-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
45-
uefi_fc640_b03_interfaces: NIC.ChassisSlot.6-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
46-
uefi_fc640_b04_interfaces: NIC.ChassisSlot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
43+
uefi_b01_fc640_interfaces: NIC.ChassisSlot.8-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
44+
uefi_b02_fc640_interfaces: NIC.ChassisSlot.4-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
45+
uefi_b03_fc640_interfaces: NIC.ChassisSlot.6-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
46+
uefi_b04_fc640_interfaces: NIC.ChassisSlot.2-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
4747
uefi_r630_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Slot.2-1-1
4848
uefi_r640_interfaces: NIC.Slot.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
4949
uefi_r650_interfaces: NIC.Slot.1-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
@@ -57,6 +57,7 @@ uefi_r750_interfaces: NIC.Slot.3-1-1,HardDisk.List.1-1,NIC.Integrated.1-1-1
5757
uefi_7425_interfaces: NIC.Integrated.1-1-1,NIC.Integrated.1-2-1,NIC.Slot.7-2-1,NIC.Slot.7-1-1,NIC.Integrated.1-3-1,HardDisk.List.1-1
5858
uefi_7525_interfaces: NIC.Integrated.1-1-1,NIC.Integrated.1-2-1,NIC.Slot.6-1-1,NIC.Slot.6-2-1,NIC.Embedded.1-1-1,HardDisk.List.1-1
5959
uefi_r930_interfaces: NIC.Integrated.1-2-1,HardDisk.List.1-1,NIC.Integrated.1-3-1
60+
uefi_mx750c_interfaces: NIC.PxeDevice.1-1,RAID.SL.3-2
6061

6162
# To understand how custom overrides and hierarchy work please see https://github.com/redhat-performance/badfish#host-type-overrides
6263
#PerfLab
@@ -66,6 +67,8 @@ foreman_bb37_r750_interfaces: NIC.Embedded.1-1-1,HardDisk.List.1-1,NIC.Slot.3-1-
6667
director_bb37_r750_interfaces: NIC.Slot.3-1-1,HardDisk.List.1-1,NIC.Embedded.1-1-1
6768
foreman_r760_interfaces: NIC.PxeDevice.1-1,RAID.SL.3-2
6869
director_r760_interfaces: RAID.SL.3-2,NIC.PxeDevice.1-1
70+
foreman_mx750c_interfaces: NIC.PxeDevice.1-1,RAID.SL.3-2
71+
director_mx750c_interfaces: RAID.SL.3-2,NIC.PxeDevice.1-1
6972

7073
# Custom Rack F04
7174
director_f18_r640_interfaces: NIC.Slot.3-2,HardDisk.List.1-1,NIC.Slot.3-1,NIC.Slot.2-1,NIC.Slot.2-2,NIC.Integrated.1-1-1

src/badfish/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,12 @@ async def get_interfaces_by_type(self, host_type, _interfaces_path):
209209
if len(host_name_split) > 4:
210210
host_blade = host_name_split[3]
211211

212-
prefix = [host_type, rack, uloc]
212+
prefix = [host_type, rack, uloc, host_blade]
213213

214-
b_pattern = re.compile("b0[0-9]")
215-
if b_pattern.match(host_blade):
216-
host_model = "%s_%s" % (host_model, host_blade)
214+
key = f"{host_type}_{host_blade}_{host_model}_interfaces"
215+
interfaces_string = definitions.get(key)
216+
if interfaces_string:
217+
return interfaces_string.split(",")
217218

218219
len_prefix = len(prefix)
219220
key = "None"

0 commit comments

Comments
 (0)