Skip to content
Merged
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
61 changes: 61 additions & 0 deletions aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6532,6 +6532,66 @@ def wred_affected_model_check(tversion, fabric_nodes, **kwargs):
return Result(result=NA, msg="No affected Fabric module found.")


@check_wrapper(check_title='N9K-C93180YC-FX3 Switch Memory Less Than 32GB')
def n9k_c93180yc_fx3_switch_memory_check(fabric_nodes, **kwargs):
result = PASS
headers = ["NodeId", "Name", "Model", "Memory Detected (GB)"]
data = []
recommended_action = 'Increase the switch memory to at least 32GB on affected N9K-C93180YC-FX3.'
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#n9k-c93180yc-fx3-switch-memory-less-than-32gb'
min_memory_kb = 32 * 1000 * 1000
msg = ''

affected_nodes = [
node for node in fabric_nodes
if node['fabricNode']['attributes']['model'] == 'N9K-C93180YC-FX3'
]

if not affected_nodes:
result = NA
msg = 'No N9K-C93180YC-FX3 switches found. Skipping.'
else:
node_ids = [node['fabricNode']['attributes']['id'] for node in affected_nodes]
node_filter = 'or({})'.format(','.join(
'wcard(procMemUsage.dn,"node-{}/")'.format(nid) for nid in node_ids
))
query = 'procMemUsage.json?query-target-filter=and({},wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"{}"))'.format(
node_filter, min_memory_kb
)
proc_mem_mos = icurl('class', query)

node_id_to_attrs = {
node['fabricNode']['attributes']['id']: node['fabricNode']['attributes']
for node in affected_nodes
}

for memory_mo in proc_mem_mos:
attrs = memory_mo['procMemUsage']['attributes']
dn_match = re.search(node_regex, attrs['dn'])
if not dn_match:
continue
node_id = dn_match.group('node')
if node_id not in node_id_to_attrs:
continue
memory_in_gb = round(int(attrs['Total']) / 1000000, 2)
result = FAIL_O
data.append([
node_id,
node_id_to_attrs[node_id]['name'],
node_id_to_attrs[node_id]['model'],
memory_in_gb,
])

if data:
msg = (
'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. '
'One or more switches with less than 32GB of memory may experience service instability. '
'Upgrade the switch memory to at least 32GB.'
)

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


# ---- Script Execution ----


