diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index f29c66b..150d169 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6053,6 +6053,26 @@ def auto_firmware_update_on_switch_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 = ['svccoreCtrlr Object Count','svccoreNode Object 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?&rsp-subtree-include=count') + svccoreNode_classes_count = icurl('class', 'svccoreNode.json?&rsp-subtree-include=count') + if(int(svccoreCtrlr_classes_count[0]['moCount']['attributes']['count']) > 240 or int(svccoreNode_classes_count[0]['moCount']['attributes']['count']) > 240): + data.append([svccoreCtrlr_classes_count[0]['moCount']['attributes']['count'], 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 ---- @@ -6141,6 +6161,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, @@ -6215,7 +6236,6 @@ class CheckManager: standby_sup_sync_check, isis_database_byte_check, configpush_shard_check, - auto_firmware_update_on_switch_check, ] ssh_checks = [ @@ -6385,4 +6405,4 @@ def main(_args=None): msg = "Abort due to unexpected error - {}".format(e) prints(msg) log.error(msg, exc_info=True) - sys.exit(1) + sys.exit(1) \ No newline at end of file diff --git a/docs/docs/validations.md b/docs/docs/validations.md index f46e03d..7013594 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: | [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 @@ -225,6 +227,7 @@ Items | Defect | This Script [d28]: #policydist-configpushshardcont-crash [d29]: #auto-firmware-update-on-switch-discovery + ## General Check Details ### Compatibility (Target ACI Version) @@ -2667,6 +2670,15 @@ To avoid this risk, consider disabling Auto Firmware Update before upgrading to !!! note This issue occurs because older switch firmware versions are not compatible with switch images 6.0(3) or newer. The APIC version is not a factor. +### Svccore Excessive Data Check + +Due to excessive `svccoreCtrlr` or `svccoreNode` managed objects, Apic gui stuck in loading multiple queries. + +Due to [CSCws84232][64], 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 @@ -2731,4 +2743,5 @@ To avoid this risk, consider disabling Auto Firmware Update before upgrading to [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/CSCwe83941 -[63]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/all/apic-installation-aci-upgrade-downgrade/Cisco-APIC-Installation-ACI-Upgrade-Downgrade-Guide/m-auto-firmware-update.html \ No newline at end of file +[63]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/all/apic-installation-aci-upgrade-downgrade/Cisco-APIC-Installation-ACI-Upgrade-Downgrade-Guide/m-auto-firmware-update.html +[64]:https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws84232 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..673d053 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_negative.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/svccoreNode_positive.json b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_positive.json new file mode 100644 index 0000000..5ae54c7 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccoreNode_positive.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_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..bfa934c --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccore_excessive_class_entries_check.py @@ -0,0 +1,56 @@ +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" + +# icurl queries +svccoreClassEntry = 'svccoreCtrlr.json?&rsp-subtree-include=count' +svccoreNodeEntry = 'svccoreNode.json?&rsp-subtree-include=count' + +@pytest.mark.parametrize( + "icurl_outputs, expected_result", + [ + # No excessive class entries + ( + { + svccoreClassEntry: read_data(dir, "svccore_positive.json"), + svccoreNodeEntry: read_data(dir, "svccoreNode_positive.json") + }, + script.PASS, + ), + # Excessive class entries found + ( + { + svccoreClassEntry: read_data(dir, "svccore_negative.json"), + svccoreNodeEntry: read_data(dir, "svccoreNode_positive.json") + }, + script.MANUAL, + ), + ( + { + svccoreClassEntry: read_data(dir, "svccoreNode_negative.json"), + svccoreNodeEntry: read_data(dir, "svccoreNode_negative.json") + }, + script.MANUAL, + ), + ( + { + svccoreClassEntry: read_data(dir, "svccore_positive.json"), + svccoreNodeEntry: read_data(dir, "svccoreNode_negative.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..e10b44c --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccore_negative.json @@ -0,0 +1,12 @@ +[ + { + "moCount": { + "attributes": { + "childAction": "", + "count": "500", + "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..5ae54c7 --- /dev/null +++ b/tests/checks/svccore_excessive_class_entries_check/svccore_positive.json @@ -0,0 +1,12 @@ +[ + { + "moCount": { + "attributes": { + "childAction": "", + "count": "3", + "dn": "", + "status": "" + } + } + } +] \ No newline at end of file