Hyper-V: add a virtual card to the host

Intro

In this tutorial, I will explain how to add a virtual adapter to the Hyper-V host that will be connected to the virtual switch.

This is equivalent to adding the same type of network adapter when configuring an external virtual switch with the Allow operating system option to share this network adapter checked.

For example, this solution enables a Hyper-V cluster to create a network card for Live Migration.

Add a physical card to the host

Open a PowerShell prompt and enter the following command

Add-VMNetworkAdapter -ManagementOS -SwitchName <Virtual-Switch> -Name "Name-Network-Adapter"

Example:

Add-VMNetworkAdapter -ManagementOS -SwitchName NicTeam1_VM -Name "LM"

The virtual network adapter 1 has been added to the host.
NIC added

Configure a VLAN

In setting up a Hyper-V cluster, network cards dedicated to Live Migration are often isolated in VLANs.

Here’s how to “tag” the card in a VLAN.

Open a PowerShell prompt and enter the following command

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName <NIC-NAME> -Access -VlanId <ID>

Example :

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "LM" -Access -VlanId 100

To verify that the order has been taken into account enter the following command which will display the information of the card.

Get-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName <NIC-NAME>

Example :

Show VLAN


I also use this configuration on my work computers which has only one physical network card and allows me to have multiple virtual cards on different VLANs.



Related Posts


Sophos XG: add a vlan

In this article, I'll explain how to declare a vlan on your Sophos XG firewall. Before you create it on the firewall, you must make sure that the port of the switch where the firewall is connected is

Veeam : Automatically backup virtual machines on Hyper-V

In this tutorial, I'll explain how to automatically back up virtual machines (new and existing) with Veeam and Hyper-V. The trick is to use the option to back up the volume in Veeam job sources instea

IPAM: IP Address Management with Windows Server – Installation and Configuration

Presentation of IPAM IP Address Manager (IPAM) is a feature built into Windows Server that allows you to set up an administrator tool and analyze DHCP scopes and have an IP address base within a compu