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


@check_wrapper(check_title='SPAN Destination Port with EPG Usage')
def span_destination_epg_conflict_check(tversion, **kwargs):
result = PASS
headers = ["Pod", "Node", "Port", "SPAN Destination Group", "SPAN Mode", "Usage"]
data = []
recommended_action = 'Remove the SPAN destination configuration or the EPG/L3Out/infra VLAN deployment from each listed port before upgrading the switch.'
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#span-destination-port-with-epg-usage'

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

if tversion.older_than("6.1(3a)"):
return Result(result=NA, msg=VER_NOT_AFFECTED, doc_url=doc_url)

src_grp_api = 'spanSrcGrp.json?query-target-filter=eq(spanSrcGrp.adminSt,"enabled")'
src_groups = icurl('class', src_grp_api)
enabled_src_groups = set(src_group['spanSrcGrp']['attributes']['dn'] for src_group in src_groups)
active_dest_groups = set()
if not enabled_src_groups:
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)

span_labels = icurl('class', 'spanSpanLbl.json')
for span_label in span_labels:
attributes = span_label['spanSpanLbl']['attributes']
match = re.match(r'^(uni/infra/srcgrp-[^/]+)/spanlbl-', attributes['dn'])
if match and match.group(1) in enabled_src_groups:
active_dest_groups.add(attributes['name'])

if not active_dest_groups:
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)

destinations = {}
dest_paths = icurl('class', 'spanRsDestPathEp.json')
for dest_path in dest_paths:
attributes = dest_path['spanRsDestPathEp']['attributes']
group_match = re.match(r'^uni/infra/destgrp-([^/]+)/', attributes['dn'])
path_match = re.match(
r'^topology/pod-(\d+)/paths-(\d+)/pathep-\[(eth\d+/\d+(?:/\d+)?)\]$',
attributes['tDn']
)
if not group_match or not path_match or group_match.group(1) not in active_dest_groups:
continue
destinations.setdefault(path_match.groups(), set()).add(group_match.group(1))

for (pod, node, port), groups in sorted(destinations.items()):
phys_if_api = 'topology/pod-{}/node-{}/sys/phys-[{}].json'.format(pod, node, port)
phys_ifs = icurl('mo', phys_if_api)
for phys_if in phys_ifs:
attributes = phys_if['l1PhysIf']['attributes']
usage = [value.strip() for value in attributes.get('usage', '').split(',')]
if 'epg' in usage:
data.append([pod, node, port, ', '.join(sorted(groups)),
attributes.get('spanMode', ''), attributes.get('usage', '')])

if data:
result = FAIL_O

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


