Skip to content

Commit 344d53a

Browse files
Merge pull request #291625 from bartpinto/main
Enhance Validate Cables for Nexus Network Fabric Public Documentation
2 parents 3f17e68 + 86dc9b5 commit 344d53a

File tree

3 files changed

+227
-26
lines changed

3 files changed

+227
-26
lines changed

articles/operator-nexus/how-to-validate-cables.md

Lines changed: 78 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,90 @@ ms.date: 04/15/2024
1111
---
1212
# Validate Cables for Nexus Network Fabric
1313

14-
This article explains the Fabric cable validation, where the primary function of the diagnostic API is to check all fabric devices for potential cabling issues. The Diagnostic API assesses whether the interconnected devices adhere to the Bill of Materials (BOM), classifying them as compliant or noncompliant. The results are presented in a JSON format, encompassing details such as validation status, errors, identifier type, and neighbor device ID. These results are stored in a customer-provided Storage account. It's vital to the overall deployment that errors identified in this report are resolved before moving onto the Cluster deployment step.
14+
This article explains the Fabric cable validation, where the primary function of the diagnostic API is to check all fabric devices for potential cabling issues. The Diagnostic API assesses whether the interconnected devices adhere to the Bill of Materials (BOM) and according to the resource Stock Keeping Units (SKUs), classifying them as compliant or noncompliant. Device types include Customer Edge (CE), Top of Rack (TOR), Management (MGMT), and Network Packet Broker (NPB) devices. The results are presented in a JSON format, encompassing details such as validation status, errors, identifier type, and neighbor device ID. These results are stored in a customer-provided Storage account. It's vital to the overall deployment that errors identified in this report are resolved before moving onto the Cluster deployment step.
15+
16+
For BOM details, refer to [Azure Operator Nexus SKUs](./reference-operator-nexus-skus.md)
1517

1618
## Prerequisites
1719

1820
- Ensure the Nexus Network Fabric is successfully provisioned.
1921
- Provide the Network Fabric ID and storage URL with WRITE access via a support ticket.
22+
- The storage account has these prerequisites:
23+
- The storage account must be in a different Azure region than the Network Fabric Azure region.
24+
- `Storage Blob Data Contributor` role must be assigned to the `Nexus Network Fabric RP` with access assigned to the storage account.
25+
- Microsoft Support must patch the Nexus Network Fabric with an active storage SAS URL before running cabling validation.
26+
27+
## Creating an Azure Support Request for Patching Nexus Network Fabric:
28+
- Refer to [How to create an Azure support request](/azure/azure-portal/supportability/how-to-create-azure-support-request)
29+
- Enter `Nexus Network Fabric` for the issue and click `Go`.
30+
- Select `Azure Operator Nexus` as the service you're having issue with.
31+
- Select `Subscription` where the resource is located.
32+
- Select `General` under the resource field and click `Next`.
33+
- Select `Network fabric instance provisioning` under the issue prompt and click `Next`.
34+
- Now select `Create a support request` at the top of the support blade.
35+
- Click `Next` on the `Problem description` tab.
36+
- Wait for the `Recommended solution` and then click the link back to 'Return to support request`
37+
- Click `Next` on the `Problem description` tab again to continue to `Additional details`
38+
- Fill in the required request details to patch Nexus Network Fabric and then click `Next`
39+
- Review the information in the `Review + create` tab and then click `Create`.
2040

