8 min read

(For more resources related to this topic, see here.)

Working with vSphere Distributed Switches

A vSphere Distributed Switch (vDS) is similar to a standard switch, but vDS spans across multiple hosts instead of creating an individual switch on each host. The vDS is created at the vCenter level, and the configuration is stored in the vCenter database. A cached copy of the vDS configuration is also stored on each host in case of a vCenter outage.

Getting ready

Log in to the vCenter Server using the vSphere Web Client.

How to do it…

In this section, you will learn how to create a vDS, dvportgroup, and manage the ESXi host using the vDS.

First, we will create a vSphere Distributed Switch. The steps involved in creating a vDS are as follows:

  1. Select the datacenter on which the vDS has to be created.
  2. Navigate to Actions | New Distributed Switch…., as shown in the following screenshot

  3. Enter the Name and location for the vDS and click on Next.
  4. Select the version for the vDS, as shown in the following screenshot, and click on Next:

  5. In the Edit settings page, provide the following details:
    • Number of uplinks: This specifies the number of physical NIC of the host which would be part of the vDS.
    • Network I/O Control: This option controls the input/output to the network and can be set to either Enabled or Disabled.
    • Default port group: This option lets you create a default port group. To create one, enable the checkbox and provide the Port group name.
    • Click on Next when finished.

  6. In the Ready to complete screen, review the settings and click on Finish.

The following steps will create a new distributed port group:

  1. The next step after creating a vDS is to create a new port group if it is not been created as part of the vDS. Select the vDS and click on Actions | New Distributed Port Group.
  2. Provide the name and select the location for the port group and click on Next.
  3. In the Configure settings screen, set the following general properties for the port group:
    • Port binding: This provides us with three options, namely, Static, Dynamic, and Ephemeral (no binding).
      • Static binding: This is selected when a VM is connected to the port group where a port is assigned and reserved for the VM. Only when the VM is deleted, the port is freed up.
      • Ephemeral binding: This port is created and assigned to the VM by the host when a VM is powered on and the port is deleted when the VM is powered off.
      • Dynamic binding: This is depreciated in ESXi 5.x version and is no longer in use, but the option is still available in the vSphere Client.
    • Port allocation: This can be set to either Elastic or Fixed.
      • Elastic: The default port is 8, and when all ports are used, a new set of ports is created automatically
      • Fixed: The ports are fixed to 8, and no additional ports are created when all ports are used up
    • Number of ports: This option is set to 8 by default.
    • Network resource pool: This option is enabled only if a user-defined network pool is created; it can be set even after creating the port group.
    • VLAN type: The available options are None, VLAN, VLAN trunking, and Private VLAN.
      • None: This means that no VLAN is used
      • VLAN: This implies that VLAN is used and the ID has to be specified
      • VLAN trunking: This implies that a group of VLANs is being trunked and their respective ID have to be used
      • Private VLAN: This menu is empty if a private VLAN does not exist

  4. In the Ready to complete screen, review the settings and click on Finish.

The next step after creating a distributed port group is to add the ESXi host to the vDS. While the host is being added, it is possible to migrate the VMkernel and VM port group from the vSS to vDS, or it can be done later. Now, let’s see the steps involved:

  1. Select the Distributed Switch in the vSphere Web Client.
  2. Navigate to Actions | Add and Manage Hosts.
  3. In the Select task screen, select Add hosts, as shown in the following screenshot, and click on Next:

  4. Click on the + icon to select hosts to be added and click on OK.

  5. Click on Next in the Select new hosts screen.
  6. Select the physical network adapters, which will be used as an uplink for the vDS, and click on Next.
  7. In the Select virtual network adapters screen, you will have the option to migrate the VMkernel interface to the vDS group; select the appropriate option and click on Next.
  8. Review any dependencies on the validation page and click on Next.
  9. Optionally, you can migrate the VM Network to the vDS port group in the Select VM network adapters screen by selecting the appropriate option and clicking on Next.
  10. In the Ready to complete screen, review the settings and click on Finish.

An ESXi host can be removed from the vDS only if there is no VM still connected to the vDS. Make sure the VMs are either migrated to the standard switch or to another vDS. The following steps will remove an ESXi host from the Distributed Switch:

  1. Browse to the Distributed Switch in the vSphere Web Client.
  2. Navigate to Actions | Add and Manage Hosts.
  3. In the Select task screen, select Remove hosts, as shown in the following screenshot, and click on Next:

  4. Click on the + icon to select new hosts to be removed and click on OK.

  5. Click on Next in the Select hosts screen.
  6. In the Ready to complete screen, review the settings and click on Finish.

When the entire host is being added to the vDS, you can start to migrate the resources from vSS to vDS. The following steps will help you migrate from a Standard to a Distributed Switch:

  1. Select the Distributed Switch in the vSphere Web Client.
  2. Navigate to Actions | Migrate VM to Another Network.
  3. In the Select source and destination networks screen, you have the option to browse to a specific network or no network for source network migration. These options are described as follows:
    • Specific network: This option allows you to select the VMs residing on a particular port group
    • No network: This option implies that VMs that are not connected to any network will be selected for migration

  4. In the Destination network option, browse and select the distributed port group for the VM network and click on Next.

  5. Select the VM to migrate and click on Next.
  6. In the Ready to complete screen, review the settings and click on Finish.

How it works…

vSphere Distributed Switches extend the capabilities of virtual networking. vDS can be broken into the following two logical sections; one is the data plane and the other is management plane:

  • Data plane: This is also called the I/O plane and it takes cares of the actual packet switching, filtering, tagging, and all networking-related activities.
  • Management plane: This is also known as the control plane. It is a centralized control to manage and configure the data plane functionality.

There’s more…

It is possible to preserve the vSphere Distributed Switch configuration information to a file. You can use these configurations for other deployments and also as a backup. You can restore the port group configuration in case of any misconfiguration.

The following steps will export the vSphere Distributed Switch configuration:

  1. Select the vSphere Distributed Switch from the vSphere Web Client.
  2. Navigate to Actions | All vCenter Actions | Export Configurations.
  3. In Configuration to export, you will have the following two options. Select the appropriate one.
    • Distributed Switch and all port groups
    • Distributed Switch only
  4. Click on OK.
  5. Exporting would begin, and once done, it would ask for saving the configuration. Click on Yes and provide the path to store the file.

The import configuration function can be used to create a copy of the exported vDS from the existing configuration file. The following steps will import the vSphere Distributed Switch configuration file:

  1. Select the Distributed Switch from the vSphere Web Client.
  2. Navigate to Actions | All vCenter Actions | Import distributed port group.
  3. In the Import Port Group Configuration option, browse to the backup file and click on Next.
  4. Review the import settings and click on Finish.

The following steps will restore the vSphere distributed port group configuration:

  1. Select the distributed port group from the vSphere Web Client.
  2. Navigate to Actions | All vCenter Actions | Restore Configuration.
  3. Select one of the following options and click on OK:
    • Restore to a previous configuration: This allows you to restore the configuration of the port group to your previous snapshot
    • Restore configuration from a file: This allows you to restore to the configuration from the file saved on your local system
  4. In the Ready to complete screen, review the settings and click on Finish.

Summary

In this article, we understood the vSphere networking concepts and how to work with vSphere distributed switches. We also discussed some of the more advanced networking configurations available in the distributed switch.

Resources for Article:


Further resources on this subject:


LEAVE A REPLY

Please enter your comment!
Please enter your name here