Creating a VMWare Distributed Switch (VDS) or Distributed Virtual Switch (DVS)
By default ESXi hosts use standard switch. We can create VM kernel ports (ESXi host IP addresses) and enable operations such as Management, vMotion, Replication, etc. on the kernel ports. The kernel ports belong to one or more portgroups which can refer to a VLAN. Standard switches are connected to physical network outside ESXi using uplink ports (ESXi NICs).
For large number of hosts where many port-groups (VLANs) are common across the hosts, it might makes sense to shift to a DVS or VDS. With VDS distributed port-group can be created which is automatically spanned across all hosts which are part of VDS. VDS is necessary before implementing NSX.
Note that removing host from VDS is tricky. Hence implement VDS only if hosts are having similar networking (Similar no. of ports with similar types of VLANs on ports) and the setup is finalized. With VDS it will not be possible to have different type of uplinks with different VLANs on uplink ports for different hosts which are part of same VDS:
To create VDS use following steps:
- Login into ESXi host as administrator
- Go to Networking Tab
- Right click on datacenter and choose Distributed switch -> new distributed switch
- Choose appropriate name, version, required no. of uplink ports, etc. Default port group may not be required.
- After DVS is created add port groups to the created Distributed switch by right clicking DVS and choosing ""Distributed port group -> new distributed port group". Before migrating hosts and VMs to DVS, it is important to configure distributed port-groups corresponding to standard switch port-groups to maintain identical networking after migrating to VDS without loosing connectivity.
- To migrate from standard switch to DVS right click DVS and choose "Add and manage hosts"
- Go with "Add and manage hosts networking (Advanced)" if you want complex operations.
- While selecting existing or new hosts, there is option to configure identical network settings using template mode. This can be achieved using checkbox given below while selecting hosts.
- In the wizard there are options to switch Uplink ports to DVS.
- Do not shift all uplink ports to DVS, if vCenter is also running on the same cluster. If vCenter is running on same cluster and all uplinks are tried to be migrated to DVS, vcenter looses connectivity to ESXi host and operation fails and roll-back is performed. Either leave vCenter host out of VDS initially, migrate vCenter and then convert final host or transfer only a few uplinks to VDS while leaving at least one uplink with standard switch.
- After uplink ports there is option to migrate VMkernel ports. Please note that it may not be easy to migrate these kernel ports back to standard switch. There is option on configure -> VMkernel adapters page of ESXi host but it has not been tested yet.
- Finally VMs can also be migrated to DVS port-groups
Backup and Restore of DVS
Backup and restore of DVS can be achieved by configuration export and import operations.
Distributed switch configuration can be exported using:
- Distributed switch -> settings -> export configuration.
Later on same configuration can be imported using:
- Network -> distributed switch -> import distributed switch.