Skip to content

Commit 871e281

Browse files
committed
Added check for CFD - CSCwt38698
1 parent 217dbcb commit 871e281

6 files changed

Lines changed: 160 additions & 2 deletions

File tree

aci-preupgrade-validation-script.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6316,7 +6316,41 @@ def inband_management_policy_misconfig_check(cversion, tversion, **kwargs):
63166316
result = FAIL_O
63176317
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
63186318

6319-
6319+
6320+
@check_wrapper(check_title='Micron SSD Lifetime Validation')
6321+
def micron_ssd_lifetime_check(tversion, **kwargs):
6322+
result = PASS
6323+
headers = ['Pod', 'Node', 'Model', 'Serial Number']
6324+
data = []
6325+
recommended_action = (
6326+
'\n\tRun the SSD Lifetime Validation script on all identified nodes before upgrading.\n'
6327+
'\tScript location: https://github.com/datacenter/aci-tac-scripts/tree/main/SSD%20Lifetime%20Validation\n'
6328+
)
6329+
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#micron-ssd-lifetime-validation'
6330+
6331+
if not tversion:
6332+
return Result(result=MANUAL, msg=TVER_MISSING)
6333+
6334+
if not tversion.same_as('6.1(5e)') and not tversion.same_as('6.2(1g)'):
6335+
return Result(result=NA, msg=VER_NOT_AFFECTED)
6336+
6337+
eqptFlashs = icurl('class','eqptFlash.json?query-target-filter=eq(eqptFlash.vendor,"Micron")')
6338+
if not eqptFlashs:
6339+
return Result(result=PASS, msg='No Micron drives found in fabric.')
6340+
6341+
for eqptFlash in eqptFlashs:
6342+
attr = eqptFlash['eqptFlash']['attributes']
6343+
dn = re.search(node_regex, attr.get("dn", ""))
6344+
pod_id = dn.group("pod") if dn else "Unknown"
6345+
node_id = dn.group('node') if dn else "Unknown"
6346+
data.append([pod_id, node_id, attr.get('model',''), attr.get('ser','')])
6347+
6348+
if data:
6349+
result = FAIL_O
6350+
6351+
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
6352+
6353+
63206354
# ---- Script Execution ----
63216355

63226356

@@ -6487,6 +6521,7 @@ class CheckManager:
64876521
rogue_ep_coop_exception_mac_check,
64886522
n9k_c9408_model_lem_count_check,
64896523
inband_management_policy_misconfig_check,
6524+
micron_ssd_lifetime_check,
64906525
]
64916526
ssh_checks = [
64926527
# General

docs/docs/validations.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Items | Defect | This Script
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:
201201
[Inband Management Policy Misconfiguration][d33]| CSCwd40071 | :white_check_mark: | :no_entry_sign:
202+
[Micron SSD Lifetime Validation][d34] | CSCwt38698 | :white_check_mark: | :no_entry_sign:
202203

203204
[d1]: #ep-announce-compatibility
204205
[d2]: #eventmgr-db-size-defect-susceptibility
@@ -2770,6 +2771,14 @@ Suggestion:
27702771
Contact Cisco TAC to remove any identified misconfigured objects before performing the upgrade to prevent policyelem crashes.
27712772
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].
27722773

