Creating Converged Networks Using Virtual NICs
In this article we will discuss how you can use a previously created QoS-enabled virtual switch to implement converged networks using virtual NICs in the management OS of a Hyper-V host.
Creating Converged Networks: Prerequisites
You must have the following requirements in place to make a converged network with a virtual NIC.
- Windows Server 2012 (WS2012) or Windows Server 2012 R2 (WS2012 R2) Hyper-V deployed on the host.
- A virtual switch with MinimumBandwidthMode enabled.
See our previous post, “Creating a NIC Team and Virtual Switch for Converged Networks,” to learn how to configure the virtual switch.
Choosing a QoS Mode
You have two options for how you implement QoS minimum bandwidth rules:
Weight: Each virtual NIC (actually a virtual switch port that moves with the virtual machine) is assigned a share of the available bandwidth. This option is flexible and preferred.
Absolute: Each virtual NIC is assigned a specific amount of bandwidth, specified in bits per second. This is the least preferred and least flexible option.
Creating and Configuring Management OS Virtual NICs
A clustered Hyper-V host with converged networking using virtual NICs.
This host uses four management OS virtual NICs for the four required host networks:
- Cluster communications
- Live Migration (and the 2nd private cluster network)
You can create a management OS virtual NIC using PowerShell. The following example will create a virtual NIC called Management that will appear in the host’s operating system (Control Panel > Network Connections) as a Hyper-V Virtual Network Adapter called vEthernet (Management). This virtual NIC will have its own IP address and communicate through the virtual switch (ConvergedNetSwitch) just like a virtual machine does, but on behalf of the host instead of on behalf of a virtual machine. It effectively works just like a physical NIC but with a smaller infrastructure cost.
Add-VMNetworkAdapter -ManagementOS -Name "Management" -SwitchName "ConvergedNetSwitch"
You now can configure the minimum amount of virtual switch bandwidth that the virtual NIC will be guaranteed (if required by the virtual NIC). This example sets a minimum bandwidth weight of 10.
Set-VMNetworkAdapter -ManagementOS -Name "Management" -MinimumBandwidthWeight 10
Strictly speaking, this is not 10%. It is a share of the total weight assigned. Microsoft recommends never assigning a total weight (sum of all virtual NICs and the virtual switch default bucket) of more than 100. A good practice is to assign a total weight of 100; therefore the weight of 10 would actually be 10% (10/100).
You can then rerun these cmdlets to create the remaining virtual NICs in the management OS and assign QoS rules:
#Create and configure the Cluster network Add-VMNetworkAdapter -ManagementOS -Name "Cluster" -SwitchName "ConvergedNetSwitch" Set-VMNetworkAdapter -ManagementOS -Name "Cluster" -MinimumBandwidthWeight 10 #Create and configure the Live Migration network Add-VMNetworkAdapter -ManagementOS -Name "Live Migration" -SwitchName "ConvergedNetSwitch" Set-VMNetworkAdapter -ManagementOS -Name "Live Migration" -MinimumBandwidthWeight 20 #Create and configure the Backup network Add-VMNetworkAdapter -ManagementOS -Name "Backup" -SwitchName "ConvergedNetSwitch" Set-VMNetworkAdapter -ManagementOS -Name "Backup" -MinimumBandwidthWeight 10
In this example, the default QoS bucket in the virtual switch has a weight of 50, and this means we have a total weight of 100. We won’t assign QoS rules to the virtual NICs of virtual machines, so the virtual machines will contend for the 50% assigned to the virtual switch’s bucket.
You can add further cmdlets to assign IP configurations, configure DNS, and so on. Here’s how you could assign the IP configuration for the Management virtual NIC:
# Configure the Management vNIC with an IP address New-NetIPAddress -InterfaceAlias "vEthernet (Management)" -IPAddress 10.1.1.101 -PrefixLength 24 -DefaultGateway 192.168.1.1 # Configure the DNS address of the Management vNIC Set-DnsClientServerAddress -InterfaceAlias "vEthernet (Management)" -ServerAddresses "10.0.1.21"
Assuming that you have trunked the physical switch ports to which the virtual switch is connected, you could also bind each management OS virtual NIC to a VLAN:
Get-VMNetworkAdapter -ManagementOS "Management" | Set-VMNetworkAdapterVlan -Access -VlanId 101
A good practice will be to place each line of PowerShell into a single .PS1 script and run it on each new host, changing just the IP addresses as required. This will not only give you consistent results, but it will also save you time whether you’re working in a large data center or you’re a consultant moving from one customer site to another.
More in Hyper-V
How to Install Hyper-V on Windows Server Core
Mar 16, 2022 | Michael Reinders
Microsoft Says There Will Be No Hyper-V Server 2022 Free Edition
Dec 13, 2021 | Michael Reinders
How to Stop an Unresponsive Hyper-V Virtual Machine
Jun 29, 2021 | Russell Smith
How to Enable Nested Virtualization in Hyper-V
Jun 28, 2021 | Russell Smith
Disaster Recovery with Azure Backup for SQL Server VMs
May 28, 2019 | Michael Otey
Leveraging Virtualization for Improved Availability and Disaster Recovery
Apr 29, 2019 | Michael Otey
Most popular on petri