2141
> [!NOTE]
2242
> The Storage URL (SAS) is short-lived. By default, it is set to expire in eight hours. If the SAS URL expires, then the fabric must be re-patched.
2343
24-
## Validate cabling
44+
## Generate the storage URL
45+
46+
To create a container in the storage account, refer to [Create a container](../storage/blobs/blob-containers-portal.md#create-a-container)
47+
48+
> [!NOTE]
49+
> Enter the name of the container using only lowercase letters.
50+
51+
To generate a SAS URL for the container to provide write access to the Nexus Fabric, refer to [Generate a shared access signature](../storage/blobs/blob-containers-portal.md#generate-a-shared-access-signature)
52+
53+
> [!NOTE]
54+
> SAS URLs are short lived. By default, it is set to expire in eight hours. If the SAS URL expires, then you must open a Microsoft support ticket to add a new URL.
55+
56+
## Validate Cabling
2557

2658
1. Execute the following Azure CLI command:
2759

2860
```azurecli
2961
az networkfabric fabric validate-configuration –resource-group "<NFResourceGroupName>" --resource-name "<NFResourceName>" --validate-action "Cabling" --no-wait --debug
3062
```
3163
32-
The following (truncated) output appears. Copy the URL through **private preview**. This portion of the URL is used in the following step to check the status of the operation.
64+
The following (truncated) output appears. Copy the URL from the `Azure-AsyncOperation` section of the debug output. This portion of the URL is used in the following step to check the status of the operation.
3365
3466
```azurecli
35-
https://management.azure.com/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/Microsoft.ManagedNetworkFabric/locations/EASTUS2EUAP/operationStatuses/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e*A9E6DB3DF5C58D67BD395F7A608C056BC8219C392CC1CE0AD22E4C36D70CEE5C?api-version=2022-01-15-privatepreview&t=638485032018035520&c=MIIHHjCCBgagAwIBAgITfwKWMg6goKCq4WwU2AAEApYyDjANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjQwMTMwMTAzMDI3WhcNMjUwMTI0MTAzMDI3WjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALMk1pBZQQoNY8tos8XBaEjHjcdWubRHrQk5CqKcX3tpFfukMI0_PVZK-Kr7xkZFQTYp_ItaM2RPRDXx-0W9-mmrUBKvdcQ0rdjcSXDek7GvWS29F5sDHojD1v3e9k2jJa4cVSWwdIguvXmdUa57t1EHxqtDzTL4WmjXitzY8QOIHLMRLyXUNg3Gqfxch40cmQeBoN4rVMlP31LizDfdwRyT1qghK7vgvworA3D9rE00aM0n7TcBH9I0mu-96JE0gSX1FWXctlEcmdwQmXj_U0sZCu11_Yr6Oa34bmUQHGc3hDvO226L1Au-QsLuRWFLbKJ-0wmSV5b3CbU1kweD5LUCAwEAAaOCBAswggQHMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-
67+
cli.azure.cli.core.sdk.policies: 'Azure-AsyncOperation': '<Azure-AsyncOperation-endpoint url>'
68+
```
3669
70+
The following error indicates the Fabric isn't patched with a valid SAS URL:
71+
```azurecli
72+
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'OK'
3773
```
3874
3975
1. You can programmatically check the status of the operation by running the following command:
4076
4177
```azurecli
4278
az rest -m get -u "<Azure-AsyncOperation-endpoint url>"
79+
{
80+
"endTime": "<OPERATION_COMPLETION_TIME>",
81+
"id": "<OPERATION_ID>",
82+
"name": "OPERATION_NAME",
83+
"properties": {
84+
"url": "CABLING_REPORT_STORAGE_URL"
85+
},
86+
"resourceId": "<FABRIC_RID>",
87+
"startTime": "<OPERATION_START_TIME>",
88+
"status": "Succeeded"
89+
}
4390
```
4491
4592
The operation status indicates if the API succeeded or failed.
4693
4794
> [!NOTE]
4895
> The operation takes roughly 20~40 minutes to complete based on the number of racks.
4996
50-
1. Download and read the validated results from the storage URL.
97+
1. Download and read the validated results from the `<CABLING_REPORT_STORAGE_URL>` retuned from the completed command.
5198
5299
Example output is shown in the following sections.
53100
@@ -112,7 +159,7 @@ networkFabricInfoSkuId": "M8-A400-A100-C16-ab",
112159
                },
113160
```
114161

115-
### Customer Edge to Top of the Rack switch validation
162+
### Customer Edge to Top Of Rack (TOR) switch validation
116163

117164
```azurecli
118165
{
@@ -160,36 +207,41 @@ networkFabricInfoSkuId": "M8-A400-A100-C16-ab",
160207

161208
|Status Type |Definition |
162209
|---------|---------|
163-
|Compliant | When the status is compliant with the BOM specification |
164-
|Non-Compliant | When the status isn't compliant with the BOM specification |
165-
|Unknown | When the status is unknown |
210+
|Compliant | Validation status is compliant with the BOM specification for the interface. |
211+
|NonCompliant | Validation isn't compliant with the BOM specification for the interface. |
212+
|Unknown | Validation is unable to retrieve interface connection details or lldp data isn't returned. The `Unknown` status is returned if the destination device is powered off, missing, disconnected, or unsupported for this interface type. |
166213

167214
#### Validation attributes
168215

169216
|Attribute |Definition |
170217
|---------|---------|
171-
|`deviceConfiguration` | Configuration that's available on the device. |
172-
|`error` | Error from the device |
218+
|`deviceConfiguration` | Configuration that's available on the device. |
219+
|`error` | Error from the device. |
173220
|`reason` | This field is populated when the status of the device is unknown. |
174-
|`validationType` | This parameter indicates what type of validation. (cable & cable specification validations) |
175-
|`deviceDestinationResourceId` | Azure Resource Manager ID of the connected Neighbor (destination device) |
176-
|`roleName` | The role of the Network Fabric Device (CE or TOR) |
221+
|`validationType` | This parameter indicates what type of validation. (cable & cable specification validations). |
222+
|`deviceDestinationResourceId` | Azure Resource Manager ID of the connected Neighbor (destination device). |
223+
|`roleName` | The role of the Network Fabric Device (CE or TOR). |
177224

178-
## Known issues and limitations in cable validation
225+
### Known issues and limitations in cable validation
179226

180-
- Post Validation Connections between TORs and Compute Servers isn't supported.
181-
- Cable Validation for NPB isn't supported because there's no support for "show lldp neighbors" from Arista.
227+
- Cable Validation of connections between TOR and Compute Servers that are powered off or unprovisioned in the Nexus cluster aren't supported. These interfaces show `Unknown` status in the report.
228+
- Cable Validation of connections between MGMT interfaces and Compute Servers that are powered off or unprovisioned in the Nexus cluster or the Compute Server Controllers aren't supported. These interfaces show `Unknown` status in the report.
229+
- Cable Validation for NPB isn't supported for `loopback` and `nni-direct` interfaces because there's no vendor support currently for `show lldp neighbors`. These interfaces show `Unknown` status in the report.
182230
- The Storage URL must be in a different region from the Network Fabric. For instance, if the Fabric is hosted in East US, the storage URL should be outside of East US.
183-
- Cable validation supports both four rack and eight rack BOMs.
184-
185-
## Generate the storage URL
231+
- Cable validation supports four racks with 16 Computes per rack and eight racks with 16 Computes per rack BOMs.
232+
- When destination device is powered off, cables are missing or disconnected, or if validation isn't supported for the interface type, then the interface shows `Unknown` status. **It is important to evaluate all `Unknown` interfaces that are `Not-Connected` against the BOM to determine if repair action is required.**
186233

187-
Refer to [Create a container](../storage/blobs/blob-containers-portal.md#create-a-container) to create a container.
234+
### Typical cable validation `NonCompliant` and `Unknown` Issues
188235

189-
> [!NOTE]
190-
> Enter the name of the container using only lowercase letters.
236+
|validationType |Status |Error |Resolution |
237+
|---------------|-------|-------|------------|
238+
| CableValidation |`NonCompliant`|`Device cable connection is incorrect.` | Verify connections on the source and destination interfaces match the BOM. The `deviceConfiguration` can help identify the destination port date returned on the interface. |
239+
| CableValidation |`Unknown` |`Unable to fetch data from the device.` | Verify connections on the source and destination interfaces are connected and match the BOM |
240+
| CableValidation |`NonCompliant`|`Device cabling in <INTERFACE> incorrect.` | The interface isn't connected. Verify connections on the source and destination interfaces are connected match the BOM. |
241+
| CableValidation |`Unknown` |`Port <INTERFACE> has no connections as per device response.` | Verify connections on the source and destination interfaces are connected and match the BOM. |
242+
| CableSpecificationValidation |`Unknown` |`Unable to fetch Interface Status for <INTERFACE>.` | Verify connections on the source and destination interfaces are connected and match the BOM. |
243+
| CableSpecificationValidation |`NonCompliant` |`Device cable connection is incorrect` | Verify interface card and cables match BOM specification in this interface. |
191244

192-
Refer to [Generate a shared access signature](../storage/blobs/blob-containers-portal.md#generate-a-shared-access-signature) to create the SAS URL of the container. Provide Write permission for SAS.
245+
## Converting Cable Validation Report to HTML Format
193246

194-
> [!NOTE]
195-
> ESAS URLs are short lived. By default, it is set to expire in eight hours. If the SAS URL expires, then you must open a Microsoft support ticket to add a new URL.
247+
Refer to [How to Convert Cable Validation report JSON output to HTML](./howto-convert-cable-validation-html.md).
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
title: How to Convert Network Fabric Cable Validation Report to HTML
3+
description: Learn how to convert Nexus Network Fabric Cable Validation Report to HTML.
4+
author: bpinto
5+
ms.author: bpinto
6+
titleSuffix: Azure Operator Nexus
7+
ms.service: azure-operator-nexus
8+
ms.topic: how-to #Required; leave this attribute/value as-is
9+
ms.date: 12/10/2024
10+
11+
#CustomerIntent: As a < type of user >, I want < what? > so that < why? >.
12+
---
13+
# How to Convert Network Fabric Cable Validation Report to HTML
14+
15+
This article explains how to convert a Nexus Network Fabric Cable Validation Report from JSON output to HTML.
16+
17+
## Prerequisites
18+
19+
- Requires Python 3.11 or later
20+
- Requires Python 3.11 Modules: `json pandas as pd datetime`
21+
22+
## Python Script for Cable Validation JSON to HTML Conversion
23+
24+
```
25+
import json
26+
import pandas as pd
27+
from datetime import datetime
28+
29+
def color_status(val):
30+
"""
31+
Takes a scalar and returns a string with
32+
the css property `'color: green'` for compliant,
33+
`'color: red'` for noncompliant and black for others
34+
"""
35+
if val == 'Compliant':
36+
color = 'green'
37+
elif val == 'NonCompliant':
38+
color = 'red'
39+
else:
40+
color = 'black'
41+
return 'color: %s' % color
42+
43+
now = datetime.now() # current date and time
44+
date_time = now.strftime("%m-%d-%Y-%H-%M")
45+
print("date and time:",date_time)
46+
47+
# Get the file name as input from the user
48+
file_name = input("Please provide post validation json file: ")
49+
# Load the JSON data from the file
50+
with open(file_name, 'r') as f:
51+
data = json.load(f)
52+
53+
# Prepare two lists to store the data
54+
cable_validation_data = []
55+
cable_specification_validation_data = []
56+
57+
# Loop through each rack in the racks list
58+
for rack in data['racks']:
59+
# Loop through each device in the networkConfiguration list
60+
for device in rack['rackInfo']['networkConfiguration']['networkDevices']:
61+
# Loop through each interface map for the device
62+
for interface_map in device['fixedInterfaceMaps']:
63+
# Loop through each validation result for the interface map
64+
for validation_result in interface_map['validationResult']:
65+
# Append the data to the list based on validation type
66+
temp_item = [device['name'], interface_map['name'], validation_result['status'], interface_map['destinationHostname'], interface_map['destinationPort'],validation_result['validationDetails']['deviceConfiguration'], validation_result['validationDetails']['error'] , validation_result['validationDetails']['reason'],'FixedInterface']
67+
if validation_result['validationType'] == 'CableValidation':
68+
cable_validation_data.append(temp_item)
69+
elif validation_result['validationType'] == 'CableSpecificationValidation':
70+
cable_specification_validation_data.append(temp_item)
71+
72+
# Check if scaleSpecificInterfaceMaps is not None
73+
if device['scaleSpecificInterfaceMaps'] is not None:
74+
# Loop through each scaleSpecificInterface_Map for the interface map
75+
for scale_map in device['scaleSpecificInterfaceMaps']:
76+
# Loop through each interface map for the device.
77+
for interfacemaps in scale_map['InterfaceMaps']:
78+
# Loop through each validation result for the scaleSpecificInterface_Map
79+
for validation_result in interfacemaps['validationResult']:
80+
# Append the data to the list
81+
temp_item = [device['name'], interfacemaps['name'], validation_result['status'], interfacemaps['destinationHostname'], interfacemaps['destinationPort'], validation_result['validationDetails']['deviceConfiguration'], validation_result['validationDetails']['error'] , validation_result['validationDetails']['reason'], 'ScaleSpecificInterface']
82+
if validation_result['validationType'] == 'CableValidation':
83+
cable_validation_data.append(temp_item)
84+
elif validation_result['validationType'] == 'CableSpecificationValidation':
85+
cable_specification_validation_data.append(temp_item)
86+
87+
# Convert the lists to DataFrames
88+
cable_validation_df = pd.DataFrame(cable_validation_data, columns=['Device Name', 'Interface Map Name', 'Status', 'Destination Hostname', 'Destination Port', 'Device Configuration', 'Error', 'Reason', 'Interface Type'])
89+
cable_specification_validation_df = pd.DataFrame(cable_specification_validation_data, columns=['Device Name', 'Interface Map Name', 'Status', 'Destination Hostname', 'Destination Port', 'Device Configuration', 'Error', 'Reason', 'Interface Type'])
90+
91+
# Group the DataFrames by 'Status' and append each group's HTML representation to a string
92+
#html_string = '<html><head><style>table {border-collapse: collapse;} th, td {border: 1px solid black; padding: 5px;}</style></head><body>'
93+
html_string = """
94+
<html>
95+
<head>
96+
<style>
97+
body {
98+
font-family: Arial, sans-serif;
99+
max-width: 960px; /* Set the maximum width of the page */
100+
margin: 0 auto; /* Center the page */
101+
}
102+
h2 {color: #2A2A2A;}
103+
table {border-collapse: collapse; width: 100%;}
104+
th, td {border: 1px solid #ddd; padding: 8px;}
105+
tr:nth-child(even) {background-color: #f2f2f2;}
106+
th {padding-top: 12px; padding-bottom: 12px; text-align: left; background-color: #4CAF50; color: white;}
107+
</style>
108+
</head>
109+
<body>
110+
"""
111+
for status, group_df in cable_validation_df.groupby('Status'):
112+
styled_group_df = group_df.style.applymap(color_status, subset=['Status']).set_table_attributes('class="dataframe"')
113+
html_string += f'<h2>Cable Validation - {status}</h2>'
114+
html_string += styled_group_df.to_html()
115+
116+
for status, group_df in cable_specification_validation_df.groupby('Status'):
117+
styled_group_df = group_df.style.applymap(color_status, subset=['Status']).set_table_attributes('class="dataframe"')
118+
html_string += f'<h2>Cable Specification Validation - {status}</h2>'
119+
html_string += styled_group_df.to_html()
120+
121+
html_string += '</body></html>'
122+
123+
# Write the string to an HTML file
124+
with open('CableValidationAndSpecification-{filename}.html'.format(filename = date_time), 'w') as f:
125+
f.write(html_string)
126+
```
127+
128+
## Usage
129+
To run the conversion tool, execute the following command:
130+
```
131+
python cable-html.py
132+
..
133+
Please provide post validation json file: <CABLE_VALIDATION_FILENAME>.json
134+
```
135+
136+
The report output has filename `CableValidationAndSpecification-<DATE>.html`.
137+
138+
## Cable Validation Report HTML results
139+
140+
The report is separated into the following sections:
141+
- Cable Validation - Compliant
142+
- Cable Validation - NonCompliant
143+
- Cable Validation - Unknown
144+
- Cable Specification Validation - Compliant
145+
- Cable Specification Validation - NonCompliant
146+
- Cable Specification Validation - Unknown
147+
148+
Sample report:
149+
:::image type="content" source="media\cable-validation-html.png" alt-text="Screenshot that shows the sample cable validation report." lightbox="media\cable-validation-html.png":::
73.7 KB
Loading

0 commit comments

Comments
 (0)