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
79 changes: 79 additions & 0 deletions aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6026,6 +6026,84 @@ def apic_downgrade_compat_warning_check(cversion, tversion, **kwargs):
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)


# Connection Base Check
@check_wrapper(check_title='Sup-A(+) /MNT/PSS Filesystem Check')
def sup_a_filesystem_check(username, password, fabric_nodes, tversion, **kwargs):
result = PASS
headers = ["Switch ID", "Switch Name", "/mnt/pss Folder usage (MB)", "File Location"]
data = []
recommended_action = 'Review The Bug RNE and apply the workaround to remove any unwanted file before Upgrade'
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations#sup-aa-mnt-pss-filesystem'

if not tversion:
return Result(result=MANUAL, msg=TVER_MISSING)
if tversion.newer_than("6.1(4a)"):
return Result(result=NA, msg='Version not Affected')

has_error = False
n9k_sup_api = 'eqptSupC.json'
n9k_sup_api += '?query-target-filter=and(wcard(eqptSupC.model,"N9K-SUP-A"))'
# Affected model is Sup-A or Sup-A+
n9k_sup_mos = icurl('class', n9k_sup_api)
if not n9k_sup_mos:
return Result(result=NA, msg="No affected Supervisors found", doc_url=doc_url)

nodes = []
sup_regex = node_regex + r'/sys/ch/supslot-(?P<slot>\d)/sup'
for sup in n9k_sup_mos:
node_match = re.search(sup_regex, sup["eqptSupC"]["attributes"]["dn"])
if node_match:
nodes.append(node_match.group("node"))
nodes = list(set(nodes))

switches = [node for node in fabric_nodes if (
node["fabricNode"]["attributes"]["id"] in nodes)]

for switch in switches:
switch_id = switch["fabricNode"]["attributes"]["id"]
switch_name = switch["fabricNode"]["attributes"]["name"]
switch_addr = switch["fabricNode"]["attributes"]["address"]

try:
c = Connection(switch_addr)
c.username = username
c.password = password
c.log = LOG_FILE
c.connect()
except Exception as e:
data.append([switch_id, switch_name, "-", str(e)])
has_error = True
continue
try:
cmd = r"du -ahm /mnt/pss/bootlogs/ | sort -rh | head -15"
c.cmd(cmd)
if "No such file or directory" in c.output:
data.append([switch_id, switch_name, '/mnt/pss/bootlogs not found', "Check user permissions or retry as 'apic#fallback\\\\admin'"])
has_error = True
continue

mntpss = c.output.split("\n")
for line in mntpss:
total_filesystem_regex = r"(?P<filesize>\d{1,}) \/mnt\/pss\/bootlogs\/(?P<filename>\w+\/\w+.+)"
mntpss_usage_match = re.match(total_filesystem_regex, line)
if mntpss_usage_match:
filesize = mntpss_usage_match.group("filesize")
if int(filesize) > 30: # More than 30MB per file
filename = "/mnt/pss/bootlogs/"+ mntpss_usage_match.group("filename")
data.append([switch_id, switch_name, filesize, filename])
except Exception as e:
data.append([switch_id, switch_name, "-", str(e)])
has_error = True
continue

if has_error:
result = ERROR
elif data:
result = FAIL_UF
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)



# ---- Script Execution ----