class CheckManager:
"""Central managing point of all checks.
Highlevel flows:
Expand Down Expand Up @@ -9678,6 +9738,7 @@ class CheckManager:
nxos_ipn_multicast_rpf_defect_check,
vzany_svcgraph_stretched_vrf_check,
app_center_deprecation_check,
span_destination_epg_conflict_check,
]
ssh_checks = [
# General
Expand Down
13 changes: 13 additions & 0 deletions docs/docs/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ Items | Defect | This Script
[APIC Connected Port VLAN Override][d44] | CSCwn64461 | :white_check_mark: | :no_entry_sign:
[NX-OS IPN Multicast RPF Defect][d45] | CSCwt59437 | :white_check_mark: | :no_entry_sign:
[vzAny Service Graph on Stretched VRF][d46] | CSCwt14573 | :white_check_mark: | :no_entry_sign:
[SPAN Destination Port with EPG Usage][d47] | CSCvz62374 | :white_check_mark: | :no_entry_sign:

[d1]: #ep-announce-compatibility
[d2]: #eventmgr-db-size-defect-susceptibility
Expand Down Expand Up @@ -278,6 +279,7 @@ Items | Defect | This Script
[d44]: #apic-connected-port-vlan-override
[d45]: #nx-os-ipn-multicast-rpf-defect-cscwt59437
[d46]: #vzany-service-graph-on-stretched-vrf
[d47]: #span-destination-port-with-epg-usage

## General Check Details

Expand Down Expand Up @@ -3093,6 +3095,16 @@ The graph instance may be scoped to a VRF, a tenant, or globally (`uni`). Tenant

Recommended action: Migrate the vzAny service graph configuration to NDO before upgrade using brownfield import. NDO 4.2(3e) or later is required for vzAny PBR support on stretched VRFs. This is tracked under [CSCwt14573][91].

### SPAN Destination Port with EPG Usage

Starting with switch release 16.1(3), local SPAN destination and EPG/L3Out/infra VLAN deployment are mutually exclusive on a physical port ([CSCvz62374][95]). An upgrade or reload can change which configuration is deployed, affecting traffic or SPAN monitoring on a port with both configurations.

This check applies to target versions 6.1(3) and later (switch 16.1(3) and later). It reports single-port destinations referenced by enabled access SPAN sessions when the port's `l1PhysIf.usage` contains `epg`, including destinations configured but not currently deployed. Port-channel, vPC, FEX, CPU and fabric SPAN destinations are excluded.

The check uses reported interface usage and cannot detect EPG configurations that have not deployed, including EPG deployment blocked by SPAN or awaiting on-demand deployment. Missing interface objects are skipped; a pass means no conflict was found among the available objects.

Remove either the SPAN destination configuration or the EPG/L3Out/infra VLAN deployment from each listed port before upgrading the switch.

### App Center deprecation when crossing 6.1(2)

Starting with APIC release 6.1(2), App Center and its applications can no longer be hosted on APIC because the APIC App Infrastructure is removed. When an upgrade crosses from a release before 6.1(2) to 6.1(2) or later, this check inventories all installed App Center applications, including inactive applications, and returns `MANUAL CHECK REQUIRED` when any are found.
Expand Down Expand Up @@ -3201,3 +3213,4 @@ This validation is not applicable when the current APIC release is already 6.1(2
[92]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwn95571
[93]: https://dcappcenter.cisco.com/elam-assistant.html
[94]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/all/elam-assistant-user-guide/elam-assistant-user-guide/m-overview.html
[95]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvz62374
41 changes: 41 additions & 0 deletions tests/checks/span_destination_epg_conflict_check/baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"spanSrcGrp.json?query-target-filter=eq(spanSrcGrp.adminSt,\"enabled\")": [
{
"spanSrcGrp": {
"attributes": {
"dn": "uni/infra/srcgrp-Source1"
}
}
}
],
"spanSpanLbl.json": [
{
"spanSpanLbl": {
"attributes": {
"dn": "uni/infra/srcgrp-Source1/spanlbl-Destination1",
"name": "Destination1"
}
}
}
],
"spanRsDestPathEp.json": [
{
"spanRsDestPathEp": {
"attributes": {
"dn": "uni/infra/destgrp-Destination1/dest-Destination1/rsdestPathEp",
"tDn": "topology/pod-1/paths-101/pathep-[eth1/10]"
}
}
}
],
"topology/pod-1/node-101/sys/phys-[eth1/10].json": [
{
"l1PhysIf": {
"attributes": {
"usage": "epg,span",
"spanMode": "span-dest"
}
}
}
]
}
75 changes: 75 additions & 0 deletions tests/checks/span_destination_epg_conflict_check/shared.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"spanSrcGrp.json?query-target-filter=eq(spanSrcGrp.adminSt,\"enabled\")": [
{
"spanSrcGrp": {
"attributes": {
"dn": "uni/infra/srcgrp-Source1"
}
}
}
],
"spanSpanLbl.json": [
{
"spanSpanLbl": {
"attributes": {
"dn": "uni/infra/srcgrp-Source1/spanlbl-Destination1",
"name": "Destination1"
}
}
},
{
"spanSpanLbl": {
"attributes": {
"dn": "uni/infra/srcgrp-Source1/spanlbl-Destination2",
"name": "Destination2"
}
}
}
],
"spanRsDestPathEp.json": [
{
"spanRsDestPathEp": {
"attributes": {
"dn": "uni/infra/destgrp-Destination1/dest-Destination1/rsdestPathEp",
"tDn": "topology/pod-1/paths-101/pathep-[eth1/10]"
}
}
},
{
"spanRsDestPathEp": {
"attributes": {
"dn": "uni/infra/destgrp-Destination2/dest-Destination2/rsdestPathEp",
"tDn": "topology/pod-1/paths-101/pathep-[eth1/10]"
}
}
},
{
"spanRsDestPathEp": {
"attributes": {
"dn": "uni/infra/destgrp-Destination2/dest-Destination3/rsdestPathEp",
"tDn": "topology/pod-2/paths-201/pathep-[eth1/10]"
}
}
}
],
"topology/pod-1/node-101/sys/phys-[eth1/10].json": [
{
"l1PhysIf": {
"attributes": {
"usage": "epg,span",
"spanMode": "span-dest"
}
}
}
],
"topology/pod-2/node-201/sys/phys-[eth1/10].json": [
{
"l1PhysIf": {
"attributes": {
"usage": "epg,span",
"spanMode": "span-dest"
}
}
}
]
}
Loading
Loading