In this post I will give you an introduction to Hyper-V virtual switch, including the basics behind it, the three types of virtual switch, System Center Virtual Machine Manager (SCVMM) logical switch. I’ll also discuss what role Hyper-V virtual switches play in networking your virtual machines.
Consider how you network a physical server:
A Hyper-V virtual switch is not that different to an access switch:
The virtual switch connects virtual machines to the rest of the physical network.
Let’s get back to the switch port being an attribute of the virtual NIC. When we do network configurations on a physical switch, such VLAN tagging, we implement those configurations on a switch port. The same happens (under the covers) with a Hyper-V switch port. A physical server rarely moves, but when it does, we have to reconfigure the new switch port. A virtual machine can move very frequently. By making the switch port an attribute of the virtual NIC, any assigned network policy moves with the virtual machine, so there is no need to re-implement network policy for the VM.
The Hyper-V virtual switch implements functionality such as QoS, VLAN tagging, bandwidth limits, and so on, even though those settings are revealed by the virtual NIC. The virtual switch also implements other advanced features such as Port ACLs.
There are three types of virtual switch that you can create in Hyper-V.
Note that any communications to and from a VM are subject to security rules that are applied, such as physical firewall (gateway) rules, Port ACLs, and so on.
If you plan on using SCVMM to deploy hosts, network, or to use Hyper-V Network Virtualization then you should use SCVMM to deploy a logical switch. This is not a cross-host shared virtual switch, but it is a logical switch in terms of unified configuration and management from the VMM console. SCVMM cannot import preexisting virtual switches; you must deploy the logical switch from SCVMM in order to take advantage of the advanced concepts that System Center can offer.
Since WS2012, the Hyper-V virtual switch has been able to add on (not replace, as with other virtualization platforms) layers of third-party functionality. There are three kinds of extension that can work with packets as they flow to/from virtual NICs through the virtual switch stack:
Note that you can add multiple extensions to a single virtual switch. Only the forwarding type has a limitation (one per switch).
The Hyper-V extensible virtual switch.
Microsoft’s software-defined networking solution, Hyper-V Network Virtualization (HNV), was added in WS2012. However, HNV was incompatible with virtual switch extensions in that version. This is no longer the case since WS2012 R2; an extension can work with VM network packets as they pass through the layers of the virtual switch.