ESXi hosts showing out of sync with distributed switch
search cancel

ESXi hosts showing out of sync with distributed switch

book

Article ID: 317923

calendar_today

Updated On: 03-27-2025

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article contains steps to resolve dvPort conflicts between ESXi and vCenter when the "Out of Sync" error is because of a VM.

If the below KB does not apply, see The vSphere Distributed Switch configuration on some hosts differed from that of VMware vCenter- "Out of Sync"

You see the following in vCenter:

  • One or more ESXi hosts connected to a vDS show as being out of sync with vCenter:
  • In vCenter > Networking > vDS > Summary, you see the warning: 

The vSphere Distributed Switch configuration on some hosts differed from that of the vCenter Server.

Environment

vSphere ESXi 6.x
vSphere ESXi 7.x
vSphere ESXi 8.x
vSphere vCenter Server 6.x
vSphere vCenter Server 7.x
vSphere vCenter Server 8.x

Resolution

=========================================================================================================================================================================================================================================================================
NOTE: For a VCF Environment: The safest way to resolve the out-of-sync error would be to remove the host, decommission and recommission using the built-in VCF workflows. The workarounds mentioned below could result in an undesired results for that ESXi host between the SDDC manager, vCenter and NSX inventories.
=========================================================================================================================================================================================================================================================================

In a situation where it is confirmed no SDDC, vSAN or NSX, in order to decommission and recommission the ESXi host, the following steps can be applied: 

 

1. Place host in maintenance mode to evacuate VMs.

2. Right-click host > Connection > Disconnect the host.

3. Right-click and remove host from inventory.

4. Right-click cluster > Add host > Re-add host to cluster.

5. Add host back to DVS. Right-click DVS > Add Manage hosts > Add host -> Add uplinks in the same order they were removed. 

6. Take host out of maintenance mode.

 

Detailed Steps to decommission and recommission the ESXi host:

 

Step 1: Enter Maintenance Mode
Location: vCenter UI

  1. Log into vCenter Server.
  2. Right-click the ESXi Host → Maintenance Mode → Enter Maintenance Mode.
  3. Ensure all VMs migrate or are powered off.

Step 2: Identify the Physical NIC Used by vmk0 (Management Network) Using esxtop
Location: ESXi SSH session

  1. SSH into the ESXi host.
  2. Run the command:
    esxtop  
    
  3. Press n to switch to the Networking view.
  4. Locate the row corresponding to vmk0 (Management Network).
  5. Note which physical NIC (vmnicX) is used for vmk0.
  6. Record this NIC information before proceeding.

Step 3: Create Temporary Standard Switch (VSS) on ESXi Host
Location: vCenter UI → Host → Configure → Networking → Virtual Switches

  1. Click Add Networking.
  2. Select Virtual Machine Port Group for Standard Switch.
  3. Choose New Standard Switch.
  4. Assign the same physical NIC that was identified in Step 2.
  5. Name the switch Temp_vSS_Mgmt and set the correct VLAN ID.
  6. Complete the process.

Step 4: Annotate and Document Existing VMkernel VLANs
Location: vCenter UI → Host → Configure → Networking → VMkernel Adapters

  1. Review all VMkernel adapters (vmk0, vmk1, vmk2, etc.).
  2. Document the following for each:
    • VLAN IDs
    • Current VDS Port Group Name
    • IP Address, Subnet Mask, Gateway
    • Purpose (Management, vMotion, vSAN, Replication, etc.)

Step 5: Migrate Management VMkernel (vmk0) from VDS to VSS
Location: vCenter UI → Host → Configure → Networking → VMkernel Adapters

  1. Select vmk0Migrate Networking.
  2. Choose the Temp_vSS_Mgmt standard switch port group.
  3. Complete migration.
  4. Verify Management Connectivity by running a ping test or SSH into the host.

Step 6: Migrate Additional VMkernel Adapters (vmk1, vmk2, etc.) from VDS to VSS
Location: vCenter UI → Host → Configure → Networking → VMkernel Adapters

  1. Create additional Temporary VSS Port Groups.
    • Example: Temp_vSS_vMotion, Temp_vSS_vSAN.
  2. Assign the correct VLANs based on documentation from Step 4.
  3. Select each additional VMkernel (vmk1, vmk2, etc.).
  4. Click Migrate Networking and choose the respective VSS Port Group.
  5. Validate each migration.

Step 7: Remove Physical NICs from VDS
Location: vCenter UI → Host → Configure → Networking → Virtual Switches

  1. Select the VDS.
  2. Click "..." menuManage Physical Adapters.
  3. Remove all vmnics assigned to the VDS.

Step 8: Remove ESXi Host from the Distributed Switch (VDS)
Location: vCenter UI → Host → Configure → Networking → Virtual Switches

  1. Click "..." menu on VDS.
  2. Select Remove Host from VDS.

Step 9: Remove ESXi Host from vCenter Inventory
Location: vCenter UI

  1. Right-click the Host.
  2. Click ConnectionDisconnect.
  3. Right-click again and select Remove from Inventory.

Step 10: Re-add ESXi Host to vCenter Inventory
Location: vCenter UI

  1. Right-click Cluster/DatacenterAdd Host.
  2. Follow the wizard to re-add the host.
  3. Verify connectivity.

