Skip to content

Commit f2e79cf

Browse files
committed
resolved conflict
2 parents bd01f56 + 217dbcb commit f2e79cf

7 files changed

Lines changed: 263 additions & 1 deletion

aci-preupgrade-validation-script.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6291,6 +6291,30 @@ def multipod_modular_spine_bootscript_check(tversion, fabric_nodes, username, pa
62916291
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
62926292

62936293

6294+
@check_wrapper(check_title="Inband Management Policy Misconfiguration")
6295+
def inband_management_policy_misconfig_check(cversion, tversion, **kwargs):
6296+
result = PASS
6297+
headers = ["Node_ID", "Address", "Gateway"]
6298+
data = []
6299+
recommended_action = "Contact Cisco TAC to remove any identified misconfigured 'mgmtRsInBStNode' objects"
6300+
doc_url = "https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#inband-management-policy-misconfiguration"
6301+
6302+
if (cversion.older_than("5.2(8d)")) and (tversion.newer_than("6.0(4c)") or tversion.same_as("6.0(4c)")):
6303+
mgmtRsInBStNodes = icurl('class', 'mgmtRsInBStNode.json?query-target-filter=or(eq(mgmtRsInBStNode.addr,"0.0.0.0"),eq(mgmtRsInBStNode.gw,"0.0.0.0"))')
6304+
for mgmtRsInBStNode in mgmtRsInBStNodes:
6305+
attrs = mgmtRsInBStNode["mgmtRsInBStNode"]["attributes"]
6306+
addr = attrs['addr']
6307+
gw = attrs['gw']
6308+
node_match = re.search(node_regex, attrs['dn'])
6309+
node_id = node_match.group("node")
6310+
data.append([node_id, addr, gw])
6311+
else:
6312+
return Result(result=NA, msg=VER_NOT_AFFECTED)
6313+
if data:
6314+
result = FAIL_O
6315+
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
6316+
6317+
62946318
# ---- Script Execution ----
62956319

62966320

@@ -6460,6 +6484,7 @@ class CheckManager:
64606484
auto_firmware_update_on_switch_check,
64616485
rogue_ep_coop_exception_mac_check,
64626486
n9k_c9408_model_lem_count_check,
6487+
inband_management_policy_misconfig_check,
64636488
]
64646489
ssh_checks = [
64656490
# General

docs/docs/validations.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Items | Defect | This Script
198198
[Rogue EP Exception List missing on switches][d30] | CSCwp64296 | :white_check_mark: | :no_entry_sign:
199199
[N9K-C9408 with more than 5 N9K-X9400-16W LEMs][d31] | CSCws82819 | :white_check_mark: | :no_entry_sign:
200200
[Multi-Pod Modular Spine Bootscript File][d32] | CSCwr66848 | :white_check_mark: | :no_entry_sign:
201+
[Inband Management Policy Misconfiguration][d33]| CSCwd40071 | :white_check_mark: | :no_entry_sign:
201202

202203
[d1]: #ep-announce-compatibility
203204
[d2]: #eventmgr-db-size-defect-susceptibility
@@ -231,6 +232,7 @@ Items | Defect | This Script
231232
[d30]: #rogue-ep-exception-list-missing-on-switches
232233
[d31]: #n9k-c9408-with-more-than-5-n9k-x9400-16w-lems
233234
[d32]: #multi-pod-modular-spine-bootscript-file
235+
[d33]: #inband-management-policy-misconfiguration
234236

235237
## General Check Details
236238

@@ -2751,6 +2753,21 @@ This issue happens only when the target version is specifically 6.1(4h).
27512753
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.
27522754

27532755

2756+
### Inband Management Policy Misconfiguration
2757+
2758+
Due to the defect [CSCwh80837][67], starting from version 6.0(4c), mgmtRsInBStNode policy get modified in leaf/spine during Apic upgrade.
2759+
2760+
Impact:
2761+
2762+
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].
2763+
2764+
The invalid configuration occurs when mgmtRsInBStNode has "0.0.0.0" values ( with or without mask) for either the "addr" or "gw" fields.
2765+
2766+
Suggestion:
2767+
2768+
Contact Cisco TAC to remove any identified misconfigured objects before performing the upgrade to prevent policyelem crashes.
2769+
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].
2770+
27542771
[0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script
27552772
[1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html
27562773
[2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html
@@ -2818,4 +2835,6 @@ To avoid this issue, change the target version to another version. Or verify tha
28182835
[64]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp64296
28192836
[65]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws82819
28202837
[66]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwr66848
2821-
[67]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvo27498
2838+
[67]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh80837
2839+
[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071
2840+
[69]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvo27498
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

0 commit comments

Comments
 (0)