Skip to content

Commit 6017e77

Browse files
Add apic_m4_l4_db_snapshot_check for CSCwn62369
1 parent 2ac5cd8 commit 6017e77

9 files changed

Lines changed: 260 additions & 2 deletions

File tree

aci-preupgrade-validation-script.py

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6004,9 +6004,52 @@ def apic_vmm_inventory_sync_faults_check(**kwargs):
60046004
data=data,
60056005
unformatted_headers=unformatted_headers,
60066006
unformatted_data=unformatted_data,
6007-
recommended_action=recommended_action,
60086007
doc_url=doc_url)
60096008

6009+
6010+
@check_wrapper(check_title="APIC M4/L4 Model db_snapshot Script Issue")
6011+
def apic_m4_l4_db_snapshot_check(tversion, fabric_nodes, **kwargs):
6012+
result = FAIL_O
6013+
headers = ["Node ID", "APIC Model", "Status"]
6014+
data = []
6015+
recommended_action = "Please contact TAC, requires the db_snapshot.sh to be modified"
6016+
doc_url = "https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#apic-m4-l4-model-db-snapshot-script-issue"
6017+
6018+
# Check 1: Verify target version is provided
6019+
if not tversion:
6020+
return Result(result=MANUAL, msg=TVER_MISSING)
6021+
6022+
# Check 2: Verify target version is affected
6023+
# Only applicable to 5.3.x releases older than 5.3(2f) or 6.0.x releases older than 6.0(9c)
6024+
# Not impacting 5.2, 4.2, 6.1 or any other major release
6025+
if tversion.major_version == "5.3":
6026+
if not tversion.older_than("5.3(2f)"):
6027+
return Result(result=NA, msg=VER_NOT_AFFECTED)
6028+
elif tversion.major_version == "6.0":
6029+
if not tversion.older_than("6.0(9c)"):
6030+
return Result(result=NA, msg=VER_NOT_AFFECTED)
6031+
else:
6032+
return Result(result=NA, msg=VER_NOT_AFFECTED)
6033+
6034+
# Check 3: Get APIC controllers from fabric_nodes
6035+
apics = [node for node in fabric_nodes if node["fabricNode"]["attributes"]["role"] == "controller"]
6036+
6037+
if not apics:
6038+
return Result(result=ERROR, msg="No controllers found in fabricNode. Is the cluster healthy?", doc_url=doc_url)
6039+
6040+
# Check 4: Identify affected APIC models (M4 or L4)
6041+
for apic in apics:
6042+
apic_model = apic['fabricNode']['attributes']['model']
6043+
node_id = apic['fabricNode']['attributes']['id']
6044+
6045+
if "APIC-SERVER-M4" in apic_model or "APIC-SERVER-L4" in apic_model:
6046+
data.append([node_id, apic_model, "Affected"])
6047+
6048+
if not data:
6049+
result = PASS
6050+
6051+
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
6052+
60106053
# ---- Script Execution ----
60116054

60126055

@@ -6168,6 +6211,7 @@ class CheckManager:
61686211
standby_sup_sync_check,
61696212
isis_database_byte_check,
61706213
configpush_shard_check,
6214+
apic_m4_l4_db_snapshot_check,
61716215

