NSX API /api/v1/edge-clusters, may not show the "display_name" of Edge member
search cancel

NSX API /api/v1/edge-clusters, may not show the "display_name" of Edge member

book

Article ID: 324182

calendar_today

Updated On:

Products

VMware NSX Networking

Issue/Introduction

Symptoms:
  • The Edge cluster was created in an NSX-T version prior to 3.2.x. 
  • GET /api/v1/edge-clusters does not return "display_name" in the response:
"members": [
{
"member_index": 0,
"transport_node_id": "4aefdb4e-d4d3-11ec-9b82-0200ab650843"
}
  • The GET API call against another environment or another Edge cluster may return "display_name"  in the response, similar to the below example:
"members": [
{
"member_index": 0,
"transport_node_id": "4aefdb4e-d4d3-11ec-9b82-0200ab650843",
"display_name": "Edge-01"
}


Environment

VMware NSX-T Data Center

Cause

The display name on Edge Transport Node and display name on Edge cluster member are two different attributes that belongs to two different user intents.
Before NSX 3.2.x the display name for Edge cluster member wasn't correlated to Edge transport node display name. The GET /api/v1/edge-clusters would only return the display_name if it had been configured on Edge cluster at creation time or during a later API update.
 From NSX 3.2.x and 4.x, the Edge display_name is automatically populated from the Transport Node display name and returned in the body of the GET API call.

Resolution

This issue is resolved in VMware NSX-T Data Center 3.2.x and above, available at VMware Downloads.

Workaround:

NSX 3.2.x or above

If the Edge cluster was created prior to upgrading NSX-T to 3.2.x, it won't have populated the display_name by default.
An update of the Edge cluster without changing any configuration will result in display_name being populated.

1. Collect the response of the GET API call
    GET https://NSX-IP/api/v1/edge-clusters/<edge-cluster-id>
2. Use the GET response as the body for the the PUT API call
    PUT https://NSX-IP/api/v1/edge-clusters/<edge-cluster-id> 


NSX-T versions prior to 3.2.x

You can update the "display_name" by following the below steps:
 
1. Execute the below GET API call to get display name of the edge nodes:
GET https://NSX-IP/policy/api/v1/transport-nodes

"resource_type": "TransportNode",
"id": "65120c2a-4a90-11ee-af84-0050569d8fcf",
"display_name": "edge02.corp.local",
-->> This is the display_name needed for step 3

2. Execute the below GET API call to to get the current realized configuration for edge clusters:
GET https://NSX-IP/policy/api/v1/edge-clusters

{
    "results": [
        {
            "deployment_type": "VIRTUAL_MACHINE",
            "members": [
                {
                    "member_index": 0,
                    "transport_node_id": "5326e8f0-4a90-11ee-9ec8-0050569daa6e",
                },
                {
                    "member_index": 1,
                    "transport_node_id": "65120c2a-4a90-11ee-af84-0050569d8fcf",
                            }
            ],
            "cluster_profile_bindings": [
                {
                    "resource_type": "EdgeHighAvailabilityProfile",
                    "profile_id": "91bcaa06-47a1-11e4-8316-17ffc770799b",
                }
            ],
            "member_node_type": "EDGE_NODE",
...
            "resource_type": "EdgeCluster",
            "id": "28b080ae-04cf-4ae6-88b7-26fa33818178",
-->> This is the <edge-cluster-id> used for the next PUT API call.
 
3. Edit the response received on step 2 to add the "display_name" for the edge cluster member that's gathered from step 1, note the "display_name" field is missing and will be added in the PUT API, then run the below PUT API, using the cluster ID for each cluster which needs to be updated:
PUT https://NSX-IP/policy/api/v1/edge-clusters/<edge-cluster-id>
...
"transport_node_id": "5326e8f0-4a90-11ee-9ec8-0050569daa6e",
"display_name": "edge02.corp.local"
-->> new field added
...
"resource_type": "EdgeCluster",
"id": "28b080ae-04cf-4ae6-88b7-26fa33818178",
"member_index": 0,
...


Additional Information

Impact/Risks:
​​