Remove uplink from NSX database when uplink removed from DVS
search cancel

Remove uplink from NSX database when uplink removed from DVS

book

Article ID: 339205

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

Symptoms:

  • NSX manager is referencing an uplink to its port group which no longer exists.
  • The config-by-vsm.xml passed out via vsfwd and distributed to netcpad is incorrect, you see an error similar to:

    com.vmware.vcloud.dl.net.exception.NetworkInternalServerException: Cannot deploy organization VDC network (#######-####-####-####-########9c69)
    com.vmware.vcloud.fabric.nsm.error.VsmException: VSM response error (800): Error creating network vxw-dvs-XX-virtualwire-426-sid-16021-dvs.VCDVSUPLINKTEST-########-####-####-8e64 - A specified parameter was not correct: spec.uplinkTeamingPolicy.uplinkPortOrder.standbyUplinkPort; nested exception is com.vmware.vim.binding.vmodl.fault.InvalidArgument:

    invalidProperty = spec.uplinkTeamingPolicy.uplinkPortOrder.standbyUplinkPort inherited from com.vmware.vim.binding.vmodl.fault.InvalidArgument: A specified parameter was not correct: spec.uplinkTeamingPolicy.uplinkPortOrder.standbyUplinkPort.
     
  • Some of the uplinks were removed from DVS.
  • In the vCenter server you see an error similar to:
    The standbyUplinkPortName value : uplink4 is not valid in the spec.uplinkTeamingPolicy.uplinkPortOrder.standbyUplinkPort.
  • config-by-vsm.xml references all ports previously in use.

Environment

VMware NSX for vSphere 6.2.x
VMware NSX for vSphere 6.3.x
VMware NSX for vSphere 6.4.x

Resolution

  1. Run GET API call against the specific switch:

    Method: GET
    URL: https://NSX/vShieldIP/api/2.0/vdn/switches/dvs-XX

    For example:
    You see output similar to:

    <vdsContext>
    <switch>
    <objectId>dvs-XX</objectId>
    <objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
    <vsmUuid>########-####-####-####-########8D90</vsmUuid>
    <nodeId>########-####-####-####-########3e7f</nodeId>
    <revision>6</revision>
    <type>
    <typeName>VmwareDistributedVirtualSwitch</typeName>
    </type>
    < name>vds-site-a</name>
    <scope>
    <id>datacenter-21</id>
    <objectTypeName>Datacenter</objectTypeName>
    < name>Datacenter Site A</name>
    </scope>
    <clientHandle/>
    <extendedAttributes/>
    <isUniversal>false</isUniversal>
    <universalRevision>0</universalRevision>
    </switch>
    <mtu>1600</mtu>
    <teaming>FAILOVER_ORDER</teaming>
    <uplinkPortName>Uplink 4</uplinkPortName>
    <promiscuousMode>false</promiscuousMode<br></vdsContext>
  2. Run PUT REST API call using the output of previous call as the body of API call.

    https://<NSXManagerIP>/api/2.0/vdn/switches

    Modify the parameters that are to be changed such as teaming policy to some that is different from the original

    For example:

    Source MAC teaming policy:

    <vdsContext>
    <switch>
    <objectId>dvs-XX</objectId>
    <objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
    <vsmUuid>#######-####-####-####-########8D90</vsmUuid>
    <nodeId>#########-####-####-####-########3e7f</nodeId>
    <revision>6</revision>
    <type>
    <typeName>VmwareDistributedVirtualSwitch</typeName>
    </type>
    <name>vds-site-a</name>
    <scope>
    <id>datacenter-21</id>
    <objectTypeName>Datacenter</objectTypeName>
    <name>Datacenter Site A</name>
    </scope>
    <clientHandle/>
    <extendedAttributes/>
    <isUniversal>false</isUniversal>
    <universalRevision>0</universalRevision>
    </switch>
    <mtu>9000</mtu>
    <teaming>LOADBALANCE_SRCMAC</teaming>
    <uplinkPortName>Uplink 4</uplinkPortName>
    <promiscuousMode>false</promiscuousMode>
    </vdsContext>


Following is a list of valid teaming policy entries in the <teaming>Teaming_policy</teaming>line:

  • FAILOVER_ORDER
  • ETHER_CHANNEL
  • LACP_ACTIVE
  • LACP_PASSIVE
  • LOADBALANCE_LOADBASED
  • LOADBALANCE_SRCID
  • LOADBALANCE_SRCMAC
  • LACP_V2