"Cannot allocate multiple primary IP addresses for NSX-T Edge Gateway xxxx (com.vmware.vcloud.entity.gateway:xxx)" error when changing the primary IP of an edge gateway in the VMware Cloud Director UI.
search cancel

"Cannot allocate multiple primary IP addresses for NSX-T Edge Gateway xxxx (com.vmware.vcloud.entity.gateway:xxx)" error when changing the primary IP of an edge gateway in the VMware Cloud Director UI.

book

Article ID: 320460

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:
  • "Cannot allocate multiple primary IP addresses for NSX-T Edge Gateway xxxx (com.vmware.vcloud.entity.gateway:xxx)" error when changing the primary IP of an edge gateway in the VMware Cloud Director UI.
  • Unable to modify an NSX-T Edge Gateway primary IP address in the VMware Cloud Director UI.
     


Environment

VMware Cloud Director 10.x

Resolution

This is a known issue affecting VMware Cloud Director 10.4.2 and lower versions.
This issue is resolved in 10.4.3, 10.5 and later versions of VMware Cloud Director, available at VMware By Broadcom Downloads.

For a workaround, please use the workaround specified in the Workaround section.

Workaround:

NOTE: The workaround below focuses on a traditional REST client solution, alternatively you can also use the Cloud Director API Explorer to perform the workaround.

The workaround for this issue is to manually edit the primary IP of the edge gateway using the Cloud Director API.

  1. Log into the Cloud Director API as a System Administrator:
  2. Request:
    POST https://CloudDirectorExample.com/cloudapi/1.0.0/edgeGateways/{gatewayID}

    Request Headers:
    Accept:application/json;version=37.2
    Authorization:Basic (Encoded username@system / password)

        
    NOTE: the API version in the Accept header is based on the Cloud Director version.
  1. Copy the value of the response header X-VMWARE-VCLOUD-ACCESS-TOKEN which is our login Bearer token used for further requests.

           Response Headers:
           X-VMWARE-VCLOUD-ACCESS-TOKEN:eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbml...bY1pTknnRprwEg
 

  1. Update the gateway primary IP address as highlighted below, and execute the API call to update the edge gateway: 

    POST https://CloudDirectorExample.com/cloudapi/1.0.0/edgeGateways/{gatewayID}

    Request Headers:       
    Accept:application/json;version=37.2
    Authorization:Bearer ...
    Content-Type:application/json

{
  "status": "REALIZED",
  "id": "urn:vcloud:gateway:xxxx",
  "name": "SestakTest",
  "description": "",
  "edgeGatewayUplinks": [
    {
      "uplinkId": "urn:vcloud:network:xxxx",
      "uplinkName": "xxxx",
      "subnets": {
        "values": [
          {
            "gateway": "xx.xxx.xx.xx",
            "prefixLength": 29,
            "dnsSuffix": null,pri
            "dnsServer1": "",
            "dnsServer2": "",
            "ipRanges": {
              "values": []
            },
            "enabled": true,
            "totalIpCount": 0,
            "usedIpCount": null,
            "primaryIp": null,
            "autoAllocateIpRanges": false
          },
          {
            "gateway": "xx.xxx.xx.xx",
            "prefixLength": 29,
            "dnsSuffix": null,
            "dnsServer1": "",
            "dnsServer2": "",
            "ipRanges": {
              "values": []
            },
            "enabled": true,
            "totalIpCount": 0,
            "usedIpCount": null,
            "primaryIp": null,
            "autoAllocateIpRanges": false
          },
          {
            "gateway": "xxx.xxx.xx.xx",
            "prefixLength": 30,
            "dnsSuffix": null,
            "dnsServer1": "",
            "dnsServer2": "",
            "ipRanges": {
              "values": []
            },
            "enabled": true,
            "totalIpCount": 0,
            "usedIpCount": null,
            "primaryIp": null,
            "autoAllocateIpRanges": false
          },
          {
            "gateway": "xxx.xxx.xx.xx",
            "prefixLength": 24,
            "dnsSuffix": null,
            "dnsServer1": "",
            "dnsServer2": "",
            "ipRanges": {
              "values": [
                {
                  "startAddress": "xxx.xxx.xx.xx",
                  "endAddress": "xxx.xxx.xx.xx"
                }
              ]
            },
            "enabled": true,
            "totalIpCount": 2,
            "usedIpCount": null,
            "primaryIp": "xxx.xxx.xx.xx",
            "autoAllocateIpRanges": false
          },
          {
            "gateway": "xxx.xxx.xx.xx",
            "prefixLength": 64,
            "dnsSuffix": null,
            "dnsServer1": "",
            "dnsServer2": "",
            "ipRanges": {
              "values": []
            },
            "enabled": true,
            "totalIpCount": 0,
            "usedIpCount": null,
            "primaryIp": null,
            "autoAllocateIpRanges": false
          },
          {
            "gateway": "xxx.xxx.xx.xx",
            "prefixLength": 29,
            "dnsSuffix": null,
            "dnsServer1": "",
            "dnsServer2": "",
            "ipRanges": {
              "values": []
            },
            "enabled": true,
            "totalIpCount": 0,
            "usedIpCount": null,
            "primaryIp": null,
            "autoAllocateIpRanges": false
          }
        ]
      },
      "connected": true,
      "quickAddAllocatedIpCount": null,
      "dedicated": false,
      "usingIpSpace": false,
      "vrfLiteBacked": false,
      "backingType": "NSXT_TIER0"
    }
  ],
  "distributedRoutingEnabled": true,
  "nonDistributedRoutingEnabled": false,
  "orgVdcNetworkCount": 0,
  "gatewayBacking": {
    "backingId": "xxxx,
    "gatewayType": "NSXT_BACKED",
    "networkProvider": {
      "name": "T-NSXM",
      "id": "urn:vcloud:nsxtmanager:xxxx"
    }
  },
  "orgVdc": {
    "name": "xxxx",
    "id": "urn:vcloud:vdc:xxxx"
  },
  "ownerRef": {
    "name": "xxxx",
    "id": "urn:vcloud:vdc:xxxx"
  },
  "orgRef": {
    "name": "xxxx",
    "id": "urn:vcloud:org:xxxx"
  },
  "serviceNetworkDefinition": "xxx.xxx.xxx.xxx/27",
  "distributedRouterUplinkNetworkDefinition": null,
  "edgeClusterConfig": {
    "primaryEdgeCluster": {
      "edgeClusterRef": {
        "name": "xxxx",
        "id": "urn:vcloud:edgeCluster:xxxx"
      },
      "backingId": "xxxx"
    },
    "secondaryEdgeCluster": null
  }
}

  1. The primary IP address of the edge gateway should be successfully be updated in the VMware Cloud Director UI.