Skip to content

Commit 995745f

Browse files
Added N9K-C93180YC-FX3 switch memory check
1 parent 0d28b80 commit 995745f

14 files changed

Lines changed: 405 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
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+
]
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+
]

0 commit comments

Comments
 (0)