Skip to content

Commit

Permalink
Merge branch 'dev' into ubm
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboud committed Aug 2, 2023
2 parents d15c15a + 122e53f commit ae49aa5
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 45drives-tools 2.2.2-6
## 45drives-tools 2.2.3-1

* added rudimentary bus address translation for ROMED8-2T Motherboards
* updated server_identifier and lsdev to operate with ceph gateway servers more gracefully
10 changes: 5 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"__version": "45D-R1",
"name": "45drives-tools",
"title": "45drives-tools",
"prerelease": false,
"version": "2.2.2",
"buildVersion": "6",
"prerelease": true,
"version": "2.2.3",
"buildVersion": "1",
"author": "Mark Hooper <mhooper@45drives.com>",
"url": "https://github.com/45Drives/tools",
"category": "utils",
Expand Down Expand Up @@ -64,8 +64,8 @@
],
"changelog": {
"urgency": "medium",
"version": "2.2.2",
"buildVersion": "6",
"version": "2.2.3",
"buildVersion": "1",
"ignore": [],
"date": null,
"packager": "Mark Hooper <mhooper@45drives.com>",
Expand Down
7 changes: 7 additions & 0 deletions packaging/el7/main.spec
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ fi
/usr/lib/udev/rules.d/*

%changelog
* Fri Jun 23 2023 Mark Hooper <mhooper@45drives.com> 2.2.3-1
- updated server_identifier and lsdev to operate with ceph gateway servers more gracefully
* Fri Jun 23 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-8
- added contingency in server_identifier for 2U Gateway servers
* Tue Jun 13 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-7
- added a check in server_identifier to ensure that the bus address of a given HBA
matches that found in /sys/bus/pci/devices
* Mon Jun 12 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-6
- added rudimentary bus address translation for ROMED8-2T Motherboards
* Tue May 23 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-5
Expand Down
7 changes: 7 additions & 0 deletions packaging/el8/main.spec
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ fi
/usr/lib/udev/rules.d/*

%changelog
* Fri Jun 23 2023 Mark Hooper <mhooper@45drives.com> 2.2.3-1
- updated server_identifier and lsdev to operate with ceph gateway servers more gracefully
* Fri Jun 23 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-8
- added contingency in server_identifier for 2U Gateway servers
* Tue Jun 13 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-7
- added a check in server_identifier to ensure that the bus address of a given HBA
matches that found in /sys/bus/pci/devices
* Mon Jun 12 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-6
- added rudimentary bus address translation for ROMED8-2T Motherboards
* Tue May 23 2023 Mark Hooper <mhooper@45drives.com> 2.2.2-5
Expand Down
20 changes: 20 additions & 0 deletions packaging/focal/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
45drives-tools (2.2.3-1focal) focal; urgency=medium

* updated server_identifier and lsdev to operate with ceph gateway servers more
gracefully

-- Mark Hooper <mhooper@45drives.com> Fri, 23 Jun 2023 08:46:49 -0300

45drives-tools (2.2.2-8focal) focal; urgency=medium

* added contingency in server_identifier for 2U Gateway servers

-- Mark Hooper <mhooper@45drives.com> Fri, 23 Jun 2023 08:01:32 -0300

45drives-tools (2.2.2-7focal) focal; urgency=medium

* added a check in server_identifier to ensure that the bus address of a given
HBA matches that found in /sys/bus/pci/devices

-- Mark Hooper <mhooper@45drives.com> Tue, 13 Jun 2023 13:16:03 -0300

45drives-tools (2.2.2-6focal) focal; urgency=medium

* added rudimentary bus address translation for ROMED8-2T Motherboards
Expand Down
7 changes: 5 additions & 2 deletions tools/dmap
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ def create_vdev_id(server):
"2USTORNADO":{
"2U":[16,16]
},
"2UTMSTORNADO":{
"2UTM":[8,8,8,8]
},
"AV15-BASE":{
"AV15":[0]
},
Expand All @@ -459,13 +462,13 @@ def create_vdev_id(server):
# Make sure that the user didn't make any manual edits that can throw dmap.
if server["Alias Style"] not in alias_template.keys():
log("/opt/45drives/tools/dmap: !! ERROR !! Invalid Alias Style set in /etc/45drives/server_info/server_info.json")
log(" Valid Options are: ", alias_template.keys())
log(" Valid Options are: {o}".format(o=alias_template.keys()))
log(" You can manually edit this file by setting \"Edit Mode\": true")
log(" in /etc/45drives/server_info/server_info.json along with any other parameters")
sys.exit(1)
elif server["Chassis Size"] not in alias_template[server["Alias Style"]].keys():
log("/opt/45drives/tools/dmap: !! ERROR !! Invalid Chassis Size and Alias Style combination set in /etc/45drives/server_info/server_info.json")
log(" Valid Chassis Size Options for " + server["Alias Style"] + " are: ", alias_template[server["Alias Style"]].keys())
log(" Valid Chassis Size Options for " + server["Alias Style"] + " are: {o}".format(o=alias_template[server["Alias Style"]].keys()))
log(" You can manually edit this file by setting \"Edit Mode\": true")
log(" in /etc/45drives/server_info/server_info.json along with any other parameters")
sys.exit(1)
Expand Down
13 changes: 12 additions & 1 deletion tools/lsdev
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ def build_server(options):
"2USTORNADO":{
"2U":[32]
},
"2UTMSTORNADO":{
"2UTM":[32]
},
"AV15-BASE":{
"AV15":[15]
},
Expand All @@ -331,13 +334,21 @@ def build_server(options):
try:
vdev_id = open(CONFIG_PATH + "/vdev_id.conf", mode='r')
except IOError:
if "Chassis Size" in server_obj.keys() and server_obj["Chassis Size"] in ["2UGW"]:
print("This program is intended to display disk information for servers with dedicated storage bays.".format(astyle=server_obj["Alias Style"]))
print("Use command line utilities such as lsblk to see disk information for Ceph Gateways.".format(astyle=server_obj["Alias Style"]))
exit(1)
print("Error opening " + CONFIG_PATH + "/vdev_id.conf. Run `dmap`.")
exit(1)

if "Alias Style" not in server_obj.keys():
print("Unable to determine Alias Style from /etc/45drives/server_info/server_info.json: ")
print(json.dumps(server_obj,indent=4))
exit(1)
elif "Chassis Size" in server_obj.keys() and server_obj["Chassis Size"] in ["2UGW"]:
print("This program is intended to display disk information for servers with dedicated storage bays.".format(astyle=server_obj["Alias Style"]))
print("Use command line utilities such as lsblk to see disk information for Ceph Gateways.".format(astyle=server_obj["Alias Style"]))
exit(1)
elif server_obj["Alias Style"] not in alias_template.keys():
print("Unknown Alias Style '{astyle}' encountered.".format(astyle=server_obj["Alias Style"]))
exit(1)
Expand Down Expand Up @@ -618,7 +629,7 @@ def print_bays(server, options, osd, server_info):
table_print(ansi = options.colour, c_count = len(print_array), c_txt = print_array, c_labels = col_headers, h_txt = header_text, padding = 1)

# legend
if "Alias Style" in server_info.keys() and server_info["Alias Style"] != "2USTORNADO":
if "Alias Style" in server_info.keys() and server_info["Alias Style"] not in ["2USTORNADO","2UTMSTORNADO"]:
print(" <-- motherboard | front plate -->")
print(" Legend:")
if options.colour:
Expand Down
39 changes: 32 additions & 7 deletions tools/server_identifier
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,25 @@ g_product_lut_idx = {
"ALIAS_STYLE": 4
}

g_chassis_sizes = ["?","AV15","Q30","S45","XL60","F8X1","F8X2","F8X3"]
g_chassis_sizes = ["?","AV15","Q30","S45","XL60","F8X1","F8X2","F8X3","2U","2UGW","2UTM"]

g_mobo_to_version_lut = {
"Base": ["X11SSH-CTF","X11SSM-F"],
"Base-B": ["X11SPL-F"],
"Enhanced": ["X11SPL-F","X10SRL-F"],
"Enhanced-S":["X11SPL-F"],
"Enhanced-AMD":["H11SSL-i"],
"Turbo": ["X11DPL-i","X10DRL-i"],
"Turbo-G":["X11SPL-F"],
"Turbo": ["X11DPL-i","X10DRL-i","X12DPi-N6"],
"Turbo-G":["X11SPL-F","X12DPi-N6"],
}

g_product_lut = {
"Gateway-2UGW-Base": [g_mobo_to_version_lut["Base"],0,0,"2UGW","2UGW"],
"Gateway-2UGW-Base-B": [g_mobo_to_version_lut["Base"],0,0,"2UGW","2UGW"],
"Gateway-2UGW-Enhanced": [g_mobo_to_version_lut["Enhanced"],0,0,"2UGW","2UGW"],
"Gateway-2UGW-Enhanced-S": [g_mobo_to_version_lut["Enhanced"],0,0,"2UGW","2UGW"],
"Gateway-2UGW-Turbo-G": [g_mobo_to_version_lut["Turbo"],0,0,"2UGW","2UGW"],

"Storinator-AV15-Base": [g_mobo_to_version_lut["Base"],0,0,"AV15","AV15-BASE"],
"Storinator-AV15-Base-B": [g_mobo_to_version_lut["Base-B"],0,1,"AV15","STORINATOR"],
"Storinator-AV15-Enhanced": [g_mobo_to_version_lut["Enhanced"],0,1,"AV15","STORINATOR"],
Expand Down Expand Up @@ -184,6 +190,12 @@ g_product_lut = {
"Stornado-2U-Turbo-G": [g_mobo_to_version_lut["Turbo-G"] ,0,2,"2U","2USTORNADO"],
"Stornado-2U-Turbo": [g_mobo_to_version_lut["Turbo"] ,0,2,"2U","2USTORNADO"],

"Stornado-2UTM-Base-B": [g_mobo_to_version_lut["Base-B"] ,0,4,"2UTM","2UTMSTORNADO"],
"Stornado-2UTM-Enhanced-AMD": [g_mobo_to_version_lut["Enhanced-AMD"] ,0,4,"2UTM","2UTMSTORNADO"],
"Stornado-2UTM-Enhanced-S": [g_mobo_to_version_lut["Enhanced-S"] ,0,4,"2UTM","2UTMSTORNADO"],
"Stornado-2UTM-Turbo-G": [g_mobo_to_version_lut["Turbo-G"] ,0,4,"2UTM","2UTMSTORNADO"],
"Stornado-2UTM-Turbo": [g_mobo_to_version_lut["Turbo"] ,0,4,"2UTM","2UTMSTORNADO"],

"Destroyinator-AV15-Enhanced": [g_mobo_to_version_lut["Enhanced"],0,1,"AV15","DESTROYINATOR"],
"Destroyinator-AV15-Enhanced-S": [g_mobo_to_version_lut["Enhanced-S"],0,1,"AV15","DESTROYINATOR"],
"Destroyinator-Q30-Enhanced": [g_mobo_to_version_lut["Enhanced"] ,0,2,"Q30","DESTROYINATOR"],
Expand Down Expand Up @@ -467,6 +479,8 @@ def hba_lspci(server):
for pci_slot in pci_slots:
for card in hba:
if card["Bus Address"] in pci_slot["Bus Address"]:
# The bus address provided by dmidecode contains the bus address provided by lspci.
# we can assign the PCI Slot accordingly.
card["PCI Slot"] = pci_slot["ID"]
if len(sys_bus_addrs) > 0 and pci_slot["Bus Address"] not in sys_bus_addrs:
# dmidecode gave a bus address that does not match the one used by the system
Expand All @@ -481,14 +495,25 @@ def hba_lspci(server):
# use the bus address provided by dmidecode
# update the cards bus address to the full format (eg: 0000:01:00.0)
card["Bus Address"] = pci_slot["Bus Address"]

#sort the final list of hba cards by the Bus Address field. This ensures that
#the order in which they are stored resembles the lspci output. which has
#worked reliably in the past.

#ensure that the bus address is the one in use by the system.
verify_bus_addresses(sys_bus_addrs,hba)

#sort them in ascending order
hba = sorted(hba, key=lambda k: k['Bus Address'])

return hba, hybrid_flag

def verify_bus_addresses(sys_bus_addrs,hba_cards):
for card in hba_cards:
if len(sys_bus_addrs) > 0:
for j in range(0,len(sys_bus_addrs)):
if card["Bus Address"] in sys_bus_addrs[j]:
# we have found the system bus address that matches the substring
# address provided by lspci update the card's bus address field
card["Bus Address"] = sys_bus_addrs[j]
break

def hba():
# determine the model and count of hba cards present in the system
# by parsing the output of /opt/45drives/tools/storcli64 show.
Expand Down

0 comments on commit ae49aa5

Please sign in to comment.