Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6410,6 +6410,58 @@ def svccore_excessive_data_check(**kwargs):
return Result(result=ERROR, msg="Error occurred while fetching svccore object counts: {}".format(str(e)), doc_url=doc_url)


@check_wrapper(check_title="WRED with Affected FM Models")
def wred_affected_model_check(tversion, fabric_nodes, **kwargs):
result = PASS
headers = ["Node ID", "Node Name", "Source", "Model"]
data = []
recommended_action = "Disable WRED in fabric or upgrade to a release newer than 6.1(5e) or 6.2(1g)."
doc_url = "https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#wred-with-affected-fm-models"

if not tversion:
return Result(result=MANUAL, msg=TVER_MISSING)

version_affected = (
(tversion.major1 == "6" and tversion.major2 == "1" and (tversion.older_than("6.1(5e)") or tversion.same_as("6.1(5e)")))
or (tversion.major1 == "6" and tversion.major2 == "2" and (tversion.older_than("6.2(1g)") or tversion.same_as("6.2(1g)")))
)
if not version_affected:
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
return Result(result=NA, msg=VER_NOT_AFFECTED)

affected_models = {"N9K-C9504-FM-E", "N9K-C9508-FM-E", "N9K-C9516-FM-E"}

node_name_map = {
node["fabricNode"]["attributes"]["id"]: node["fabricNode"]["attributes"]["name"]
for node in fabric_nodes
}

for cong in icurl("class", "qosCong.json"):
if cong.get("qosCong", {}).get("attributes", {}).get("algo") == "wred":
break
else:
return Result(result=PASS, msg="WRED not enabled.")

unique_list = {}
for obj in icurl("class", "eqptFC.json"):
attr = obj["eqptFC"]["attributes"]
model = attr.get("model", "")
if model not in affected_models:
continue
dn_match = re.search(node_regex, attr.get("dn", ""))
if not dn_match:
continue
node_id = dn_match.group("node")
unique_list[(node_id, model)] = [node_id, node_name_map.get(node_id, ""), "FM", model]
data = list(unique_list.values())

if not data:
return Result(result=NA, msg="No affected Fabric module found.")

result = FAIL_O

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


# ---- Script Execution ----


