VMware vSphere vSwitches

local and distributed vSwitches

21 July 2017   3 min read

Local and Distributed vSwitches server the same purpose as physical switches allowing for VM vNICs to be assigned to specific VLANs. In a production environment it is usual to define a local vSwitch on each ESX host for management and backdoor and have distributed vSwitches shared between hosts for VMs.

Local vSwitches

By default standalone ESX hosts use local vSwitches with port-groups to separate traffic in the same way as VLANs in the physical world. These vSwitches can be local only to the ESX host or have a physical NIC associated that is trunked to a physical switch to allow for external breakout.
Local vSwitches will allow communication between devices, however to use any of the fancier advanced features sucha as LAG or multicast need to use DvS.


Are the equivalent of separate VLANs with unique VLAN IDs.
VLAN ID 0: Disables VLAN tagging on port-group
VLAN ID 1-4094: Assign it to that specified VLAN
VLAN ID 4095: Enables trunking on port-group\

Distributed vSwitches

Are a method of centralising the management of the virtual network into single control plane. Every VMware ESX host added to the DvS inherits the configuration with those settings are stored within vCenter rather than on the ESX host itself.

DvS are a lot more feature rich than local vSwitches supporting features such as Netflow, NIC teaming, port-mirroring, ICMP snooping and traffic shaping. Its possible to have a mixture of local vSwitches, DvS and 1000v (Cisco DvS) on the same ESX host, however for interconnectivity and breakout each switch will need its own physical NIC. With the use of physical NICs you can have the same VLAN on all the different switches and hosts will be able to communicate between each other across the switches.

The process to create a DvS is as follows:

  1. Create the new DvS: Right click ESX host and choose Add Distributed switch > New Distributed Switch. Must select the ESX version for ESX Hosts and number of uplinks. The actual physical adapters will be assigned to the DvS when we add the VMware ESX hosts to the DvS in step3.
  2. Create Distributed port groups: Right click DvS and choose Add Distributed port groups. These are effectively your VLANs. Need to create these for any VLANs/ VMs that you are wanting to move onto the DvS.

The VMkernel ports (VMK) are special constructs used by the ESX host to communicate with the outside world. The goal of a VMK is to provide some sort of Layer 2 or Layer 3 services to the ESX host.

  1. Assign ESXi Hosts and uplinks to DvS: Right click DvS, Add and manage hosts » Add hosts. Select the ESX host and on the next screen Manage physical adapters and choose the physical adaptors to migrate and select Assign uplink. Make sure that you have allowed the VLANs over the trunk on the remote end (physical switch).
  2. Move VMs and/or vmk to DvS: Once complete Add and manage hosts » manage host networking » Migrate virtual machine networking. Choose a VM NIC to migrate, select Assign port group and assign a port-group off the new DvS. You shouldn’t even loose a ping when you do this.

If migrating the VMkernel port, first migrate the ESX host, physical port and a VM (in the same VLAN as the VMK) to make sure that the VLAN works fine. Once proven migrate the VMK using Add and manage hosts » manage host networking and select manage VMkernal Adaptors. When I moved over VMK I didn’t lose any pings or connectivity to the ESX host. Next I moved the vCentre and again lost no pings.