Skip to content

Commit 34225b9

Browse files
committed
Merge remote-tracking branch 'upstream/v4.2.0-dev' into tmp_dir_snapshot
# Conflicts: # aci-preupgrade-validation-script.py # docs/docs/validations.md
2 parents 98161ee + a643312 commit 34225b9

12 files changed

Lines changed: 391 additions & 1 deletion

aci-preupgrade-validation-script.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import os
3939
import re
4040

41-
SCRIPT_VERSION = "v4.1.0-dev"
41+
SCRIPT_VERSION = "v4.2.0-dev"
4242
DEFAULT_TIMEOUT = 600 # sec
4343
# result constants
4444
DONE = 'DONE'
@@ -6306,6 +6306,53 @@ def multipod_modular_spine_bootscript_check(tversion, fabric_nodes, username, pa
63066306

63076307
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
63086308

6309+
6310+
@check_wrapper(check_title="Inband Management Policy Misconfiguration")
6311+
def inband_management_policy_misconfig_check(cversion, tversion, **kwargs):
6312+
result = PASS
6313+
headers = ["Node_ID", "Address", "Gateway"]
6314+
data = []
6315+
recommended_action = "Contact Cisco TAC to remove any identified misconfigured 'mgmtRsInBStNode' objects"
6316+
doc_url = "https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#inband-management-policy-misconfiguration"
6317+
6318+
if (cversion.older_than("5.2(8d)")) and (tversion.newer_than("6.0(4c)") or tversion.same_as("6.0(4c)")):
6319+
mgmtRsInBStNodes = icurl('class', 'mgmtRsInBStNode.json?query-target-filter=or(eq(mgmtRsInBStNode.addr,"0.0.0.0"),eq(mgmtRsInBStNode.gw,"0.0.0.0"))')
6320+
for mgmtRsInBStNode in mgmtRsInBStNodes:
6321+
attrs = mgmtRsInBStNode["mgmtRsInBStNode"]["attributes"]
6322+
addr = attrs['addr']
6323+
gw = attrs['gw']
6324+
node_match = re.search(node_regex, attrs['dn'])
6325+
node_id = node_match.group("node")
6326+
data.append([node_id, addr, gw])
6327+
else:
6328+
return Result(result=NA, msg=VER_NOT_AFFECTED)
6329+
if data:
6330+
result = FAIL_O
6331+
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
6332+
6333+
6334+
@check_wrapper(check_title="svccore excessive data check")
6335+
def svccore_excessive_data_check(**kwargs):
6336+
result = PASS
6337+
headers = ['Class Name','Count']
6338+
data = []
6339+
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."
6340+
doc_url = "https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#svccore-excessive-data-check"
6341+
try:
6342+
svccoreCtrlr_classes_count = icurl('class', 'svccoreCtrlr.json?query-target=self&rsp-subtree-include=count')
6343+
svccoreNode_classes_count = icurl('class', 'svccoreNode.json?query-target=self&rsp-subtree-include=count')
6344+
6345+
if int(svccoreCtrlr_classes_count[0]['moCount']['attributes']['count']) > 240:
6346+
data.append(['svccoreCtrlr', svccoreCtrlr_classes_count[0]['moCount']['attributes']['count']])
6347+
if int(svccoreNode_classes_count[0]['moCount']['attributes']['count']) > 240:
6348+
data.append(['svccoreNode', svccoreNode_classes_count[0]['moCount']['attributes']['count']])
6349+
if data:
6350+
result = MANUAL
6351+
6352+
return Result(result=result,headers=headers,data=data,recommended_action=recommended_action,doc_url=doc_url)
6353+
except Exception as e:
6354+
return Result(result=ERROR, msg="Error occurred while fetching svccore object counts: {}".format(str(e)), doc_url=doc_url)
6355+
63096356

63106357
# ---- Script Execution ----
63116358

@@ -6398,6 +6445,7 @@ class CheckManager:
63986445
validate_32_64_bit_image_check,
63996446
fabric_link_redundancy_check,
64006447
apic_downgrade_compat_warning_check,
6448+
svccore_excessive_data_check,
64016449

64026450
# Faults
64036451
apic_disk_space_faults_check,
@@ -6476,6 +6524,7 @@ class CheckManager:
64766524
auto_firmware_update_on_switch_check,
64776525
rogue_ep_coop_exception_mac_check,
64786526
n9k_c9408_model_lem_count_check,
6527+
inband_management_policy_misconfig_check,
64796528
]
64806529
ssh_checks = [
64816530
# General

docs/docs/validations.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Items | This Script
3737
[Fabric Link Redundancy][g17] | :white_check_mark: | :no_entry_sign:
3838
[APIC Database Size][g18] | :white_check_mark: | :no_entry_sign:
3939
[APIC downgrade compatibility when crossing 6.2 release][g19]| :white_check_mark: | :no_entry_sign:
40+
[Svccore Excessive Data Check][g20] | :white_check_mark: | :no_entry_sign:
4041

4142
[g1]: #compatibility-target-aci-version
4243
[g2]: #compatibility-cimc-version
@@ -57,6 +58,7 @@ Items | This Script
5758
[g17]: #fabric-link-redundancy
5859
[g18]: #apic-database-size
5960
[g19]: #apic-downgrade-compatibility-when-crossing-62-release
61+
[g20]: #svccore-excessive-data-check
6062

6163
### Fault Checks
6264
Items | Faults | This Script | APIC built-in
@@ -198,6 +200,7 @@ Items | Defect | This Script
198200
[Rogue EP Exception List missing on switches][d30] | CSCwp64296 | :white_check_mark: | :no_entry_sign:
199201
[N9K-C9408 with more than 5 N9K-X9400-16W LEMs][d31] | CSCws82819 | :white_check_mark: | :no_entry_sign:
200202
[Multi-Pod Modular Spine Bootscript File][d32] | CSCwr66848 | :white_check_mark: | :no_entry_sign:
203+
[Inband Management Policy Misconfiguration][d33]| CSCwd40071 | :white_check_mark: | :no_entry_sign:
201204

202205
[d1]: #ep-announce-compatibility
203206
[d2]: #eventmgr-db-size-defect-susceptibility
@@ -231,6 +234,7 @@ Items | Defect | This Script
231234
[d30]: #rogue-ep-exception-list-missing-on-switches
232235
[d31]: #n9k-c9408-with-more-than-5-n9k-x9400-16w-lems
233236
[d32]: #multi-pod-modular-spine-bootscript-file
237+
[d33]: #inband-management-policy-misconfiguration
234238

235239
## General Check Details
236240

@@ -2753,6 +2757,34 @@ This issue happens only when the target version is specifically 6.1(4h).
27532757
To avoid this issue, change the target version to another version. Or verify that the `bootscript` file exists in the bootflash of each modular spine switch prior to upgrading to 6.1(4h). If the file is missing, you have to do clean reboot on the impacted spine to ensure that `/bootflash/bootscript` gets created again. In case you already upgraded your spine and you are experiencing the traffic impact due to this issue, clean reboot of the spine will restore the traffic.
27542758

27552759

2760+
### Inband Management Policy Misconfiguration
2761+
2762+
Due to the defect [CSCwh80837][67], starting from version 6.0(4c), mgmtRsInBStNode policy get modified in leaf/spine during Apic upgrade.
2763+
2764+
Impact:
2765+
2766+
When upgrading Apic from versions prior to 6.0(4c) to versions 6.0(4c) or later, if there is a misconfiguration in the inband management policies (mgmtRsInBStNode) with invalid values, the re-processing triggered by [CSCwh80837][67] will expose the underlying [CSCwd40071][68] defect. This results in continuous policyelem core dumps and switch reboot if Switch are running impacted version of [CSCwd40071][68].
2767+
2768+
The invalid configuration occurs when mgmtRsInBStNode has "0.0.0.0" values ( with or without mask) for either the "addr" or "gw" fields.
2769+
2770+
Suggestion:
2771+
2772+
Contact Cisco TAC to remove any identified misconfigured objects before performing the upgrade to prevent policyelem crashes.
2773+
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].
2774+
2775+
2776+
### Svccore Excessive Data Check
2777+
2778+
Due to excessive `svccoreCtrlr` or `svccoreNode` managed objects, Apic gui stuck in loading multiple queries.
2779+
2780+
The svccoreCtrlr and svccoreNode objects represent core files related to Apic and Leaf/Spines process respectively.
2781+
2782+
Due to [CSCws84232][67], the APIC GUI may become unresponsive after login, with dashboards stuck in a continuous “Loading…”state.
2783+
Administrators may be unable to access or operate the APIC GUI, potentially impacting day-to-day management or upgrade.
2784+
2785+
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.
2786+
2787+
27562788
[0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script
27572789
[1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html
27582790
[2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html
@@ -2820,3 +2852,6 @@ To avoid this issue, change the target version to another version. Or verify tha
28202852
[64]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp64296
28212853
[65]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws82819
28222854
[66]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwr66848
2855+
[67]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh80837
2856+
[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071
2857+
[69]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws84232
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"mgmtRsInBStNode": {
4+
"attributes": {
5+
"tDn": "topology/pod-1/node-103",
6+
"addr": "0.0.0.0",
7+
"configurationMode": "static",
8+
"dn": "uni/tn-mgmt/mgmtp-default/inb-inb/rsinBStNode-[topology/pod-1/node-103]",
9+
"gw": "0.0.0.0",
10+
"modTs": "2024-12-20T07:45:21.454+00:00",
11+
"rType": "mo",
12+
"rn": "rsinBStNode-[topology/pod-1/node-103]",
13+
"stateQual": "none",
14+
"tType": "mo"
15+
}
16+
}
17+
}
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"mgmtRsInBStNode": {
4+
"attributes": {
5+
"tDn": "topology/pod-1/node-103",
6+
"addr": "0.0.0.0",
7+
"configurationMode": "static",
8+
"dn": "uni/tn-mgmt/mgmtp-default/inb-inb/rsinBStNode-[topology/pod-1/node-103]",
9+
"gw": "191.1.1.1",
10+
"modTs": "2024-12-20T07:45:21.454+00:00",
11+
"rType": "mo",
12+
"rn": "rsinBStNode-[topology/pod-1/node-103]",
13+
"stateQual": "none",
14+
"tType": "mo"
15+
}
16+
}
17+
}
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"mgmtRsInBStNode": {
4+
"attributes": {
5+
"tDn": "topology/pod-1/node-103",
6+
"addr": "191.1.1.153/24",
7+
"configurationMode": "static",
8+
"dn": "uni/tn-mgmt/mgmtp-default/inb-inb/rsinBStNode-[topology/pod-1/node-103]",
9+
"gw": "0.0.0.0",
10+
"modTs": "2024-12-20T07:45:21.454+00:00",
11+
"rType": "mo",
12+
"rn": "rsinBStNode-[topology/pod-1/node-103]",
13+
"stateQual": "none",
14+
"tType": "mo"
15+
}
16+
}
17+
}
18+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
import os
2+
import pytest
3+
import logging
4+
import importlib
5+
from helpers.utils import read_data
6+
7+
script = importlib.import_module("aci-preupgrade-validation-script")
8+
log = logging.getLogger(__name__)
9+
dir = os.path.dirname(os.path.abspath(__file__))
10+
test_function = "inband_management_policy_misconfig_check"
11+
mgmtRsInBStNode = 'mgmtRsInBStNode.json?query-target-filter=or(eq(mgmtRsInBStNode.addr,"0.0.0.0"),eq(mgmtRsInBStNode.gw,"0.0.0.0"))'
12+
13+
@pytest.mark.parametrize(
14+
"icurl_outputs, cversion, tversion, expected_result, expected_data",
15+
[
16+
# Current version is affected, Target version = 6.0(4c), valid data
17+
(
18+
{
19+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_valid_config.json")
20+
},
21+
"5.2(7g)",
22+
"6.0(4c)",
23+
script.PASS,
24+
[]
25+
),
26+
# Current version is affected, Target version = 6.0(4c), invalid address
27+
(
28+
{
29+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_address_config.json"),
30+
},
31+
"5.2(7f)",
32+
"6.0(4c)",
33+
script.FAIL_O,
34+
[
35+
["103", "0.0.0.0", "191.1.1.1"]
36+
]
37+
),
38+
# Current version is affected, Target version = 6.0(4c), invalid gateway
39+
(
40+
{
41+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_gateway_config.json"),
42+
},
43+
"5.2(7f)",
44+
"6.0(4c)",
45+
script.FAIL_O,
46+
[
47+
["103", "191.1.1.153/24", "0.0.0.0"],
48+
]
49+
),
50+
# Current version is affected, Target version = 6.0(4c), invalid both data
51+
(
52+
{
53+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"),
54+
},
55+
"5.2(7f)",
56+
"6.0(4c)",
57+
script.FAIL_O,
58+
[
59+
["103", "0.0.0.0", "0.0.0.0"],
60+
]
61+
),
62+
# Current version is affected, Target version > 6.0(4c), valid data
63+
(
64+
{
65+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_valid_config.json"),
66+
},
67+
"5.2(7f)",
68+
"6.0(8f)",
69+
script.PASS,
70+
[]
71+
),
72+
# Current version is affected, Target version > 6.0(4c), invalid address
73+
(
74+
{
75+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_address_config.json"),
76+
},
77+
"5.2(7f)",
78+
"6.0(5h)",
79+
script.FAIL_O,
80+
[
81+
["103", "0.0.0.0", "191.1.1.1"],
82+
]
83+
),
84+
# Current version is affected, Target version > 6.0(4c), invalid gateway
85+
(
86+
{
87+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_gateway_config.json"),
88+
},
89+
"5.2(7f)",
90+
"6.0(5j)",
91+
script.FAIL_O,
92+
[
93+
["103", "191.1.1.153/24", "0.0.0.0"],
94+
]
95+
),
96+
# Current version is affected, Target version > 6.0(4c), invalid both data
97+
(
98+
{
99+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"),
100+
},
101+
"5.2(7f)",
102+
"6.0(6c)",
103+
script.FAIL_O,
104+
[
105+
["103", "0.0.0.0", "0.0.0.0"],
106+
]
107+
),
108+
# Current version is affected, Target version < 6.0(4c), invalid both data
109+
(
110+
{
111+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"),
112+
},
113+
"5.2(7f)",
114+
"6.0(3g)",
115+
script.NA,
116+
[]
117+
),
118+
# Current version is affected, Target version < 6.0(4c), valid both data
119+
(
120+
{
121+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_valid_config.json"),
122+
},
123+
"5.2(7f)",
124+
"6.0(3g)",
125+
script.NA,
126+
[]
127+
),
128+
# Current version is not affected, Target version = 6.0(4c), invalid both data
129+
(
130+
{
131+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"),
132+
},
133+
"5.3(2f)",
134+
"6.0(4c)",
135+
script.NA,
136+
[]
137+
),
138+
# Current version is not affected, Target version > 6.0(4c), invalid both data
139+
(
140+
{
141+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"),
142+
},
143+
"5.3(2f)",
144+
"6.0(6c)",
145+
script.NA,
146+
[]
147+
),
148+
# Current version is not affected, Target version < 6.0(4c), invalid both data
149+
(
150+
{
151+
mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"),
152+
},
153+
"5.3(2f)",
154+
"6.0(3g)",
155+
script.NA,
156+
[]
157+
),
158+
],
159+
)
160+
def test_logic(run_check, mock_icurl, cversion, tversion, expected_result, expected_data):
161+
result = run_check(cversion=script.AciVersion(cversion), tversion=script.AciVersion(tversion))
162+
assert result.result == expected_result
163+
assert result.data == expected_data
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"moCount": {
4+
"attributes": {
5+
"childAction": "",
6+
"count": "3",
7+
"dn": "",
8+
"status": ""
9+
}
10+
}
11+
}
12+
]

0 commit comments

Comments
 (0)