Hello,
I have a little test environment using nested virtualization in Windows Server 2019 wehre I need to use VLANs.
The environment consists of:
- pHost > a physical server with Hyper-V role
- vHostSwitch > a private virtual switch on pHost
- vHost1 > a virtual server on pHost with Hyper-V role, connected to vHostSwitch (mac spoofing & ExposeVirtualizationExtensions enabled)
- vmSwitch > an external virtual switch on vHost1 (shared with management os)
- vHost2 > a virtual server on pHost with Hyper-V role, connected to vHostSwitch (mac spoofing & ExposeVirtualizationExtensions enabled)
- vmSwitch > an external virtual switch on vHost2 (shared with management os)
- VM1A > a virtual Server on vHost1, connected to vmSwitch (on vHost1)
- VM1B > a virtual Server on vHost1, connected to vmSwitch (on vHost1)
- VM2A > a virtual Server on vHost2, connected to vmSwitch (on vHost2)
- VM2B > a virtual Server on vHost2, connected to vmSwitch (on vHost2)
So far, so good. All Servers can ping and reach each other without VLANs.
Also everthing is fine, when I configure a VLAN on the pHost by Setting the same VLAN ID in the Hyper-V network Cards for vHost1 and vHost2.
vHost1, vHost2, VM1A, VM1B, VM2A, VM2B can still ping each other, and as expected can't ping VMs with different or no VLANs connected to vHostSwitch.
But what I need is setting up a VLAN for VM1A and VM2A, and a separate one for VM1B and VM2B.
As soon as i set VLANs in the Hyper-V network cards for those 4 VMs, the VMs on vHost1 cannot cummincate with VMs on vHost2 in the same VLAN.
This doesn't change wether or not I'm using VLANS on the pHost for the vHosts.
VMs in the same VLAN within one vHost can communicate without a problem.
Also Setting a VLAN for the Management OS in vmSwitch on vHost1 and vmSwitch on vHost2 stops the vHosts from communicating with each other.
In a real Environment, vHost1 and vHost2 would be physical servers connected to a physical VLAN capable switch.
But in nested virtualization the vHostSwitch needs to play the role of the physical VLAN aware switch.
While Hyper-V switches definitely can handle VLANs, it seems they drop VLAN tagged packets comming from Hyper-V switches from within the nested virtualization.
So is there any way to make VLANs work between VMs between different nested Hyper-V hosts on the same physical Hyper-V host?
thanks in advance!
Thread source link: https://social.technet.microsoft.com/Forums/windowsserver/en-US/f88c3245-5c15-405e-b7e9-00d6276f8459/vlans-in-hyperv-nested-virtualization-possible?forum=winserverhyperv