Topology File Generation
The topology file describes the physical connections between all cluster elements (switches, hosts, HCAs). It serves three purposes:
-
Documentation — standardized record of the planned topology
-
Validation baseline — serves as the reference for verifying deployed cabling. To confirm that the physical fabric matches the plan, the topology file must be compared against a live fabric discovery (e.g. using
ibtopodiffagainstibdiagnet2.lstoribnetdiscoveroutput). The topology file alone does not perform this verification. -
Troubleshooting — maps and visualizes the topology when diagnosing issues
Scope: This procedure applies only to NDR (MQM9700 / ConnectX-7). For XDR (Q3400/ ConnectX-8) clusters, please refer to the Confirming Topology - XDR chapter in this document.
Prerequisites
|
Component |
Details |
|---|---|
|
Python |
Version [pin exact tested version, e.g. 3.8+] |
|
xlrd |
Version [pin, e.g. 1.2.0] — must be <2.0 (xlrd ≥2.0 drops |
|
xlwt |
Version [pin exact version] |
|
ibutils2 |
Version [pin exact version] — provides |
|
IBNL model files |
Correct |
|
PTP workbook |
Completed Point-To-Point workbook in |
|
Parser script |
IB_Topology_files_data_for_RD.tgz version [pin exact version] — Download: [add exact internal URL] |
Extract the parser:
tar xzf IB_Topology_files_data_for_RD.tgz
All pinned versions should be filled in from a known-working environment before using this procedure.
Understanding Port Identities
Three different port identities are used throughout this process. Do not confuse them:
|
Identity |
Example |
What It Is |
|---|---|---|
|
PTP logical label |
|
Enumeration used in the PTP workbook to number HCA ports per host. An arbitrary planning label — not a hardware identity. |
|
Linux interface name |
|
OS-assigned name for the HCA port. Based on PCI probe order and may vary across kernel versions, BIOS settings, or udev rules. Not a permanent physical identity. |
|
Topology/IBNL model port |
Defined in the |
The port identity used in the generated |
The hcaPortMapping dictionary in the parser script translates PTP logical labels → Linux interface names. The parser then maps these to the IBNL model ports in the generated topology file.
Step 1 — Verify the HCA Port Mapping
Inside parse_ptp_file.py (at the top of the source code), there is a dictionary named hcaPortMapping. It maps each PTP logical label to the corresponding Linux interface name.
hcaPortMapping = {
'U1/P1': 'mlx5_3/P1',
'U1/P2': 'mlx5_1/P1'
}
This means:
-
PTP label U1/P1 → Linux interface mlx5_3, port 1
-
PTP label U1/P2 → Linux interface mlx5_1, port 1
Verify the mapping for each server hardware profile — not just one representative node, unless all nodes in the cluster are physically identical in HCA placement and wiring.
For each hardware profile:
-
SSH into a node of that profile.
-
Identify each HCA by multiple attributes (OS name alone is not sufficient):
Bash# HCA GUID, state, and port info ibstat # PCI location → interface mapping ls -l /sys/class/infiniband/*/device | awk -F/ '{print $(NF-2), $NF}' # Verify which switch port each local HCA port is connected to iblinkinfo | grep $(hostname) # Or from ibdiagnet output: grep $(hostname) ibdiagnet2.lst -
For each PTP label (U1/P1, U1/P2, …), confirm:
-
The correct Linux interface (
mlx5_N) -
The HCA GUID matches expectations
-
The PCI slot matches the physical HCA location
-
The connected switch peer port (from
iblinkinfooribnetdiscover) matches the PTP plan
-
-
Update the dictionary for any hardware profile that differs.
Step 2 — Pre-Generation Mapping Checks
Before running the parser, confirm the mapping passes these gates.
Generation must not proceed if any check fails.
|
Gate |
Check |
Fail Action |
|---|---|---|
|
Completeness |
Every PTP HCA label used in the workbook has exactly one entry in |
Stop — add missing mappings |
|
Uniqueness |
No two PTP labels map to the same |
Stop — resolve duplicate mappings |
|
Model validity |
Every mapped port exists in the selected IBNL model file for the HCA type |
Stop — correct the mapping or update the IBNL model |
Quick self-check:
python3 -c "
from parse_ptp_file import hcaPortMapping
labels = list(hcaPortMapping.keys())
targets = list(hcaPortMapping.values())
print(f'Labels: {len(labels)}, Unique targets: {len(set(targets))}')
assert len(labels) == len(set(targets)), 'ERROR: duplicate target mapping detected'
print('Mapping OK - no duplicates')
"
Step 3 — Run the Parser Script
From the directory containing the script, IBNL model files, and PTP workbook:
python3 parse_ptp_file.py parse -f <ptp-workbook>.xls -of -mhp
|
Flag |
Description |
|---|---|
|
|
Path to the PTP workbook ( |
|
|
Parse using the original PTP workbook format |
|
|
Translate PTP HCA port numbers (U1/Pn) to |
Expected output:
-
output.topo— the generated topology file -
ibdmchkvalidation output (run automatically by the script)
Generating output.topo alone does not mean success. You must check the ibdmchk result and pass all validation checks below.
Step 4 — Validate ibdmchk Results
Record the exact command (run by the script, or run manually):
ibdmchk -t output.topo
Acceptance criteria:
|
Outcome |
Description |
Action |
|---|---|---|
|
Exit code |
Topology is valid |
Proceed to Step 5 |
|
Exit code |
Topology parsed, but issues detected |
Review every warning individually. Expected warnings (e.g. intentionally unused ports) must be documented and justified. Unexpected warnings must be resolved before proceeding. |
|
Exit code ≠ 0, or parsing/model errors in stderr |
Topology is invalid |
Fatal — do not proceed. Fix the PTP data, mapping, or IBNL model files and regenerate. |
Save the full ibdmchk output (stdout + stderr), it is a required archival artifact.
Step 5 — Post-Generation Validation Checks
5a — Authoritative Count Comparison
Compare the generated topology against the approved PTP workbook (the single source of truth for expected counts):
|
Check |
Source of Truth |
Method |
Notes |
|---|---|---|---|
|
Unique switch count |
Count of unique switch names in PTP workbook |
Count system header lines in |
Must be an exact match |
|
Unique host count |
Count of unique host names in PTP workbook |
Count unique HCA system names in |
Must be an exact match |
|
Unique endpoint pairs (cables) |
Total cable count from PTP workbook |
Count link lines ( |
Each connection appears once in the topology (from the switch side). Account for this when comparing against PTP row counts, which may list both endpoints. |
# Count unique switches (system header lines)
grep -cP '^\S+.*CFG' output.topo
# Count unique hosts
grep -oP '(?<=-> )\S+ \S+' output.topo | awk '{print $2}' | sort -u | wc -l
# Count total links (endpoint pairs)
grep -c "\->" output.topo
5b — Structural Checks
|
Check |
Method |
Notes |
|---|---|---|
|
Unresolved endpoints |
Search for any system or port name that doesn’t match the IBNL model definitions |
Any unresolved name is a failure |
|
Duplicate endpoints |
Extract all |
Duplicates indicate PTP or mapping errors |
|
Mapping translation |
If |
Some XDR topology models intentionally retain |
|
Link width/speed |
Verify values are consistent with your platform design |
|
# Check for duplicate endpoint pairs (should return nothing)
grep "\->" output.topo | awk '{print $1, $NF}' | sort | uniq -d
# List all unique system names for review
grep -oP '^\S+|(?<=-> )\S+ \S+' output.topo | sort -u
Step 6 — Rename and Archive
Rename the file with a meaningful convention:
mv output.topo <site>_<cluster>_topology_<YYYY-MM-DD>.topo
Mandatory archival checklist — store all items together in a shared, reachable location:
|
Artifact |
Description |
|---|---|
|
|
The generated topology file |
|
PTP workbook |
The original, unmodified source |
|
Parser script |
The complete edited |
|
Mapping table |
|
|
Dependency versions |
Python version, xlrd version, xlwt version, ibutils2 version |
|
IBNL model files |
The |
|
|
Full stdout + stderr from the validation run |
|
Expected vs. actual counts |
Switch count, host count, link count — expected (from PTP) and actual (from |
|
File hashes |
SHA-256 of the |
|
Metadata |
Site name, cluster name, date, operator |
# Generate SHA-256 hashes
sha256sum <site>_<cluster>_topology_<YYYY-MM-DD>.topo <ptp-workbook>.xls > checksums.sha256
This topology file is used in subsequent stages including cable validation, fabric diagnostics, and maintenance verification.
Topology File Example
The following is an illustrative example. Exact system names, port identities, and link speeds depend on your platform, IBNL model, and hcaPortMapping. Replace with actual validated output from your generation run.
MQM9700 cl02s0lclf01 CFG : main=4x
P1 -4x-100G-> HCA_mlx5_3 cl02s0ldgx01 P1
P2 -4x-100G-> HCA_mlx5_3 cl02s0ldgx02 P1
P3 -4x-100G-> HCA_mlx5_3 cl02s0ldgx03 P1
P4 -4x-100G-> HCA_mlx5_3 cl02s0ldgx04 P1
...
When -mhp is used, the output should show the translated mlx5_N names — not the raw PTP labels (U1/Pn). If U1/Pn labels still appear in the output, the mapping was not applied correctly.
Saving the Topology File
After creating the Point-to-Point excel file and the topology file, make sure to save the file for future usage.
If you do not save the file, you will have to repeat the cluster panning steps the next time you bring-up the cluster.
Facilitating the topology enables you to apply the master topology settings to the current topology, when the final topology is reached. This ensures that the fabric is in a consistent and optimal state. The master topology is a reference point that represents the desired state of the fabric. It can be set by selecting the latest topology or by uploading a predefined custom topology from a file.
Periodic comparison allows users to compare the current fabric topology with a preset master topology. By comparing the current topology with the master topology, users can detect any deviations, errors, or anomalies in the fabric and take corrective actions if needed.
Last updated: