diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 1cb18e56..7db39a7a 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -5231,6 +5231,35 @@ def isis_database_byte_check(tversion, **kwargs): return Result(result=NA, msg=VER_NOT_AFFECTED) return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) +@check_wrapper(check_title='N9K-C93180YC-FX3 Sup Memory') +def n9k_c93108yc_fx3_mem_check(tversion, **kwargs): + result = PASS + headers = ["NodeId", "Name", "Memory Detected (GB)"] + data = [] + recommended_action = 'Review the Memory Installed in your N9K-C93180YC-FX3 Switches' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#n9k-c93180yc-fx3-sup-memory' + if not tversion: + return Result(result=MANUAL, msg=TVER_MISSING) + leaf_api = 'fabricNode.json' + leaf_api +='?query-target-filter=eq(fabricNode.model,"N9K-C93180YC-FX3")' + ycfx3_switches = icurl('class', leaf_api) + if ycfx3_switches: + procMemUsage_api = 'procMemUsage.json' + ycfx3_memory_mos = icurl('class', procMemUsage_api) + for ycfx3_switch in ycfx3_switches: + switch_dn = ycfx3_switch['fabricNode']['attributes']['dn'] + for memory_mo in ycfx3_memory_mos: + if ( switch_dn in memory_mo['procMemUsage']['attributes']['dn'] + and int(memory_mo['procMemUsage']['attributes']['Total']) <= 32000000): + result = FAIL_O + memory_in_gb = int(memory_mo['procMemUsage']['attributes']['Total']) /1048576 + node_id = ycfx3_switch['fabricNode']['attributes']['id'] + node_name = ycfx3_switch['fabricNode']['attributes']['name'] + data.append([node_id, node_name, round(memory_in_gb,2)]) + else: + return Result(result=NA) + + return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) # Subprocess check - cat + acidiag @check_wrapper(check_title='APIC Database Size') @@ -5455,6 +5484,7 @@ def get_checks(api_only, debug_function): standby_sup_sync_check, stale_pcons_ra_mo_check, isis_database_byte_check, + n9k_c93108yc_fx3_mem_check, ] conn_checks = [ diff --git a/docs/docs/validations.md b/docs/docs/validations.md index e46a8815..9c72214b 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -188,6 +188,7 @@ Items | Defect | This Script [Observer Database Size][d25] | CSCvw45531 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Stale pconsRA Object][d26] | CSCwp22212 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [ISIS DTEPs Byte Size][d27] | CSCwp15375 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[N9K-C93180YC-FX3 Sup Memory][d28] | CSCwm42741 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [d1]: #ep-announce-compatibility @@ -217,6 +218,7 @@ Items | Defect | This Script [d25]: #observer-database-size [d26]: #stale-pconsra-object [d27]: #isis-dteps-byte-size +[d28]: #n9k-c93180yc-fx3-sup-memory ## General Check Details @@ -2589,6 +2591,13 @@ Do not upgrade to any affected ACI software release if this check fails. Nexus Dashboard Insights (NDI) integration can cause ACI tech support generation to happen automatically as part of the bug scan feature. +### N9K-C93180YC-FX3 Sup Memory + +A 'N9K-C93180YC-FX3' Switch device running in ACI mode requires a minimum of 32GB RAM to operate normally. If less than 32GB memory is installed, the ACI device can have unpredictable behavior. + +Due to [CSCwm42741][59], starting at 6.0(9d) a F4680 fault will be raised if a Switch is detected with less than 32GB memory. Previous versions do not alert of this situation. + + [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 [2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html @@ -2648,3 +2657,4 @@ Do not upgrade to any affected ACI software release if this check fails. [56]: https://www.cisco.com/c/en/us/td/docs/dcn/whitepapers/cisco-aci-virtual-edge-migration.html [57]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp22212 [58]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp15375 +[59]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwm42741 \ No newline at end of file diff --git a/tests/n9k_c93108yc_fx3_mem_check/fabricNode_YC-FX3.json b/tests/n9k_c93108yc_fx3_mem_check/fabricNode_YC-FX3.json new file mode 100644 index 00000000..c9b0d820 --- /dev/null +++ b/tests/n9k_c93108yc_fx3_mem_check/fabricNode_YC-FX3.json @@ -0,0 +1,15 @@ +[ + { + "fabricNode": { + "attributes": { + "adSt": "on", + "dn": "topology/pod-1/node-101", + "fabricSt": "active", + "id": "101", + "model": "N9K-C93180YC-FX3", + "name": "a1-leaf1", + "role": "leaf" + } + } + } +] \ No newline at end of file diff --git a/tests/n9k_c93108yc_fx3_mem_check/procMemUsagegt32gb.json b/tests/n9k_c93108yc_fx3_mem_check/procMemUsagegt32gb.json new file mode 100644 index 00000000..20dc6997 --- /dev/null +++ b/tests/n9k_c93108yc_fx3_mem_check/procMemUsagegt32gb.json @@ -0,0 +1,18 @@ +[ + { + "procMemUsage": { + "attributes": { + "Free": "14581752", + "Modname": "sup", + "Total": "32535444", + "Used": "17953692", + "childAction": "", + "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", + "memAlert": "normal", + "modTs": "never", + "monPolDn": "uni/fabric/monfab-cskid-monitoring-pol", + "status": "" + } + } + } + ] \ No newline at end of file diff --git a/tests/n9k_c93108yc_fx3_mem_check/procMemUsagelt32gb.json b/tests/n9k_c93108yc_fx3_mem_check/procMemUsagelt32gb.json new file mode 100644 index 00000000..7c142f2d --- /dev/null +++ b/tests/n9k_c93108yc_fx3_mem_check/procMemUsagelt32gb.json @@ -0,0 +1,18 @@ +[ + { + "procMemUsage": { + "attributes": { + "Free": "14564556", + "Modname": "sup", + "Total": "24535444", + "Used": "17970888", + "childAction": "", + "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", + "memAlert": "normal", + "modTs": "never", + "monPolDn": "uni/fabric/monfab-cskid-monitoring-pol", + "status": "" + } + } + } + ] \ No newline at end of file diff --git a/tests/n9k_c93108yc_fx3_mem_check/test_n9k_c93108yc_fx3_mem_check.py b/tests/n9k_c93108yc_fx3_mem_check/test_n9k_c93108yc_fx3_mem_check.py new file mode 100644 index 00000000..7344171d --- /dev/null +++ b/tests/n9k_c93108yc_fx3_mem_check/test_n9k_c93108yc_fx3_mem_check.py @@ -0,0 +1,53 @@ +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__)) + + +# icurl queries +leaf_api = 'fabricNode.json?query-target-filter=eq(fabricNode.model,"N9K-C93180YC-FX3")' +procMemUsage_api = 'procMemUsage.json' + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + # Version not supplied + ({leaf_api: []}, None, script.MANUAL), + # no N9K-C93180YC-FX3 + ({leaf_api: [], procMemUsage_api: []}, "6.0(9c)", script.NA), + ({leaf_api: [], procMemUsage_api: []}, "6.1(1f)", script.NA), + # N9K-C93180YC-FX3 Present, Memory not affected + ({ + leaf_api: read_data(dir, "fabricNode_YC-FX3.json"), + procMemUsage_api: read_data(dir, "procMemUsagegt32gb.json")}, + "6.0(9d)", script.PASS), + + ({ + leaf_api: read_data(dir, "fabricNode_YC-FX3.json"), + procMemUsage_api: read_data(dir, "procMemUsagegt32gb.json")}, + "6.1(2f)", script.PASS), + # N9K-C93180YC-FX3 Present, Memory affected, Less than 32GB + ({ + leaf_api: read_data(dir, "fabricNode_YC-FX3.json"), + procMemUsage_api: read_data(dir, "procMemUsagelt32gb.json")}, + "6.0(9d)", script.FAIL_O), + + ({ + leaf_api: read_data(dir, "fabricNode_YC-FX3.json"), + procMemUsage_api: read_data(dir, "procMemUsagelt32gb.json")}, + "6.1(2f)", script.FAIL_O), + ], +) +def test_logic(mock_icurl, tversion, expected_result): + result = script.n9k_c93108yc_fx3_mem_check( + 1, + 1, + script.AciVersion(tversion) if tversion else None, + ) + assert result == expected_result