2774+
### Micron SSD Lifetime Validation
2775+
2776+
Due to [CSCwt38698][69], certain Micron SSDs present in the fabric may experience premature end-of-life failures after upgrading to `6.1(5e)` or `6.2(1g)`.
2777+
2778+
To avoid this issue, change the target version to another version. Or run the **SSD Lifetime Validation** script on all nodes with identified Micron SSDs prior to upgrading to determine the remaining SSD lifetime. If the SSD lifetime is critically low, you have to follow the SSD replacement procedure outlined in the field notice to ensure that the node remains available after the upgrade. In case you already upgraded your node and are experiencing unavailability due to this issue, contact Cisco TAC for the SSD replacement procedure to restore the node.
2779+
2780+
- Script location: [SSD Lifetime Validation](https://github.com/datacenter/aci-tac-scripts/tree/main/SSD%20Lifetime%20Validation)
2781+
27732782
[0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script
27742783
[1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html
27752784
[2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html
@@ -2838,4 +2847,5 @@ The [CSCwd40071][68] defect affects versions 5.2(5c) and later with a fix availa
28382847
[65]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws82819
28392848
[66]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwr66848
28402849
[67]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh80837
2841-
[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071
2850+
[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071
2851+
[69]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwt38698
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"eqptFlash": {
4+
"attributes": {
5+
"dn": "topology/pod-1/node-101/sys/ch/p-[1]/disk-1",
6+
"vendor": "Micron",
7+
"model": "MTFDDAK240MBB",
8+
"ser": "SN0001"
9+
}
10+
}
11+
},
12+
{
13+
"eqptFlash": {
14+
"attributes": {
15+
"dn": "topology/pod-2/node-201/sys/ch/p-[1]/disk-1",
16+
"vendor": "Micron",
17+
"model": "MTFDDAK480MBB",
18+
"ser": "SN0002"
19+
}
20+
}
21+
}
22+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"eqptFlash": {
4+
"attributes": {
5+
"dn": "topology/pod-1/node-101/sys/ch/p-[1]/disk-1",
6+
"vendor": "Micron",
7+
"model": "MTFDDAK240MBB",
8+
"ser": "SN0001"
9+
}
10+
}
11+
}
12+
]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
test_function = "micron_ssd_lifetime_check"
12+
13+
# API query
14+
eqptflash_micron = 'eqptFlash.json?query-target-filter=eq(eqptFlash.vendor,"Micron")'
15+
16+
# Test data loaded from JSON files
17+
no_micron_drives = read_data(dir, "eqptFlash_no_micron.json")
18+
micron_drives_single = read_data(dir, "eqptFlash_single_micron.json")
19+
micron_drives_multi = read_data(dir, "eqptFlash_multi_micron.json")
20+
21+
22+
@pytest.mark.parametrize(
23+
"icurl_outputs, tversion, expected_result, expected_data",
24+
[
25+
# Test 0: MANUAL - tversion missing
26+
({}, None, script.MANUAL, []),
27+
# Test 1: NA - tversion not affected (older)
28+
({}, "6.0(2h)", script.NA, []),
29+
# Test 2: NA - tversion not affected (newer)
30+
({}, "6.2(2a)", script.NA, []),
31+
# Test 3: PASS - affected version 6.1(5e) but no Micron drives
32+
(
33+
{eqptflash_micron: no_micron_drives},
34+
"6.1(5e)",
35+
script.PASS,
36+
[],
37+
),
38+
# Test 4: PASS - affected version 6.2(1g) but no Micron drives
39+
(
40+
{eqptflash_micron: no_micron_drives},
41+
"6.2(1g)",
42+
script.PASS,
43+
[],
44+
),
45+
# Test 5: FAIL_O - affected version 6.1(5e) with single Micron drive
46+
(
47+
{eqptflash_micron: micron_drives_single},
48+
"6.1(5e)",
49+
script.FAIL_O,
50+
[["1", "101", "MTFDDAK240MBB", "SN0001"]],
51+
),
52+
# Test 6: FAIL_O - affected version 6.2(1g) with single Micron drive
53+
(
54+
{eqptflash_micron: micron_drives_single},
55+
"6.2(1g)",
56+
script.FAIL_O,
57+
[["1", "101", "MTFDDAK240MBB", "SN0001"]],
58+
),
59+
# Test 7: FAIL_O - multiple Micron drives across pods and nodes
60+
(
61+
{eqptflash_micron: micron_drives_multi},
62+
"6.1(5e)",
63+
script.FAIL_O,
64+
[
65+
["1", "101", "MTFDDAK240MBB", "SN0001"],
66+
["2", "201", "MTFDDAK480MBB", "SN0002"],
67+
],
68+
),
69+
],
70+
)
71+
def test_logic(run_check, mock_icurl, tversion, expected_result, expected_data):
72+
result = run_check(
73+
tversion=script.AciVersion(tversion) if tversion else None,
74+
username="fake_username",
75+
password="fake_password",
76+
)
77+
assert result.result == expected_result
78+
assert result.data == expected_data

0 commit comments

Comments
 (0)