Skip to content

Commit bac2092

Browse files
Add N9K-C93180YC-FX3 switch memory check
1 parent 0d28b80 commit bac2092

15 files changed

Lines changed: 416 additions & 2 deletions

aci-preupgrade-validation-script.py

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6385,8 +6385,103 @@ def inband_management_policy_misconfig_check(cversion, tversion, **kwargs):
63856385
if data:
63866386
result = FAIL_O
63876387
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)
6388-
6389-
6388+
6389+
6390+
@check_wrapper(check_title='N9K-C93180YC-FX3 Switch Memory')
6391+
def n9k_c93180yc_fx3_switch_memory_check(fabric_nodes, **kwargs):
6392+
result = PASS
6393+
headers = ["NodeId", "Name", "Model", "Memory Detected (GB)"]
6394+
data = []
6395+
unformatted_headers = ['DN', 'Total']
6396+
unformatted_data = []
6397+
recommended_action = 'Increase the switch memory to at least 32GB on affected N9K-C93180YC-FX3 switches.'
6398+
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#n9k-c93180yc-fx3-switch-memory'
6399+
min_memory_kb = 32 * 1000 * 1000
6400+
msg = ''
6401+
6402+
affected_nodes = [
6403+
node for node in fabric_nodes
6404+
if node.get('fabricNode', {}).get('attributes', {}).get('model', '') == 'N9K-C93180YC-FX3'
6405+
]
6406+
6407+
if not affected_nodes:
6408+
result = NA
6409+
msg = 'No N9K-C93180YC-FX3 switches found. Skipping.'
6410+
else:
6411+
proc_mem_mos = icurl('class', 'procMemUsage.json')
6412+
node_total_kb = {}
6413+
6414+
for memory_mo in proc_mem_mos:
6415+
attrs = memory_mo.get('procMemUsage', {}).get('attributes', {})
6416+
total = attrs.get('Total')
6417+
mem_dn = attrs.get('dn', '')
6418+
if not total or '/memusage-sup' not in mem_dn:
6419+
continue
6420+
dn_match = re.search(node_regex, mem_dn)
6421+
if not dn_match:
6422+
unformatted_data.append([mem_dn, total])
6423+
continue
6424+
try:
6425+
total_kb = int(total)
6426+
except (TypeError, ValueError):
6427+
unformatted_data.append([mem_dn, total])
6428+
continue
6429+
6430+
node_id = dn_match.group('node')
6431+
if node_id not in node_total_kb:
6432+
node_total_kb[node_id] = total_kb
6433+
6434+
missing_nodes = []
6435+
6436+
for node in affected_nodes:
6437+
node_id = node['fabricNode']['attributes']['id']
6438+
total_kb = node_total_kb.get(node_id)
6439+
if total_kb is None:
6440+
missing_nodes.append([
6441+
node_id,
6442+
node['fabricNode']['attributes'].get('name', ''),
6443+
node['fabricNode']['attributes'].get('model', ''),
6444+
])
6445+
continue
6446+
6447+
if total_kb < min_memory_kb:
6448+
memory_in_gb = round(total_kb / 1000000, 2)
6449+
result = MANUAL
6450+
data.append([
6451+
node_id,
6452+
node['fabricNode']['attributes'].get('name', ''),
6453+
node['fabricNode']['attributes'].get('model', ''),
6454+
memory_in_gb,
6455+
])
6456+
6457+
if missing_nodes and data:
6458+
result = MANUAL
6459+
msg = (
6460+
'Some N9K-C93180YC-FX3 nodes have insufficient memory and others are missing '
6461+
'procMemUsage data. Please manually verify the memory on all affected nodes.\n'
6462+
'Nodes with insufficient memory: {}\n'
6463+
'Nodes with missing data: {}'.format(
6464+
', '.join(str(row[0]) for row in data),
6465+
', '.join(str(row[0]) for row in missing_nodes),
6466+
)
6467+
)
6468+
headers = ['NodeId', 'Name', 'Model', 'Memory Detected (GB)']
6469+
data = data + [row + ['N/A'] for row in missing_nodes]
6470+
elif missing_nodes:
6471+
result = ERROR
6472+
msg = 'Missing procMemUsage data for one or more affected N9K-C93180YC-FX3 nodes.'
6473+
headers = ['NodeId', 'Name', 'Model']
6474+
data = missing_nodes
6475+
recommended_action = ''
6476+
elif data:
6477+
msg = (
6478+
'One or more N9K-C93180YC-FX3 switches have less than 32GB of memory. '
6479+
'An outage is not guaranteed but can occur. Please verify and upgrade the memory on affected nodes.'
6480+
)
6481+
6482+
return Result(result=result, msg=msg, headers=headers, data=data, unformatted_headers=unformatted_headers, unformatted_data=unformatted_data, recommended_action=recommended_action, doc_url=doc_url)
6483+
6484+
63906485
@check_wrapper(check_title="svccore excessive data check")
63916486
def svccore_excessive_data_check(**kwargs):
63926487
result = PASS
@@ -6501,6 +6596,7 @@ class CheckManager:
65016596
validate_32_64_bit_image_check,
65026597
fabric_link_redundancy_check,
65036598
apic_downgrade_compat_warning_check,
6599+
n9k_c93180yc_fx3_switch_memory_check,
65046600
svccore_excessive_data_check,
65056601