Expand Down Expand Up @@ -6188,6 +6266,7 @@ class CheckManager:
standby_sup_sync_check,
isis_database_byte_check,
configpush_shard_check,
sup_a_filesystem_check,

]
ssh_checks = [
Expand Down
20 changes: 20 additions & 0 deletions docs/docs/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Items | Defect | This Script
[Stale pconsRA Object][d26] | CSCwp22212 | :warning:{title="Deprecated"} | :no_entry_sign:
[ISIS DTEPs Byte Size][d27] | CSCwp15375 | :white_check_mark: | :no_entry_sign:
[Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: |
[SUP-A/A+ MNT PSS filesystem][d29] | CSCwq58901 | :white_check_mark: | :no_entry_sign:

[d1]: #ep-announce-compatibility
[d2]: #eventmgr-db-size-defect-susceptibility
Expand Down Expand Up @@ -222,6 +223,7 @@ Items | Defect | This Script
[d26]: #stale-pconsra-object
[d27]: #isis-dteps-byte-size
[d28]: #policydist-configpushshardcont-crash
[d29]: #sup-aa-mnt-pss-filesystem


## General Check Details
Expand Down Expand Up @@ -2648,6 +2650,23 @@ Due to [CSCwp95515][59], upgrading to an affected version while having any `conf
If any instances of `configpushShardCont` are flagged by this script, Cisco TAC must be contacted to identify and resolve the underlying issue before performing the upgrade.


### SUP-A/A+ MNT PSS filesystem

In ACI the Supervisor models `N9K-SUP-A` and `N9K-SUP-A+` have a 64GB SSD. This causes the `/mnt/pss` filesystem to have 115M of size.

Due to [CSCwq58901][62] the sysmgr.log files inside the filesystem can reach sizes over 30MB, leading to the filesystem getting full easily. This condition can lead to several issues during upgrade.

The workaround is to free up space in the `/mnt/pss` filesystem by empty the content of the files.

!!! note "Workaround"

To zeroing the content of a file, you can use the following moquery command.

```
spine# echo "" > /mnt/pss/bootlogs/1/sysmgr.log



[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 @@ -2710,3 +2729,4 @@ If any instances of `configpushShardCont` are flagged by this script, Cisco TAC
[59]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp95515
[60]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#Inter
[61]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#EnablePolicyCompression
[62]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwq58901
206 changes: 206 additions & 0 deletions tests/checks/sup_a_filesystem_check/eqptSupC-pos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
[
{
"eqptSupC": {
"attributes": {
"childAction": "",
"descr": "Supervisor Module",
"dn": "topology/pod-1/node-1201/sys/ch/supslot-1/sup",
"fwVer": "",
"hwVer": "2.0",
"id": "1",
"macB": "50-00-e0-54-25-d0",
"macE": "",
"macL": "18",
"mfgTm": "2025-02-16T19:00:00.000-05:00",
"modTs": "2026-01-20T08:53:36.989-05:00",
"model": "N9K-SUP-B+",
"monPolDn": "uni/fabric/monfab-default",
"numP": "0",
"operSt": "online",
"partNumber": "",
"pwrSt": "on",
"rdSt": "active",
"rev": "A1",
"ser": "FOC29080EM1",
"status": "",
"swCId": "350",
"swVer": "",
"type": "supervisor",
"upTs": "2026-01-20T08:53:36.989-05:00",
"vId": "V03",
"vdrId": "",
"vendor": "Cisco Systems, Inc."
}
}
},
{
"eqptSupC": {
"attributes": {
"childAction": "",
"descr": "Supervisor Module",
"dn": "topology/pod-1/node-1201/sys/ch/supslot-2/sup",
"fwVer": "",
"hwVer": "2.0",
"id": "2",
"macB": "c8-82-34-56-36-36",
"macE": "",
"macL": "18",
"mfgTm": "2025-02-16T19:00:00.000-05:00",
"modTs": "2026-01-20T08:54:59.609-05:00",
"model": "N9K-SUP-B+",
"monPolDn": "uni/fabric/monfab-default",
"numP": "0",
"operSt": "online",
"partNumber": "",
"pwrSt": "on",
"rdSt": "standby",
"rev": "A1",
"ser": "FOC29080ENC",
"status": "",
"swCId": "350",
"swVer": "",
"type": "supervisor",
"upTs": "2026-01-20T08:54:59.609-05:00",
"vId": "V03",
"vdrId": "",
"vendor": "Cisco Systems, Inc."
}
}
},
{
"eqptSupC": {
"attributes": {
"childAction": "",
"descr": "Supervisor Module",
"dn": "topology/pod-1/node-1202/sys/ch/supslot-2/sup",
"fwVer": "",
"hwVer": "2.0",
"id": "2",
"macB": "50-00-e0-8a-09-b0",
"macE": "",
"macL": "18",
"mfgTm": "2025-02-16T19:00:00.000-05:00",
"modTs": "2026-01-20T09:40:37.089-05:00",
"model": "N9K-SUP-B+",
"monPolDn": "uni/fabric/monfab-default",
"numP": "0",
"operSt": "online",
"partNumber": "",
"pwrSt": "on",
"rdSt": "active",
"rev": "A1",
"ser": "FOC29080ELR",
"status": "",
"swCId": "350",
"swVer": "",
"type": "supervisor",
"upTs": "2026-01-20T09:40:37.089-05:00",
"vId": "V03",
"vdrId": "",
"vendor": "Cisco Systems, Inc."
}
}
},
{
"eqptSupC": {
"attributes": {
"childAction": "",
"descr": "Supervisor Module",
"dn": "topology/pod-1/node-1202/sys/ch/supslot-1/sup",
"fwVer": "",
"hwVer": "2.0",
"id": "1",
"macB": "50-00-e0-57-c3-b0",
"macE": "",
"macL": "18",
"mfgTm": "2025-02-16T19:00:00.000-05:00",
"modTs": "2026-01-20T09:42:18.024-05:00",
"model": "N9K-SUP-A+",
"monPolDn": "uni/fabric/monfab-default",
"numP": "0",
"operSt": "online",
"partNumber": "",
"pwrSt": "on",
"rdSt": "standby",
"rev": "A1",
"ser": "FOC29080ELZ",
"status": "",
"swCId": "350",
"swVer": "",
"type": "supervisor",
"upTs": "2026-01-20T09:42:18.024-05:00",
"vId": "V03",
"vdrId": "",
"vendor": "Cisco Systems, Inc."
}
}
},
{
"eqptSupC": {
"attributes": {
"childAction": "",
"descr": "Supervisor Module",
"dn": "topology/pod-1/node-1203/sys/ch/supslot-1/sup",
"fwVer": "",
"hwVer": "1.0",
"id": "1",
"macB": "70-7d-b9-c3-0a-a0",
"macE": "",
"macL": "18",
"mfgTm": "2018-05-06T19:00:00.000-05:00",
"modTs": "2026-01-30T13:47:08.188-05:00",
"model": "N9K-SUP-A+",
"monPolDn": "uni/fabric/monfab-default",
"numP": "0",
"operSt": "online",
"partNumber": "",
"pwrSt": "on",
"rdSt": "active",
"rev": "C0",
"ser": "FOC22191BTC",
"status": "",
"swCId": "350",
"swVer": "",
"type": "supervisor",
"upTs": "2026-01-30T13:47:08.188-05:00",
"vId": "V01",
"vdrId": "",
"vendor": "Cisco Systems, Inc."
}
}
},
{
"eqptSupC": {
"attributes": {
"childAction": "",
"descr": "Supervisor Module",
"dn": "topology/pod-1/node-1203/sys/ch/supslot-2/sup",
"fwVer": "",
"hwVer": "1.0",
"id": "2",
"macB": "2c-d0-2d-5c-ed-0c",
"macE": "",
"macL": "18",
"mfgTm": "2018-05-13T19:00:00.000-05:00",
"modTs": "2026-01-30T13:49:05.379-05:00",
"model": "N9K-SUP-A",
"monPolDn": "uni/fabric/monfab-default",
"numP": "0",
"operSt": "online",
"partNumber": "",
"pwrSt": "on",
"rdSt": "standby",
"rev": "C0",
"ser": "FOC2220309S",
"status": "",
"swCId": "350",
"swVer": "",
"type": "supervisor",
"upTs": "2026-01-30T13:49:05.379-05:00",
"vId": "V01",
"vdrId": "",
"vendor": "Cisco Systems, Inc."
}
}
}
]
Loading