VMware vSphere Distributed Switch (VDS) is a virtual switch that connects virtual machines to multiple hosts in a vSphere environment. It separates the management and data planes, making it easier to manage and update network configurations across multiple hosts in a data center. This guide will cover everything you need about VMware vSphere Distributed Switch.
Table of Contents
What is VMware Distributed Switch?
VMware Distributed Switch is a virtual switch as part of the networking configuration that connects virtual machines to multiple hosts in a vSphere environment. It is a centralized management tool that allows you to configure network settings for multiple hosts in a data center.
It separates the management and data planes, making it easier to manage and update network configurations across multiple hosts in a data center. The VDS configuration is stored on the vCenter Server system and can be easily backed up and restored with centralized data plane management.
With the VDS, you can create distributed ports, VMkernel network adapters, and new distributed port groups synchronized across all hosts. It makes updating network configuration extremely easy.
Requirements for vSphere Distributed Switches
Before deploying a VMware vSphere Distributed Switch (VDS), specific requirements need to be met. The requirements for VDS include the following:
- Licensing — You need VMware vSphere Enterprise Plus for the VDS feature.
- VMware vCenter Server — You must have VMware vCenter Server installed, using at least vCenter Server 5.0. All management plane operations happen with vCenter Server, so it is a requirement.
- vSphere Distributed Switch compatible ESXi hosts — The VMware ESXi hosts must be at a compatible level with your installed vCenter Server version to correctly operate.
- Sufficient physical network adapters — The vSphere Distributed Switch requires physical adapters in the ESXi host to back the distributed switch. You have to have a minimum of one adapter, but having at least two are recommended, and the best practice.
- vCenter Server system resources — This is generally not a problem with modern vCenter Server Appliance configurations, but you will want to ensure you have sufficient resources on the vCenter Server system
Once you have ensured that your environment meets the requirements for vSphere Distributed Switches, you can deploy the distributed switch and begin configuring the network settings for your virtual machines.
Referer. Learn how to share a disk between multiple VMs on VMWare ESXi.
Let’s look first at the general principles and concepts of virtual switches in VMware vSphere.
Virtual Switches in vSphere
The virtual switch in VMware vSphere provides connectivity to VMs. The vSphere switches are crucial in connecting VMs to the physical network (physical switch) and allowing virtual machines to communicate between themselves and physical servers.
By default, the vSphere Standard Switch (VSS) is created when you install ESXi on your physical ESXi host. When the VSS is created, you will see a default virtual switch created.
The standard virtual switches (VSS) are created on each ESXi host, and each virtual machine is connected to a default port group on the VSS. The VSS can provide network connectivity and virtual networks to virtual machines within a single host, but it cannot connect to virtual machines across multiple hosts.
When you install ESXi for the first time, a single virtual switch is created vSwitch0, a vSphere standard switch, is created with a default port group networking configuration that also handles the management VMkernel adapter for host networking. This VM network is the start for vSphere networking out of the box. With vSphere Standard Switch, you can still do NIC teaming, network label configuration, VMkernel adapters, and other configurations.
Below is a view of the default vSphere Standard Switch:
Compared to the vSphere Standard Switch, the VMware vSphere Distributed Switch separates the management and data planes and provides centralized management for network configurations across multiple hosts.
With the vSphere Distributed Switch, you get advanced networking features such as traffic shaping, port mirroring, link aggregation control protocol (LACP), and network I/O control.
Similar to vSphere Standard Switch, you can create new vSphere Distributed Switch configurations and distributed port groups across multiple ESXi hosts.
Distributed Port Groups and Port Allocation
A distributed port group is a logical switch that provides network connectivity to virtual machines on the VMware vSphere Distributed Switch. The VDS port group is a set of ports with the same network configuration, such as VLAN, security policy, and traffic shaping.
Connecting a VM to a VDS switch automatically assigns a port on the switch to the virtual machine. The port is allocated dynamically, and the VDS can adjust the port allocation based on the traffic load. The VDS also supports port binding, which allows you to bind a virtual machine to a specific physical network adapter on the ESXi host.
Below is starting the wizard to create a new distributed port group and viewing the options available.
Static and Ephemeral port binding
A vSphere Distributed Switch creates an uplink port group or dvuplink port group defined when the distributed switch is created. The uplink is a template used to configure the physical connections of the hosts as well as uplinks for failover purposes or load balancing.
You can also define the discovery protocol, such as the choice between using Cisco Discovery Protocol and Link Layer Discovery Protocol.
Uplink Port Groups and Link Aggregation Control Protocol
One of the cool features of the vSphere Distributed Switch is the ability to configure link aggregation control protocol (LACP), which allows you to combine multiple physical network adapters into a single logical link. It provides increased bandwidth and redundancy.
When a virtual machine sends traffic to the physical network, the traffic is forwarded to the uplink port group, which forwards the traffic to the physical network adapter on the ESXi host. The uplink port group also supports inbound traffic shaping, allowing you to shape the incoming network traffic to ensure the virtual machine receives the necessary bandwidth.
Managing VMware vSphere Distributed Switch
VMware vSphere Distributed Switch provides centralized management for network configurations across multiple hosts in a vSphere environment. The VDS configuration is stored on the vCenter Server system and can be easily backed up and restored.
You can use network configuration templates to apply network settings to multiple hosts, which saves time and ensures consistency across the data center.
To manage hosts in a VDS, you must first add the hosts to the switch. You can add hosts individually or in groups. After adding hosts, you can create new distributed port groups or configure settings for existing ones.
You can also manage physical adapters on the ESXi host, configure load balancing and failover policies for uplink port groups, and configure advanced networking features such as traffic shaping and port mirroring.
In addition to managing the VDS through the vCenter Server system, you can also use the host proxy switch to manage hosts directly from the ESXi host. The host proxy switch is a local switch that mirrors the configuration of the VDS and allows you to manage the host without connecting to the vCenter Server system.
This is useful when the vCenter Server system is unavailable or when you need to make changes quickly without going through the vCenter Server system.
Migrate VM Networking from vSphere Standard Switch to Distributed Switch
If you have an existing vSphere environment with virtual machines connected to a vSphere Standard Switch (VSS), you can migrate the virtual machines to a VDS without losing network connectivity. You can use the vSphere Web Client to migrate virtual machines from a VSS to a VDS.
To migrate virtual machines to a VDS, you must first create a new distributed switch, configure the necessary port groups, and uplink port groups. You can then use the vSphere Web Client to migrate the virtual machines to the new distributed switch. During the migration, the virtual machines remain powered on and retain their IP addresses and network settings.
Advanced Networking Features
VMware vSphere Distributed Switch supports advanced networking features unavailable on vSphere Standard Switches. These features include traffic shaping, port mirroring, link aggregation control protocol, and load balancing configuration.
Traffic shaping allows you to shape the network traffic to ensure virtual machines receive the necessary bandwidth. Port mirroring allows you to mirror the network traffic from one or more ports on the VDS to a destination port for monitoring purposes.
Link aggregation control protocol (LACP) allows you to bundle multiple physical network adapters into a single logical link for increased bandwidth and redundancy. Load balancing configuration allows you to configure the load balancing policy for uplink port groups to ensure that network traffic is evenly distributed across the physical network adapters.
Network I/O Control
Network I/O Control with vSphere Distributed Switches is a great way to reserve or allocate bandwidth and network resources for specific types of services.
With VDS NIOC, you can prioritize network traffic and allocate resources to virtual machines based on their traffic type. It helps to control traffic and prevent congestion by allocating bandwidth to specific virtual machines or traffic types.
MSPs and others managing multiple tenants can leverage NIOC, where multiple virtual machines compete for network resources. You can guarantee a minimum bandwidth for each virtual machine or traffic type, ensuring critical applications receive the necessary network resources.
Concept of resource sharing
NIOC is based on network resource pools, which are logical entities that define the network resources available to a group of virtual machines or traffic types. You can create network resource pools for different traffic types, such as virtual machine traffic, vMotion traffic, or iSCSI traffic, and assign them to different priority levels and shares. You can also set reservations and limits to control the minimum and maximum network resources allocated to each network resource pool.
Monitoring and reporting
NIOC also provides a monitoring and reporting tool to monitor network traffic and utilization in real time. This tool can identify network bottlenecks and adjust network resource pools to optimize network performance.
To configure NIOC in a vSphere Distributed Switch, you must first enable the feature and create network resource pools.
You can then configure each network resource pool’s priority, shares, reservations, and limits. You can also use the monitoring and reporting tool to track network usage and performance and make adjustments as necessary.
Prioritize network traffic
NIOC is an important VMware vSphere Distributed Switch feature that allows you to prioritize network traffic and allocate resources to virtual machines based on their traffic type.
By using NIOC in conjunction with other advanced networking features such as traffic shaping, port mirroring, and link aggregation control protocol, you can create a highly optimized and efficient virtual machine networking environment in your vSphere environment.
Creating a vSphere Distributed Switch VDS
Creating a vSphere Distributed Switch is fairly straightforward and can be done using the simple wizardized process in the vSphere client interface.
Navigate in the vSphere Client to the Network view. Right-click you vSphere datacenter and choose Distributed Switch > New Distributed Switch.
Adding ESXi hosts to the new vSphere Distributed Switch
Unlike the process to create and configure ESXi hosts for vSphere Standard Switches, you create the switch on your vCenter Server. Then, your ESXi hosts are added to the vSphere Distributed Switch. Let’s look at that process. It is a simple wizard in the vSphere client.
Click Add hosts.
Select the hosts you want to add to the vSphere Distributed Switch.
Assign uplinks for the vSphere Distributed Switch.
Assign the port group.
Migrate VM networking if needed.
Complete the wizard.
Enable backup and restore of distributed switches
Backing Up vSphere Distributed Switches
Backing up the configuration of your vSphere Distributed Switch (VDS) is essential for ensuring that you can recover the network settings in case of a disaster or hardware failure.
The VDS configuration includes distributed port groups, uplink port groups, traffic shaping, and other advanced networking settings. By backing up the VDS configuration, you can ensure that you can restore the network settings quickly and easily.
To back up the configuration of your VDS, you can use the vSphere Web Client or the vSphere Command-Line Interface (CLI). The backup process creates a configuration file that includes the network settings and can be used to restore the VDS configuration.
Backing Up vSphere Distributed Switches Using the vSphere Web Client
To back up the configuration of your VDS using the vSphere Web Client, follow these steps:
- Log in to the vSphere Web Client and select the vCenter Server system that manages the VDS.
- Navigate to the Networking section and select the distributed switch you want to back up.
- Right-click the distributed switch and select “Export Configuration.”
- In the Export Configuration dialog box, create a description for the backup. You can also select if you want to backup the distributed switch and all port groups, or only back up the distributed switch.
- Click “OK” to start the backup process.
Backing Up vSphere Distributed Switches Using the vSphere Command-Line Interface
To back up the configuration of your VDS using the vSphere Command-Line Interface (CLI), follow these steps:
- Log in to the vSphere CLI and navigate to the bin directory.
- Enter the following command to back up the configuration of the VDS:
vicfg-cfgbackup --server <vcenter server address> --username username --password password --export vds_backup_file
Replace “vcenter server address” with the IP address of the vCenter Server, username with your vCenter Server username, password with your vCenter Server password, and vds_backup_file with the name of the backup file.
- Press Enter to start the backup process.
Restoring vSphere Distributed Switches
Restoring your vSphere Distributed Switch configuration from a backup file, you can use the vSphere Web Client or the vSphere Command-Line Interface. The restore process overwrites the existing VDS configuration with the backup file.
Note. Check our tutorial on how to convert thick provision lazy zeroed disk to thin on VMware ESXi.
Restoring vSphere Distributed Switches Using the vSphere Web Client
To restore the configuration of your VDS using the vSphere Web Client, follow these steps:
- Log in to the vSphere Web Client and select the vCenter Server system that manages the VDS.
- Navigate to the Networking section and select the distributed switch you want to restore.
- Right-click the distributed switch and select “Restore Configuration.”
- In the Restore Configuration dialog box, select the backup file location and provide the name of the backup file. You can also decide if you want to restore the distributed switch and all port groups or only restore distributed switch.
- Click “OK” to start the restore process.
Restoring vSphere Distributed Switches Using the vSphere Command-Line Interface
To restore the configuration of your VDS using the vSphere Command-Line Interface (CLI), follow these steps:
- Log in to the vSphere CLI and navigate to the bin directory.
- Enter the following command to restore the configuration of the VDS:
vicfg-cfgbackup --server vCenter_Server_IP_address --username username --password password --import vds_backup_file --merge
Replace vCenter_Server_IP_address with the IP address of the vCenter Server, username with your vCenter Server username, password with your vCenter Server password, and vds_backup_file with the name of the backup file.
- Press Enter to start the restore process.
Wrapping Up
VMware vSphere Distributed Switches are a very powerful type of virtual switch that allows VIadmins to manage the host’s networking efficiently and at scale. It allows adding and managing multiple ESXi hosts and the virtual networks they have configured.
The vSphere Distributed Switch can be backed up and restored using the vSphere Client interface. Backup and restore can also be carried out using the command line.
The advanced networking features offered by the VDS are also compelling. It allows a much more robust solution to manipulate networking traffic, performance, and quality of service between virtual resources.