Wednesday, November 28, 2012 10:15 AM
What is the correct way to configure VM with trunking enable on the phisical switch.
1. Create a virtual switch.
2. Add the VM to use that switch, and configure VLAN ID on the VM network card in Hyper-V.
1. Create for each VLAN in the trunk a virtual switch (with a VLAN ID).
2. Asign the designated virtual switch to the VM.
Wednesday, November 28, 2012 6:50 PM
Depends on how you have connected to the trunked environment. Hyper-V allows only a single virtual switch per physical NIC. So if you have a single NIC that is connected to a trunked port on your switch, you can only create a single virtual switch and each VM will have to put the proper VLAN tag on its virtual NIC(s) in order to access the different VLANs.
However, if you have a teamed NIC, you can create multiple vNICs on the team, each one appearing as a separate 'physical' NIC to the OS. Then you could create individual virtual switches on each vNIC for each VLAN.
Either way works. How do you want to do it?
Wednesday, November 28, 2012 8:26 PM
Thanks for the reply. Correct me if Im wrong.
I can make a NIC team in Windows2012 with only one physical NIC. I can then create mulitple vNICs on the team, and then assign each of the vNIC to a separate virtual switch. Latter on I can add additional NICs to the team if needed (of course all of them being connected to the trunk).
My thinking is: If im going to have multiple VMs on the host and the VMs are going to be in separate VLANs, its easier to managed them if create a vSwitch named 10.0.0.x, 10.11.2.x, then to memorize the VLAN IDs for each of the VLAN that Im going to use on the VMs? - Is this a good starting point?
Thursday, November 29, 2012 6:38 AMModerator
In previous versions of Hyper-V, only one parent virtual NIC was supported, however in Windows Server 2012 Hyper-V, multiple NICs are supported. In addition, you can share the physical NIC that is bound to the Hyper-V Switch with the management operating system.
To enable this functionality, open Hyper-V Manager. In the Actions pane, select Virtual Switch Manager. In Virtual Switch Manager, select a switch. In the details pane for the switch, which is illustrated below, select Allow management operating system to share this network adapter.
You can create multiple parent virtual NICS that you use for live migration, storage, and management; and you can assign each virtual NIC to a different virtual Local Area Network (VLAN). You can also create different Quality of Service (QoS) polices for each virtual NIC.
To create the virtual NICS for the management operating system, type the following commands at the Windows PowerShell prompt, and then press ENTER:
Add-VMNetworkAdapter –ManagementOS –Name Management
Add-VMNetworkAdapter –ManagementOS –Name Storage
Add-VMNetworkAdapter –ManagementOS –Name “Live Migration”
If you only have a single NIC or a team of NICs bound to the Hyper-V Virtual Switch, you can use multiple parent virtual NICs as well.
For more information please refer to following MS articles:What's New in Hyper-V Virtual Switch
Can 2 virtual network switches be added to 1 NIC?
TechNet Community Support
- Marked As Answer by ZarkoC Friday, November 30, 2012 1:34 PM
Thursday, November 29, 2012 12:18 PM
Thanks for the reply.
Im not sure if we understand each other correctly.
- I have dedicated physical NICs for Host management, Cluster and Live Migration.
- I have one physical NIC with is connected to a trunked port (with two VLANs in the trunk, VLANID 1 and VLANID 2).
- From the physical NIC i create a vSwitch in HyperV.
- On a created VM in Hyper-V console, I connect it's vNIC to the vSwitch and assign a VLAN ID also from Hyper-V.
Is this the only way that I can connect the VMs to the network? I see this as an administration issue. If i want to see on what VLAN what VM is connected I would need to know it's VLAN ID.
Is there a way to create separate vSwitchs for each VLAN in the trunk.
Thursday, November 29, 2012 5:28 PM
I never thought of creating a 'team' with a single NIC. I see it can be done via PowerShell, but not the GUI. Wonder if that is by design by Microsoft?
Again, whatever you find easier. The flexibility is there for you.
Thursday, November 29, 2012 7:50 PM
I cant find how to create a vNIC from a 'team' of two physical NICs? Is there a procedure how to do it?
Friday, November 30, 2012 7:49 PM
Just like you can't create a team with a single NIC through the GUI, you can't create multiple vNICs on the team through the GUI. You need to use PowerShell for both of them.
# Create a NIC team on a single NIC New-NetLbfoTeam -Name "SingleNICTeam" -TeamMembers "Ethernet 2"
# Create a NIC team with two NICs
New-NetLbfoTeam -Name "DoubleNICTeam" -TeamMembers "Ethernet 2", "Ethernet 3"
# Create vNICs on team Add-NetLbfoTeamNic -Team "SingleNICTeam" -VlanID 15 -Name "VLAN15" Add-NetLbfoTeamNic -Team "SingleNICTeam" -VlanID 16 -Name "VLAN16"
- Edited by Tim CerlingMicrosoft Community Contributor Friday, November 30, 2012 9:06 PM