65066602
# Faults

docs/docs/validations.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Items | This Script
3939
[APIC downgrade compatibility when crossing 6.2 release][g19]| :white_check_mark: | :no_entry_sign:
4040
[Supported Hardware Compatibility][g20] | :white_check_mark: | :no_entry_sign:
4141
[Svccore Excessive Data Check][g21] | :white_check_mark: | :no_entry_sign:
42+
[N9K-C93180YC-FX3 Switch Memory][g22] | :white_check_mark: | :no_entry_sign:
4243

4344
[g1]: #compatibility-target-aci-version
4445
[g2]: #compatibility-cimc-version
@@ -61,6 +62,7 @@ Items | This Script
6162
[g19]: #apic-downgrade-compatibility-when-crossing-62-release
6263
[g20]: #supported-hardware-compatibility
6364
[g21]: #svccore-excessive-data-check
65+
[g22]: #n9k-c93180yc-fx3-switch-memory
6466

6567
### Fault Checks
6668
Items | Faults | This Script | APIC built-in
@@ -2786,6 +2788,15 @@ Contact Cisco TAC to remove any identified misconfigured objects before performi
27862788
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].
27872789

27882790

2791+
### N9K-C93180YC-FX3 Switch Memory
2792+
2793+
This check applies to N9K-C93180YC-FX3 switches only. It checks whether the switch is using 16GB or 32GB of memory and flags switches running on 16GB memory. This check is not version dependent and runs for all upgrade versions.
2794+
2795+
Impact: Running an N9K-C93180YC-FX3 switch with less than 32GB memory can lead to memory pressure and increase the risk of service instability.
2796+
2797+
If any N9K-C93180YC-FX3 switch is flagged by this check, upgrade the switch memory to at least 32GB.
2798+
2799+
27892800
### Svccore Excessive Data Check
27902801

27912802
Due to excessive `svccoreCtrlr` or `svccoreNode` managed objects, Apic gui stuck in loading multiple queries.
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+
"dn": "topology/pod-1/node-201",
6+
"id": "201",
7+
"name": "leaf201",
8+
"model": "N9K-C9508",
9+
"role": "leaf"
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+
"dn": "topology/pod-1/node-101",
6+
"id": "101",
7+
"name": "leaf101",
8+
"model": "N9K-C93180YC-FX3",
9+
"role": "leaf"
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+
"dn": "topology/pod-1/node-101",
6+
"id": "101",
7+
"name": "leaf101",
8+
"model": "N9K-C93180YC-FX3",
9+
"role": "leaf"
10+
}
11+
}
12+
},
13+
{
14+
"fabricNode": {
15+
"attributes": {
16+
"dn": "topology/pod-1/node-102",
17+
"id": "102",
18+
"name": "leaf102",
19+
"model": "N9K-C9364C",
20+
"role": "leaf"
21+
}
22+
}
23+
}
24+
]
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+
"dn": "topology/pod-1/node-101",
6+
"id": "101",
7+
"name": "leaf101",
8+
"model": "N9K-C93180YC-FX3",
9+
"role": "leaf"
10+
}
11+
}
12+
},
13+
{
14+
"fabricNode": {
15+
"attributes": {
16+
"dn": "topology/pod-1/node-102",
17+
"id": "102",
18+
"name": "leaf102",
19+
"model": "N9K-C93180YC-FX3",
20+
"role": "leaf"
21+
}
22+
}
23+
}
24+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"procMemUsage": {
4+
"attributes": {
5+
"dn": "topology/pod-1/node-101/sys/procmem/memusage-sup",
6+
"Modname": "sup",
7+
"Total": "32676092"
8+
}
9+
}
10+
},
11+
{
12+
"procMemUsage": {
13+
"attributes": {
14+
"dn": "topology/pod-1/node-102/sys/procmem/memusage-sup",
15+
"Modname": "sup",
16+
"Total": "32676092"
17+
}
18+
}
19+
}
20+
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"procMemUsage": {
4+
"attributes": {
5+
"dn": "topology/pod-1/node-101/sys/procmem/memusage-sup",
6+
"Modname": "sup",
7+
"Total": "16000000"
8+
}
9+
}
10+
}
11+
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"procMemUsage": {
4+
"attributes": {
5+
"dn": "topology/pod-1/node-101/sys/procmem/memusage-sup",
6+
"Modname": "sup",
7+
"Total": "32676092"
8+
}
9+
}
10+
}
11+
]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"procMemUsage": {
4+
"attributes": {
5+
"dn": "topology/pod-1/node-101/sys/procmem/memusage-sup",
6+
"Modname": "sup",
7+
"Total": "unknown"
8+
}
9+
}
10+
}
11+
]

0 commit comments

Comments
 (0)