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:

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"


Symptoms:
  • 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.


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.
======================================================================


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 "Connectee" column.

When no VM is listed:

If no VM is listed in the "Connectee" 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.
image.png

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