Expand Down Expand Up @@ -6705,6 +6765,7 @@ class CheckManager:
inband_management_policy_misconfig_check,
bgpProto_timer_policy_already_existing_check,
wred_affected_model_check,
n9k_c93180yc_fx3_switch_memory_check,
]
ssh_checks = [
# General
Expand Down
14 changes: 13 additions & 1 deletion docs/docs/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ Items | Defect | This Script
[Inband Management Policy Misconfiguration][d33]| CSCwd40071 | :white_check_mark: | :no_entry_sign:
[BgpProto timer policy already existing][d34] | CSCwt78235 | :white_check_mark: | :no_entry_sign:
[WRED with Affected FM Models][d35] | CSCwt50713 | :white_check_mark: | :no_entry_sign:
[N9K-C93180YC-FX3 Switch Memory Less Than 32GB][d36] | CSCwm42741 | :white_check_mark: | :no_entry_sign:

[d1]: #ep-announce-compatibility
[d2]: #eventmgr-db-size-defect-susceptibility
Expand Down Expand Up @@ -241,6 +242,7 @@ Items | Defect | This Script
[d33]: #inband-management-policy-misconfiguration
[d34]: #bgpProto-timer-policy-already-existing
[d35]: #wred-with-affected-fm-models
[d36]: #n9k-c93180yc-fx3-switch-memory-less-than-32gb

## General Check Details

Expand Down Expand Up @@ -2819,6 +2821,15 @@ To avoid this issue, disable WRED on the affected nodes or upgrade to a release
This bug [CSCwt78235][71] validates `F0467` faults where `changeSet` contains 'bgpProt-policy-already-existing'. The fault indicates conflicting BGP protocol timer policy under an L3Outs deployed in same vrf under same node. If this fault is not resolved, l3out will not be programmed properly in the leaf after the clean reboot or the upgrade.


### N9K-C93180YC-FX3 Switch Memory Less Than 32GB

This check applies to N9K-C93180YC-FX3 switches only. It checks whether the switch has less than 32GB of memory. The minimum RAM requirement for the N9K-C93180YC-FX3 to operate properly in ACI mode is 32GB. This check is not version dependent and runs for all upgrade versions.

[CSCwm42741][74] tracks this issue. N9K-C93180YC-FX3 switches running in ACI mode with less than 32GB of memory will not perform well and are at risk of service instability. With fix of CSCwm42741, a critical fault F4680 (`eqpt-low-memory-device`) is raised on affected switches.

If any N9K-C93180YC-FX3 switch is flagged by this check, upgrade the switch memory to at least 32GB before proceeding with the upgrade.


[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 @@ -2892,4 +2903,5 @@ This bug [CSCwt78235][71] validates `F0467` faults where `changeSet` contains 'b
[70]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvo27498
[71]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwt78235
[72]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwt50713
[73]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwo74485
[73]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwo74485
[74]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwm42741
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-201",
"id": "201",
"name": "leaf201",
"model": "N9K-C9508",
"role": "leaf"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-101",
"id": "101",
"name": "leaf101",
"model": "N9K-C93180YC-FX3",
"role": "leaf"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-101",
"id": "101",
"name": "leaf101",
"model": "N9K-C93180YC-FX3",
"role": "leaf"
}
}
},
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-102",
"id": "102",
"name": "leaf102",
"model": "N9K-C9364C",
"role": "leaf"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"procMemUsage": {
"attributes": {
"dn": "topology/pod-1/node-101/sys/procmem/memusage-sup",
"Modname": "sup",
"Total": "16000000"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import os
import pytest
import logging
import importlib
from helpers.utils import read_data

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

log = logging.getLogger(__name__)
dir = os.path.dirname(os.path.abspath(__file__))

test_function = "n9k_c93180yc_fx3_switch_memory_check"

# icurl queries - filtered by affected node IDs and memory threshold
proc_mem_query_node101 = 'procMemUsage.json?query-target-filter=and(or(wcard(procMemUsage.dn,"node-101/")),wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"32000000"))'


@pytest.mark.parametrize(
Comment thread
Priyanka-Patil14 marked this conversation as resolved.
"fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data",
[
# No nodes returned
(
[],
{},
script.NA,
'No N9K-C93180YC-FX3 switches found. Skipping.',
[],
),
# Non-N9K-C93180YC-FX3 node (N9K-C9508)
(
read_data(dir, "fabricNode_N9K-C9508.json"),
{},
script.NA,
'No N9K-C93180YC-FX3 switches found. Skipping.',
[],
),
# N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt)
(
read_data(dir, "fabricNode_one.json"),
{
proc_mem_query_node101: [],
},
script.PASS,
'',
[],
),
# Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty
(
read_data(dir, "fabricNode_two.json"),
{
proc_mem_query_node101: [],
},
script.PASS,
'',
[],
),
# N9K-C93180YC-FX3 node with <32GB memory (fail case)
(
read_data(dir, "fabricNode_one.json"),
{
proc_mem_query_node101: read_data(dir, "procMemUsage_lt32gb.json"),
},
script.FAIL_O,
(
'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. '
'One or more switches with less than 32GB of memory may experience service instability. '
'Upgrade the switch memory to at least 32GB.'
),
[["101", "leaf101", "N9K-C93180YC-FX3", 16.0]],
),
],
)
def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data):
result = run_check(
fabric_nodes=fabric_nodes,
)
assert result.result == expected_result
assert result.msg == expected_msg
if result.data:
assert result.data == expected_data
else:
assert result.unformatted_data == expected_data
Loading