diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 5b146a1..192aca3 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6292,7 +6292,7 @@ def multipod_modular_spine_bootscript_check(tversion, fabric_nodes, username, pa return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) - + @check_wrapper(check_title="Inband Management Policy Misconfiguration") def inband_management_policy_misconfig_check(cversion, tversion, **kwargs): result = PASS @@ -6317,6 +6317,29 @@ def inband_management_policy_misconfig_check(cversion, tversion, **kwargs): return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) +@check_wrapper(check_title="svccore excessive data check") +def svccore_excessive_data_check(**kwargs): + result = PASS + headers = ['Class Name','Count'] + data = [] + recommended_action = "Delete the core files before proceeding with upgrade. Please refer to the document linked below and contact Cisco TAC for assistance if needed." + doc_url = "https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#svccore-excessive-data-check" + try: + svccoreCtrlr_classes_count = icurl('class', 'svccoreCtrlr.json?query-target=self&rsp-subtree-include=count') + svccoreNode_classes_count = icurl('class', 'svccoreNode.json?query-target=self&rsp-subtree-include=count') + + if int(svccoreCtrlr_classes_count[0]['moCount']['attributes']['count']) > 240: + data.append(['svccoreCtrlr', svccoreCtrlr_classes_count[0]['moCount']['attributes']['count']]) + if int(svccoreNode_classes_count[0]['moCount']['attributes']['count']) > 240: + data.append(['svccoreNode', svccoreNode_classes_count[0]['moCount']['attributes']['count']]) + if data: + result = MANUAL + + return Result(result=result,headers=headers,data=data,recommended_action=recommended_action,doc_url=doc_url) + except Exception as e: + return Result(result=ERROR, msg="Error occurred while fetching svccore object counts: {}".format(str(e)), doc_url=doc_url) + + # ---- Script Execution ---- @@ -6408,6 +6431,7 @@ class CheckManager: validate_32_64_bit_image_check, fabric_link_redundancy_check, apic_downgrade_compat_warning_check, + svccore_excessive_data_check, # Faults apic_disk_space_faults_check, diff --git a/docs/docs/validations.md b/docs/docs/validations.md index 848c762..64d5955 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -37,6 +37,7 @@ Items | This Script [Fabric Link Redundancy][g17] | :white_check_mark: | :no_entry_sign: [APIC Database Size][g18] | :white_check_mark: | :no_entry_sign: [APIC downgrade compatibility when crossing 6.2 release][g19]| :white_check_mark: | :no_entry_sign: +[Svccore Excessive Data Check][g20] | :white_check_mark: | :no_entry_sign: [g1]: #compatibility-target-aci-version [g2]: #compatibility-cimc-version @@ -57,6 +58,7 @@ Items | This Script [g17]: #fabric-link-redundancy [g18]: #apic-database-size [g19]: #apic-downgrade-compatibility-when-crossing-62-release +[g20]: #svccore-excessive-data-check ### Fault Checks Items | Faults | This Script | APIC built-in @@ -2770,6 +2772,19 @@ Suggestion: Contact Cisco TAC to remove any identified misconfigured objects before performing the upgrade to prevent policyelem crashes. The [CSCwd40071][68] defect affects versions 5.2(5c) and later with a fix available in 6.0(1g). However, the issue will only be triggered during Apic upgrades crossing 6.0(4c) due to [CSCwh80837][67]. + +### Svccore Excessive Data Check + +Due to excessive `svccoreCtrlr` or `svccoreNode` managed objects, Apic gui stuck in loading multiple queries. + +The svccoreCtrlr and svccoreNode objects represent core files related to Apic and Leaf/Spines process respectively. + +Due to [CSCws84232][67], the APIC GUI may become unresponsive after login, with dashboards stuck in a continuous “Loading…”state. +Administrators may be unable to access or operate the APIC GUI, potentially impacting day-to-day management or upgrade. + +This check will verify the count of the `svccoreCtrlr` Managed Object and raise and alarm with the bug if object count found more than 240. Remove the content or objects of `svccoreCtrlr` or `svccoreNode`. Contact Cisco TAC or upgrade to a release containing the fix for CSCws84232 before proceeding with an upgrade. + + [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 @@ -2838,4 +2853,5 @@ The [CSCwd40071][68] defect affects versions 5.2(5c) and later with a fix availa [65]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws82819 [66]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwr66848 [67]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh80837 -[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071 \ No newline at end of file +[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071 +[69]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws84232 \ No newline at end of file diff --git a/tests/checks/svccore_excessive_class_entries_check/svccoreNode_negative.json b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_negative.json new file mode 100644 index 0000000..5ae54c7 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_negative.json @@ -0,0 +1,12 @@ +[ + { + "moCount": { + "attributes": { + "childAction": "", + "count": "3", + "dn": "", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/svccore_excessive_class_entries_check/svccoreNode_positive.json b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_positive.json new file mode 100644 index 0000000..673d053 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_positive.json @@ -0,0 +1,12 @@ +[ + { + "moCount": { + "attributes": { + "childAction": "", + "count": "32000", + "dn": "", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/svccore_excessive_class_entries_check/svccore_excessive_class_entries_check.py b/tests/checks/svccore_excessive_class_entries_check/svccore_excessive_class_entries_check.py new file mode 100644 index 0000000..b0f4781 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccore_excessive_class_entries_check.py @@ -0,0 +1,40 @@ +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 = "svccore_excessive_data_check" +svccoreClassEntry = 'svccoreCtrlr.json?query-target=self&rsp-subtree-include=count' +svccoreNodeEntry = 'svccoreNode.json?query-target=self&rsp-subtree-include=count' + +@pytest.mark.parametrize( + "icurl_outputs, expected_result", + [ + # No excessive class entries + ( + {svccoreClassEntry: read_data(dir, "svccore_negative.json"),svccoreNodeEntry: read_data(dir, "svccoreNode_negative.json")}, + script.PASS, + ), + # Excessive class entries found + ( + {svccoreClassEntry: read_data(dir, "svccore_positive.json"),svccoreNodeEntry: read_data(dir, "svccoreNode_negative.json")}, + script.MANUAL, + ), + ( + {svccoreClassEntry: read_data(dir, "svccore_positive.json"),svccoreNodeEntry: read_data(dir, "svccoreNode_positive.json")}, + script.MANUAL, + ), + ( + {svccoreClassEntry: read_data(dir, "svccore_negative.json"),svccoreNodeEntry: read_data(dir, "svccoreNode_positive.json")}, + script.MANUAL, + ) + ], +) + +def test_logic(run_check,mock_icurl,expected_result): + result = run_check() + assert result.result == expected_result \ No newline at end of file diff --git a/tests/checks/svccore_excessive_class_entries_check/svccore_negative.json b/tests/checks/svccore_excessive_class_entries_check/svccore_negative.json new file mode 100644 index 0000000..5ae54c7 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccore_negative.json @@ -0,0 +1,12 @@ +[ + { + "moCount": { + "attributes": { + "childAction": "", + "count": "3", + "dn": "", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/svccore_excessive_class_entries_check/svccore_positive.json b/tests/checks/svccore_excessive_class_entries_check/svccore_positive.json new file mode 100644 index 0000000..e10b44c --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccore_positive.json @@ -0,0 +1,12 @@ +[ + { + "moCount": { + "attributes": { + "childAction": "", + "count": "500", + "dn": "", + "status": "" + } + } + } +] \ No newline at end of file