From a3cd98314b4ed5f784ccefae7892bcb3b86f8912 Mon Sep 17 00:00:00 2001 From: muthuku Date: Fri, 9 Jan 2026 13:09:48 +0000 Subject: [PATCH] added validation for cfd CSCwr08802 --- aci-preupgrade-validation-script.py | 44 +++++++++++++ docs/docs/validations.md | 19 ++++++ .../eqptFlash_affected_models.json | 53 ++++++++++++++++ .../eqptFlash_unaffected_models.json | 49 +++++++++++++++ .../test_ssd_firmware_version_check.py | 61 +++++++++++++++++++ 5 files changed, 226 insertions(+) create mode 100644 tests/checks/ssd_firmware_version_check/eqptFlash_affected_models.json create mode 100644 tests/checks/ssd_firmware_version_check/eqptFlash_unaffected_models.json create mode 100644 tests/checks/ssd_firmware_version_check/test_ssd_firmware_version_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index ebe0477..2ac2a76 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6007,6 +6007,49 @@ def apic_vmm_inventory_sync_faults_check(**kwargs): recommended_action=recommended_action, doc_url=doc_url) + +@check_wrapper(check_title='SSD Firmware Version Check') +def ssd_firmware_version_check(tversion, **kwargs): + result = PASS + headers = ["Node_ID","SSD model", "Firmware version"] + data = [] + + recommended_action = 'Contact Cisco TAC to upgrade SSD firmware to an unaffected version' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#ssd-firmware-version-check' + + if not tversion: + return Result(result=MANUAL, msg=TVER_MISSING) + + if tversion.older_than("6.1(5h)"): + + eqptFlash_api = 'eqptFlash.json' + ssd_details = icurl('class', eqptFlash_api) + if not ssd_details: + return Result(result=FAIL_UF, msg="No eqptFlash object found in the system. Cannot validate SSD firmware versions.", doc_url=doc_url) + + models_to_check = ['Micron_5400', 'Micron_5300', 'Micron_5100'] + version_to_check = ['D0MU078', 'D3CN003', 'D3MU005', 'D4CN005'] + + for ssd_data in ssd_details: + node_dn = ssd_data['eqptFlash']['attributes']['dn'] + model = ssd_data['eqptFlash']['attributes']['model'] + firmware_version = ssd_data['eqptFlash']['attributes']['rev'] + + node_match = re.search(r"node-(?P\d+)", node_dn) + node_id = node_match.group('node') + + if any(m in model for m in models_to_check): + if any(firmware_version.startswith(v[:4]) and firmware_version < v for v in version_to_check): + data.append([node_id, model, firmware_version]) + else: + return Result(result=NA, msg=VER_NOT_AFFECTED) + + if data: + result = FAIL_O + + return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) + + # ---- Script Execution ---- @@ -6168,6 +6211,7 @@ class CheckManager: standby_sup_sync_check, isis_database_byte_check, configpush_shard_check, + ssd_firmware_version_check, ] ssh_checks = [ diff --git a/docs/docs/validations.md b/docs/docs/validations.md index fa1fc0e..b3cfd7a 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -191,6 +191,7 @@ Items | Defect | This Script [Stale pconsRA Object][d26] | CSCwp22212 | :warning:{title="Deprecated"} | :no_entry_sign: [ISIS DTEPs Byte Size][d27] | CSCwp15375 | :white_check_mark: | :no_entry_sign: [Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: | +[ssd_firmware_version_check][d29] | CSCwr08802 | :white_check_mark: | :no_entry_sign: [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -220,6 +221,7 @@ Items | Defect | This Script [d26]: #stale-pconsra-object [d27]: #isis-dteps-byte-size [d28]: #policydist-configpushshardcont-crash +[d29]: #ssd-firmware-version-check ## General Check Details @@ -2613,6 +2615,21 @@ Due to [CSCwp95515][59], upgrading to an affected version while having any `conf If any instances of `configpushShardCont` are flagged by this script, Cisco TAC must be contacted to identify and resolve the underlying issue before performing the upgrade. +### ssd firmware version check + +RCA: + +if Switch SSD model is identifed as Micron 5100 or 5300 or 5400 and SSD firmware version is lower than the(D0MU078, D3CN003, D3MU005. and D4CN005), firmware upgrade is required to mitigate the core exception issue. + +Impact: + +Due to [CSCwr08802][62], Switch reloads due to a hap-reset with no core file collected by sysmgr from the time of the crash. Usually this is seen with processes epm or epmc however other processes may also be affected. + +Suggestion: + +This check will identify the affected SSD firmware and alert if the affected version is detected. +Cisco TAC must be contacted to Upgrade identified SSD firmware for the fixed. + [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script [1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html @@ -2676,3 +2693,5 @@ If any instances of `configpushShardCont` are flagged by this script, Cisco TAC [59]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp95515 [60]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#Inter [61]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#EnablePolicyCompression +[62]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwr08802 + diff --git a/tests/checks/ssd_firmware_version_check/eqptFlash_affected_models.json b/tests/checks/ssd_firmware_version_check/eqptFlash_affected_models.json new file mode 100644 index 0000000..9ca736e --- /dev/null +++ b/tests/checks/ssd_firmware_version_check/eqptFlash_affected_models.json @@ -0,0 +1,53 @@ + [ + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1104/sys/ch/supslot-1/sup/flash", + "model": "Micron_5100_MTFDDAV240TCB", + "rev": "D0MU073", + "ser": "PHYH2515051U240J" + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1105/sys/ch/supslot-1/sup/flash", + "model": "Micron_5400_MTFDDAV240TGA", + "rev": "D4CN001", + "ser": "BTYH2262071T240J" + + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1102/sys/ch/supslot-1/sup/flash", + "model": "Micron_5300_MTFDDAV240TGA", + "rev": "D3CN002", + "ser": "PHYH251504SK240J" + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1102/sys/ch/supslot-1/sup/flash", + "model": "Micron_5300_MTFDDAV240TGA", + "rev": "D3MU004", + "ser": "PHYH251504SK240J" + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1101/sys/ch/supslot-1/sup/flash", + "model": "SSDSCKKB240G8K", + "rev": "XC311132", + "ser": "PHYH239002C0240J" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/ssd_firmware_version_check/eqptFlash_unaffected_models.json b/tests/checks/ssd_firmware_version_check/eqptFlash_unaffected_models.json new file mode 100644 index 0000000..af433c0 --- /dev/null +++ b/tests/checks/ssd_firmware_version_check/eqptFlash_unaffected_models.json @@ -0,0 +1,49 @@ + [ + { + "eqptFlash": { + "attributes": { + + "dn": "topology/pod-1/node-1104/sys/ch/supslot-1/sup/flash", + "model": "SSDSCKKB240G8K", + "rev": "XC311132" + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1105/sys/ch/supslot-1/sup/flash", + "model": "SSDSCKKB240G8K", + "rev": "XC311132" + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1102/sys/ch/supslot-1/sup/flash", + "model": "SSDSCKKB240G8K", + "rev": "XC311132" + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-1/node-1103/sys/ch/supslot-1/sup/flash", + "model": "SSDSCKKB240G8K", + "rev": "XC311132" + + } + } + }, + { + "eqptFlash": { + "attributes": { + "dn": "topology/pod-2/node-1109/sys/ch/supslot-1/sup/flash", + "model": "SSDSCKKB240G8K", + "rev": "XC311132" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/ssd_firmware_version_check/test_ssd_firmware_version_check.py b/tests/checks/ssd_firmware_version_check/test_ssd_firmware_version_check.py new file mode 100644 index 0000000..e617f6a --- /dev/null +++ b/tests/checks/ssd_firmware_version_check/test_ssd_firmware_version_check.py @@ -0,0 +1,61 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + +test_function = "ssd_firmware_version_check" + +# icurl queries +eqptFlash_api = 'eqptFlash.json' + + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + # TVERSION not supplied + ( + {eqptFlash_api: read_data(dir, "eqptFlash_unaffected_models.json")}, + None, + script.MANUAL, + ), + + # No eqptFlash objects + ( + {eqptFlash_api: []}, + "5.2(5e)", + script.FAIL_UF, + ), + + # eqptFlash objects present, going to affected apic version and affected firmware models + ( + {eqptFlash_api: read_data(dir, "eqptFlash_affected_models.json")}, + "5.2(6a)", + script.FAIL_O, + ), + + # eqptFlash objects present, going to affected apic version and unaffected firmware models + ( + {eqptFlash_api: read_data(dir, "eqptFlash_unaffected_models.json")}, + "5.2(6a)", + script.PASS, + ), + + # Fixed Target Version + ( + {eqptFlash_api: read_data(dir, "eqptFlash_unaffected_models.json")}, + "6.2(1a)", + script.NA, + ), + ], +) +def test_logic(run_check, mock_icurl, tversion, expected_result): + result = run_check( + tversion=script.AciVersion(tversion) if tversion else None, + ) + assert result.result == expected_result