61726216
]
61736217
ssh_checks = [

docs/docs/validations.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ Items | Defect | This Script
190190
[Observer Database Size][d25] | CSCvw45531 | :white_check_mark: | :no_entry_sign:
191191
[Stale pconsRA Object][d26] | CSCwp22212 | :warning:{title="Deprecated"} | :no_entry_sign:
192192
[ISIS DTEPs Byte Size][d27] | CSCwp15375 | :white_check_mark: | :no_entry_sign:
193-
[Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: |
193+
[Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: |
194+
[APIC M4/L4 Model db_snapshot Script Issue][d29] | CSCwn62369 | :white_check_mark: | :no_entry_sign:
194195

195196
[d1]: #ep-announce-compatibility
196197
[d2]: #eventmgr-db-size-defect-susceptibility
@@ -220,6 +221,7 @@ Items | Defect | This Script
220221
[d26]: #stale-pconsra-object
221222
[d27]: #isis-dteps-byte-size
222223
[d28]: #policydist-configpushshardcont-crash
224+
[d29]: #apic-m4l4-model-db_snapshot-script-issue
223225

224226

225227
## General Check Details
@@ -2614,6 +2616,21 @@ Due to [CSCwp95515][59], upgrading to an affected version while having any `conf
26142616
If any instances of `configpushShardCont` are flagged by this script, Cisco TAC must be contacted to identify and resolve the underlying issue before performing the upgrade.
26152617

26162618

2619+
### APIC M4/L4 Model db_snapshot Script Issue
2620+
2621+
Due to the defect CSCwn62369, the db_snapshot.sh script on APIC-SERVER-M4 and APIC-SERVER-L4 models requires modification before upgrading to certain versions. This issue affects upgrades to versions earlier than 5.3(2f) in the 5.3 train or earlier than 6.0(9c) in the 6.0 train. The defect does not impact 5.2, 4.2, 6.1, or any other release trains.
2622+
2623+
The script checks if:
2624+
2625+
* The target APIC version is 5.3.x (but earlier than 5.3(2f)) or 6.0.x (but earlier than 6.0(9c))
2626+
* Any APICs in the cluster are running APIC-SERVER-M4 or APIC-SERVER-L4 hardware models
2627+
2628+
If both conditions are met, the db_snapshot.sh script must be modified by TAC before performing the upgrade to avoid potential issues with database snapshot operations.
2629+
2630+
!!! important
2631+
If this check fails, please contact TAC before upgrading. The db_snapshot.sh script requires modification specific to M4/L4 hardware models.
2632+
2633+
26172634
[0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script
26182635
[1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html
26192636
[2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
{
3+
"eqptCh": {
4+
"attributes": {
5+
"bootSource": "bootflash",
6+
"cimcVersion": "4.0(2f)",
7+
"descr": "APIC-SERVER-L2",
8+
"dn": "topology/pod-1/node-1/sys/ch",
9+
"model": "APIC-SERVER-L2"
10+
}
11+
}
12+
}
13+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
{
3+
"eqptCh": {
4+
"attributes": {
5+
"bootSource": "bootflash",
6+
"cimcVersion": "4.2(1a)",
7+
"descr": "APIC-SERVER-L4",
8+
"dn": "topology/pod-1/node-1/sys/ch",
9+
"model": "APIC-SERVER-L4"
10+
}
11+
}
12+
}
13+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[
2+
{
3+
"eqptCh": {
4+
"attributes": {
5+
"bootSource": "bootflash",
6+
"cimcVersion": "4.2(1a)",
7+
"descr": "APIC-SERVER-M4",
8+
"dn": "topology/pod-1/node-1/sys/ch",
9+
"model": "APIC-SERVER-M4"
10+
}
11+
}
12+
},
13+
{
14+
"eqptCh": {
15+
"attributes": {
16+
"bootSource": "bootflash",
17+
"cimcVersion": "4.2(1a)",
18+
"descr": "APIC-SERVER-M4",
19+
"dn": "topology/pod-1/node-2/sys/ch",
20+
"model": "APIC-SERVER-M4"
21+
}
22+
}
23+
}
24+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
{
3+
"fabricNode": {
4+
"attributes": {
5+
"id": "1",
6+
"name": "apic1",
7+
"role": "controller",
8+
"model": "APIC-SERVER-L2",
9+
"address": "10.0.0.1"
10+
}
11+
}
12+
}
13+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[
2+
{
3+
"fabricNode": {
4+
"attributes": {
5+
"id": "1",
6+
"name": "apic1",
7+
"role": "controller",
8+
"model": "APIC-SERVER-L4",
9+
"address": "10.0.0.1"
10+
}
11+
}
12+
}
13+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[
2+
{
3+
"fabricNode": {
4+
"attributes": {
5+
"id": "1",
6+
"name": "apic1",
7+
"role": "controller",
8+
"model": "APIC-SERVER-M4",
9+
"address": "10.0.0.1"
10+
}
11+
}
12+
},
13+
{
14+
"fabricNode": {
15+
"attributes": {
16+
"id": "2",
17+
"name": "apic2",
18+
"role": "controller",
19+
"model": "APIC-SERVER-M4",
20+
"address": "10.0.0.2"
21+
}
22+
}
23+
}
24+
]
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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+
9+
log = logging.getLogger(__name__)
10+
dir = os.path.dirname(os.path.abspath(__file__))
11+
12+
test_function = "apic_m4_l4_db_snapshot_check"
13+
14+
15+
@pytest.mark.parametrize(
16+
"tversion, fabric_nodes, expected_result",
17+
[
18+
# Test 1: MANUAL - No target version
19+
(
20+
None,
21+
read_data(dir, "fabricNode_m4.json"),
22+
script.MANUAL,
23+
),
24+
# Test 2: NA - Target version not affected (5.2 train)
25+
(
26+
"5.2(7f)",
27+
read_data(dir, "fabricNode_m4.json"),
28+
script.NA,
29+
),
30+
# Test 3: NA - Target version not affected (4.2 train)
31+
(
32+
"4.2(7t)",
33+
read_data(dir, "fabricNode_m4.json"),
34+
script.NA,
35+
),
36+
# Test 4: NA - Target version not affected (6.1 train)
37+
(
38+
"6.1(3a)",
39+
read_data(dir, "fabricNode_m4.json"),
40+
script.NA,
41+
),
42+
# Test 5: NA - Target version 5.3(2f) or newer
43+
(
44+
"5.3(2f)",
45+
read_data(dir, "fabricNode_m4.json"),
46+
script.NA,
47+
),
48+
# Test 6: NA - Target version 6.0(9c) or newer
49+
(
50+
"6.0(9c)",
51+
read_data(dir, "fabricNode_m4.json"),
52+
script.NA,
53+
),
54+
# Test 7: FAIL_O - M4 model with affected 5.3 version
55+
(
56+
"5.3(2a)",
57+
read_data(dir, "fabricNode_m4.json"),
58+
script.FAIL_O,
59+
),
60+
# Test 8: FAIL_O - M4 model with affected 6.0 version
61+
(
62+
"6.0(8a)",
63+
read_data(dir, "fabricNode_m4.json"),
64+
script.FAIL_O,
65+
),
66+
# Test 9: FAIL_O - L4 model with affected 5.3 version
67+
(
68+
"5.3(1a)",
69+
read_data(dir, "fabricNode_l4.json"),
70+
script.FAIL_O,
71+
),
72+
# Test 10: FAIL_O - L4 model with affected 6.0 version
73+
(
74+
"6.0(5a)",
75+
read_data(dir, "fabricNode_l4.json"),
76+
script.FAIL_O,
77+
),
78+
# Test 11: PASS - L2 model (not affected) with affected version
79+
(
80+
"5.3(2a)",
81+
read_data(dir, "fabricNode_l2.json"),
82+
script.PASS,
83+
),
84+
# Test 12: PASS - L2 model (not affected) with affected version
85+
(
86+
"6.0(8a)",
87+
read_data(dir, "fabricNode_l2.json"),
88+
script.PASS,
89+
),
90+
],
91+
)
92+
def test_logic(run_check, tversion, fabric_nodes, expected_result):
93+
if tversion:
94+
result = run_check(tversion=script.AciVersion(tversion), fabric_nodes=fabric_nodes)
95+
else:
96+
result = run_check(tversion=None, fabric_nodes=fabric_nodes)
97+
assert result.result == expected_result

0 commit comments

Comments
 (0)