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
23 changes: 23 additions & 0 deletions aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -5208,6 +5208,28 @@ def isis_database_byte_check(tversion, **kwargs):
return Result(result=NA, msg=VER_NOT_AFFECTED)
return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url)

@check_wrapper(check_title='APIC VMM inventory sync fault (F0132)')
def apic_vmm_inventory_sync_faults_check(**kwargs):
result = PASS
headers = ['Fault', 'DN', 'Recommended Action']
data = []
recommended_action = "Please look for Faults under VM and Host and fix them via VCenter, then manually re-trigger inventory sync on APIC"
doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#vmm-inventory-partially-synced'

faultInsts = icurl('class','faultInst.json?query-target-filter=eq(faultInst.code,"F0132")')

for faultInst in faultInsts:
fc = faultInst['faultInst']['attributes']['code']
dn = faultInst['faultInst']['attributes']['dn']
desc = faultInst['faultInst']['attributes']['descr']
change_set = faultInst['faultInst']['attributes']['changeSet']
if dn and desc and "partial-inv" in change_set:
data.append([fc, dn, recommended_action])

if data:
result = MANUAL

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

# ---- Script Execution ----

Expand Down Expand Up @@ -5312,6 +5334,7 @@ def get_checks(api_only, debug_function):
scalability_faults_check,
fabric_port_down_check,
equipment_disk_limits_exceeded,
apic_vmm_inventory_sync_faults_check,

# Configurations
vpc_paired_switches_check,
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Items | Faults | This Script
[Scalability (faults related to Capacity Dashboard)][f18] | TCA faults for eqptcapacityEntity | :white_check_mark: | :no_entry_sign: | :white_check_mark:
[Fabric Port is Down][f19] | F1394: ethpm-if-port-down-fabric | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
[Equipment Disk Limits Exceeded][f20] | F1820: 80% -minor<br>F1821: -major<br>F1822: -critical | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
[VMM Inventory Partially Synced][f21] | F0132: comp-ctrlr-operational-issues | :white_check_mark: | :no_entry_sign: | :no_entry_sign:



Expand All @@ -100,6 +101,7 @@ Items | Faults | This Script
[f18]: #scalability-faults-related-to-capacity-dashboard
[f19]: #fabric-port-is-down
[f20]: #equipment-disk-limits-exceeded
[f21]: #vmm-inventory-partially-synced


### Configuration Checks
Expand Down Expand Up @@ -1499,6 +1501,10 @@ To recover from this fault, try the following action
userdom : all
```

### VMM Inventory Partially Synced

The script checks for fault code F0132 with rule comp-ctrlr-operational-issues, which is raised when APIC has partially synchornized inventory with vCenter server. This check is just a notice to customer so that they can check what is happening. The takeaway is that the data that APIC has about the DC is not in sync with the vCenter so some changes could happen in the APIC inventory when the system goes through the upgrade and tries to resync. If users are using pre-provision, EPG deployment would not be determined by the VMM inventory so unexpected inventory changes would not be so likely to cause outages.

## Configuration Check Details

### VPC-paired Leaf switches
Expand Down
1 change: 1 addition & 0 deletions tests/vmm_inventory_partial_sync/faultInst_neg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
15 changes: 15 additions & 0 deletions tests/vmm_inventory_partial_sync/faultInst_neg1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"faultInst": {
"attributes": {
"cause": "operational-issues",
"code": "F0132",
"changeSet": "remoteOperIssues (Old: , New: event-channel-down)",
"descr": "Operational issues detected for VMM controller: 10.38.166.119 with name HAM_ACI_DR in datacenter UKDR_VDI in domain: UKDRISVC32 due to error: Received partial inventory in the last inventory sync. Please look for Faults under VM and Host and fix them via VCenter, then manually re-trigger inventory sync on APIC",
"dn": "comp/prov-VMware/ctrlr-[UKDRISVC32]-HAM_ACI_DR/fault-F0132",
"rule": "comp-ctrlr-operational-issues"
}
}
}

]
15 changes: 15 additions & 0 deletions tests/vmm_inventory_partial_sync/faultInst_pos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"faultInst": {
"attributes": {
"cause": "operational-issues",
"code": "F0132",
"changeSet": "remoteOperIssues (Old: event-channel-down,partial-inv, New: partial-inv)",
"descr": "Operational issues detected for VMM controller: 10.38.166.119 with name HAM_ACI_DR in datacenter UKDR_VDI in domain: UKDRISVC32 due to error: Received partial inventory in the last inventory sync. Please look for Faults under VM and Host and fix them via VCenter, then manually re-trigger inventory sync on APIC",
"dn": "comp/prov-VMware/ctrlr-[UKDRISVC32]-HAM_ACI_DR/fault-F0132",
"rule": "comp-ctrlr-operational-issues"
}
}
}

]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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__))

f0132_api = 'faultInst.json'
f0132_api += '?query-target-filter=eq(faultInst.code,"F0132")'

@pytest.mark.parametrize(
"icurl_outputs, expected_result",
[
(
{f0132_api: read_data(dir, "faultInst_neg.json")},
script.PASS,
),
(
{f0132_api: read_data(dir, "faultInst_neg1.json")},
script.PASS,
),
(
{f0132_api: read_data(dir, "faultInst_pos.json")},
script.MANUAL,
)
],
)
def test_logic(mock_icurl, expected_result):
result = script.apic_vmm_inventory_sync_faults_check(1, 1)
assert result == expected_result