Step 11: Rejoin ESXi Host to Distributed Switch (VDS)
Location: vCenter UI → Host → Configure → Networking → Virtual Switches

A) Add Physical NIC (vmnic) Back to VDS

  1. Click "..." menuAdd and Manage Hosts.
  2. Select Add Physical Adapters.
  3. Assign the same vmnic(s) identified in Step 2 back to the VDS.
  4. Click NextApply.

B) Migrate VMkernel Adapters (vmk0, vmk1, vmk2, etc.) Back to VDS
Location: vCenter UI → Host → Configure → Networking → VMkernel Adapters

  1. In Manage VMkernel Adapters, select vmk0 (Management).
  2. Migrate it back to the original VDS Management Port Group.
  3. Verify connectivity immediately.
  4. Repeat for vmk1, vmk2, etc., ensuring VLANs match the documentation.
  5. If migration from VSS to VDS fails in vCenter after re-adding the host to inventory, restart the management services on the host:
    • SSH into the ESXi host.
    • Run:
      services.sh restart  
      
    • Wait a few minutes, then attempt the migration again.

Step 12: Delete Temporary Standard Switch (VSS) (Optional)
Location: vCenter UI → Host → Configure → Networking → Virtual Switches

  1. Select Temp_vSS.
  2. Click Delete.

Step 13: Exit Maintenance Mode
Location: vCenter UI

  1. Right-click Host.
  2. Click Maintenance ModeExit Maintenance Mode.

Final Validation & Checks
Location: ESXi SSH session & vCenter UI

  • Confirm Management Network (vmk0) has correct NIC assignment using:
    esxtop  
    
  • Press n to verify vmk0 uses the correct vmnic.
  • Verify all VMkernel adapters are back on VDS.
  • Check host connectivity (ping, SSH, vMotion, vSAN, etc.).
  • Confirm no leftover configurations on the host.
  • Check for vCenter alarms.
  • Confirm host is no longer present in Out of Sync list.

 

 

Process to gather important information:

Information gathering steps are explained below: 

  1. If you click on "Show Details" next to the message above, the hosts and dvPort numbers that are out of sync are listed. 

  2. Make a note of these dvPorts/Hosts

  3. Navigate to vCenter > Networking > vDS > Ports

  4. Scroll down the "Port ID" column to find one of the dvPorts from Step #2

  5. Make a note of the portgroup listed in the "Port Group" column, there may be no VM listed in the "Connected" column.

When no VM is listed:

If no VM is listed in the "Connected" column, there are three ways to potentially resolve the issue. 

Method 1:

In most cases, the easiest way to clear this message it to remove the host from the vDS entirely. After removal, it can then be brought back in to the vDS and the message will clear. This involves a networking change, so it is recommended to do this step during a maintenance window, if possible.

  1. Move all attached virtual machines to another host or to a standard switch.

    1. A new standard switch can be built using one of the physical adapters that passes the correct VLANs from the vDS. See the note below on Load Balancing information.

  2. Move all vmkernels from the vDS to a standard switch.

    1. Again, a new standard switch can be built using one of the physical adapters that passes the correct VLANs from the vDS. See the note below on Load Balancing information.

  3. Remove any remaining physical adapters from the vDS.

  4. Remove the host from the vDS. Click Home > Networking. Right click the vDS, click Add and Manage Hosts > Remove Hosts, and follow the wizard. (Note: may need to also remove the host from inventory for some issues)

  5. Add the host back to the vDS along with its vmkernels, physical adapters, and VMs.

Note: if you need to use the same physical adapters from the current vDS on the standard switch, check the Load Balancing on the distributed switch. To do this, click Home > Networking, then click the vDS that is being cleared. Next, click the three dots next to the port group you are copying, then click View Settings > Policies and scroll down to Load Balancing. If the Load Balancing is set to IP Hash, this setting must be broken on the physical switch in order to use these physical adapters on the standard switch.

Method 2:

Using one of the ports listed in the error, follow the steps in the diagram below. Once the steps are completed, wait for several minutes, then check if the error is still present.

  • Please stay on the screen when you are running this action. 

Method 3:

  1. Create a new blank VM (no OS needed) 

  2. Edit the VM and add the VM to the PortGroup that you identified in Step #5 of the "Information Gathering Steps", click Ok

  3. SSH into the host with the blank VM

  4. Navigate to the blank VM's .vmx file

  5. Edit the .vmx file with "vi" editor

  6. Change the value of "ethernet0.dvs.portId" to the port number from Step #2 above

  7. Power the VM up

  8. Migrate the VM to the host listed in Step #2

  9. Migrate the VM back off this host

  10. Refresh the vCenter Client

When VM is listed:

If there is a VM using the dvPort in the "Connectee" column, try the following: 

  1. Create a new portgroup with identical settings (VLAN, Teaming Policy, etc) to the portgroup from Step #5

  2. Edit the VM, and put it in the new portgroup

  3. After a short wait, refresh the vSphere Client to see if the host is in sync

  4. If the host is still out of sync, migrate the VM to a different host in the cluster

  5. If the host is still out of sync, try Method #1 or #2 above now that the dvPort is unused by a VM

Note: The vMotions on/off the problematic hosts are critical.  The goal is to perform a task (related to the dvPort in conflict) that both ESXi and vCenter are aware of to force them both to re-synchronize. 

Additional Information