Creating Hyper-V Host Virtual NICs

In a scenario where you have multiple of your NICs in the hosts teamed, you may not want to dedicate a full gigabit network card only to Heartbeat, CSV or Live migration. With Server 2012 R2 and Hyper-V, you are able to configure virtual NICs in the host (parent) partition and allow communication between the hosts.

In my scenario, the hosts have each 11 NICs (which would be enough for the physical cluster network approach, but not that much fun). 8 of the NICS were teamed. On top of that team, Hyper-V switch called Host Virtual Switch was created and pointed to the NIC adapter:

image

On top of that Switch , the following script will create the vEthernet NICs for HeartBeat, CSV and Live Migration:

Add-VMNetworkAdapter -ManagementOS -SwitchName “Host Virtual Switch” -Name “Heartbeat”
Get-VMNetworkAdapter -ManagementOS -Name “Heartbeat” | Set-VMNetworkAdapterVlan -VlanId 10 -Access
Get-NetAdapter -Name “vEthernet (Heartbeat)” | Set-NetIPInterface -Dhcp Disabled
Get-NetAdapter -Name “vEthernet (Heartbeat)” | New-NetIPAddress -IPAddress 192.168.10.1 -PrefixLength 24

Add-VMNetworkAdapter -ManagementOS -SwitchName “Host Virtual Switch” -Name “Live”
Get-VMNetworkAdapter -ManagementOS -Name “Live” | Set-VMNetworkAdapterVlan -VlanId 20 -Access
Get-NetAdapter -Name “vEthernet (Live)” | Set-NetIPInterface -Dhcp Disabled
Get-NetAdapter -Name “vEthernet (Live)” | New-NetIPAddress -IPAddress 192.168.20.1 -PrefixLength 24

Add-VMNetworkAdapter -ManagementOS -SwitchName “Host Virtual Switch” -Name “CSV”
Get-VMNetworkAdapter -ManagementOS -Name “CSV” | Set-VMNetworkAdapterVlan -VlanId 30 -Access
Get-NetAdapter -Name “vEthernet (CSV)” | Set-NetIPInterface -Dhcp Disabled
Get-NetAdapter -Name “vEthernet (CSV)” | New-NetIPAddress -IPAddress 192.168.30.1 -PrefixLength 24

Easy as pie!

Hope this helps!