Expand Down Expand Up @@ -6581,6 +6633,7 @@ class CheckManager:
rogue_ep_coop_exception_mac_check,
n9k_c9408_model_lem_count_check,
inband_management_policy_misconfig_check,
wred_affected_model_check,
]
ssh_checks = [
# General
Expand Down
16 changes: 15 additions & 1 deletion docs/docs/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ Items | Defect | This Script
[N9K-C9408 with more than 5 N9K-X9400-16W LEMs][d31] | CSCws82819 | :white_check_mark: | :no_entry_sign:
[Multi-Pod Modular Spine Bootscript File][d32] | CSCwr66848 | :white_check_mark: | :no_entry_sign:
[Inband Management Policy Misconfiguration][d33]| CSCwd40071 | :white_check_mark: | :no_entry_sign:
[WRED with Affected FM Models][d34] | CSCwt50713 | :white_check_mark: | :no_entry_sign:

[d1]: #ep-announce-compatibility
[d2]: #eventmgr-db-size-defect-susceptibility
Expand Down Expand Up @@ -237,6 +238,7 @@ Items | Defect | This Script
[d31]: #n9k-c9408-with-more-than-5-n9k-x9400-16w-lems
[d32]: #multi-pod-modular-spine-bootscript-file
[d33]: #inband-management-policy-misconfiguration
[d34]: #wred-with-affected-fm-models

## General Check Details

Expand Down Expand Up @@ -2798,6 +2800,17 @@ Administrators may be unable to access or operate the APIC GUI, potentially impa
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.


### WRED with Affected FM Models

Due to [CSCwt50713][70], when WRED (Weighted Random Early Detection) is enabled and specific Fabric Module (FM) hardware models are present in the fabric, the spine switch may crash after moving to an affected ACI release in the 6.1(x) or 6.2(x) range.

Affected versions: version <= 6.1(5e) or version <= 6.2(1g).

Affected hardware models: N9K-C9504-FM-E, N9K-C9508-FM-E, N9K-C9516-FM-E.

To avoid this issue, disable WRED on the affected nodes or upgrade to a release newer than 6.1(5e) in the 6.1(x) train or newer than 6.2(1g) in the 6.2(x) train.


[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
[2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html
Expand Down Expand Up @@ -2867,4 +2880,5 @@ This check will verify the count of the `svccoreCtrlr` Managed Object and raise
[66]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwr66848
[67]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh80837
[68]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwd40071
[69]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws84232
[69]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCws84232
[70]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwt50713
10 changes: 10 additions & 0 deletions tests/checks/wred_affected_model_check/eqptFC_affected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"eqptFC": {
"attributes": {
"dn": "topology/pod-1/node-1001/sys/ch/fcslot-1/fc",
"model": "N9K-C9508-FM-E"
}
}
}
]
1 change: 1 addition & 0 deletions tests/checks/wred_affected_model_check/eqptFC_empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
18 changes: 18 additions & 0 deletions tests/checks/wred_affected_model_check/eqptFC_mixed.json
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"eqptFC": {
"attributes": {
"dn": "topology/pod-1/node-1001/sys/ch/fcslot-1/fc",
"model": "N9K-C9508-FM-E"
}
}
},
{
"eqptFC": {
"attributes": {
"dn": "topology/pod-1/node-1001/sys/ch/fcslot-2/fc",
"model": "N9K-C9504-FM-G"
}
}
}
]
13 changes: 13 additions & 0 deletions tests/checks/wred_affected_model_check/fabricNode_spine.json
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-1001",
"id": "1001",
"name": "spine1001",
"role": "spine",
"model": "N9K-C9504"
}
}
}
]
16 changes: 16 additions & 0 deletions tests/checks/wred_affected_model_check/qosCong_mixed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"qosCong": {
"attributes": {
"algo": "tail-drop"
}
}
},
{
"qosCong": {
"attributes": {
"algo": "wred"
}
}
}
]
9 changes: 9 additions & 0 deletions tests/checks/wred_affected_model_check/qosCong_tail_drop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"qosCong": {
"attributes": {
"algo": "tail-drop"
}
}
}
]
9 changes: 9 additions & 0 deletions tests/checks/wred_affected_model_check/qosCong_wred.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"qosCong": {
"attributes": {
"algo": "wred"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import os
import pytest
import importlib
from helpers.utils import read_data

script = importlib.import_module("aci-preupgrade-validation-script")

dir = os.path.dirname(os.path.abspath(__file__))

test_function = "wred_affected_model_check"

# icurl queries
qosCong_api = "qosCong.json"
eqptFC_api = "eqptFC.json"


@pytest.mark.parametrize(
"tversion, fabric_nodes, icurl_outputs, expected_result, expected_data",
[
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
# Case 1: Target version not supplied. Expected: MANUAL.
(
None,
read_data(dir, "fabricNode_spine.json"),
{},
script.MANUAL,
[],
),
# Case 2: Target version 6.2(2a) is the first fixed release and not in the affected range.
# Version gate fails. Expected: NA without any API calls.
(
"6.2(2a)",
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
read_data(dir, "fabricNode_spine.json"),
{},
script.NA,
[],
),
# Case 2: All 3 gates triggered via an affected FM on a spine node.
# Version 6.2(1g) is in affected range, WRED is enabled, FM model N9K-C9508-FM-E is affected.
# Expected: FAIL_O with node 1001 reported under Source=FM.
(
"6.2(1g)",
read_data(dir, "fabricNode_spine.json"),
{
qosCong_api: read_data(dir, "qosCong_wred.json"),
eqptFC_api: read_data(dir, "eqptFC_affected.json"),
},
script.FAIL_O,
[["1001", "spine1001", "FM", "N9K-C9508-FM-E"]],
),
# Case 3: Version is affected but no affected FM hardware found.
# WRED is enabled so the script proceeds to the FM check, which finds nothing.
# Hardware gate fails. Expected: NA - issue is model-specific.
(
"6.1(5e)",
read_data(dir, "fabricNode_spine.json"),
{
qosCong_api: read_data(dir, "qosCong_wred.json"),
eqptFC_api: read_data(dir, "eqptFC_empty.json"),
},
script.NA,
[],
),
# Case 4: Version is affected and FM is affected, but WRED is not enabled (tail-drop).
# WRED gate fails. Expected: PASS - confirms all 3 gates must be true simultaneously.
(
"6.1(5e)",
read_data(dir, "fabricNode_spine.json"),
{
qosCong_api: read_data(dir, "qosCong_tail_drop.json"),
eqptFC_api: read_data(dir, "eqptFC_affected.json"),
},
script.PASS,
[],
),
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
# Case 5: Multiple FM objects - one affected (N9K-C9508-FM-E), one unaffected (N9K-C9504-FM-G).
# WRED is enabled. Only the affected FM should be reported.
# Expected: FAIL_O with only the affected FM row reported.
(
"6.1(5e)",
read_data(dir, "fabricNode_spine.json"),
{
qosCong_api: read_data(dir, "qosCong_wred.json"),
eqptFC_api: read_data(dir, "eqptFC_mixed.json"),
},
script.FAIL_O,
[["1001", "spine1001", "FM", "N9K-C9508-FM-E"]],
),
# Case 6: Version is affected, WRED is enabled, but no affected FM models found.
# FM gate fails. Expected: NA.
(
"6.2(1g)",
read_data(dir, "fabricNode_spine.json"),
{
qosCong_api: read_data(dir, "qosCong_wred.json"),
eqptFC_api: read_data(dir, "eqptFC_empty.json"),
},
script.NA,
[],
),
# Case 7: Same node has two FM slots with the same affected model (duplicate eqptFC objects).
# Deduplication by (node_id, model) must result in only one row.
# Expected: FAIL_O with a single row for node 1001.
(
"6.2(1g)",
read_data(dir, "fabricNode_spine.json"),
{
qosCong_api: read_data(dir, "qosCong_wred.json"),
eqptFC_api: read_data(dir, "eqptFC_duplicate.json"),
},
script.FAIL_O,
[["1001", "spine1001", "FM", "N9K-C9508-FM-E"]],
),
],
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
)
def test_logic(run_check, mock_icurl, tversion, fabric_nodes, expected_result, expected_data):
result = run_check(
tversion=script.AciVersion(tversion) if tversion else None,
fabric_nodes=fabric_nodes,
)
assert result.result == expected_result
assert result.data == expected_data