What is nested virtualization in Microsoft Hyper‑V?
Well,
nested virtualization is a capability of the Hyper‑V host in which you can
allow virtual machines to act as a Hyper‑V host itself.
Now, in a hybrid administration standpoint, you think about Azure. Okay,
when I create a virtual machine in Azure,
that's a Hyper‑V VM I can presume, right? But what if you had need to host VMs
in a nested capacity? There are selected Azure virtual machine role sizes that
support nested virtualization. So you can stand up Hyper‑V hosts in Azure
virtual machines. If you want more information on which Azure VM sizes are in
scope, check the exercise files. Now the host on which you want to enable
nested virtualization must support CPU virtualization extensions, either Intel
or AMD. That should be a no‑brainer given you have a Hyper‑V host running. You
can enable nested virtualization on the host for a particular VM using
PowerShell. Specifically, this is the Hyper‑V PowerShell command
Set‑VMProcessor, where you target a particular VM and you set
ExposeVirtualizationExtensions to true. That's what you have to do once per VM
on the Hyper‑V host. You also have to modify the virtual switch on the host to
allow media access control or MAC address spoofing. Why?
Because when you're doing nested virtualization,
you're going to have the top‑level Hyper‑V host, and then you've got
your collection of Hyper‑V top‑level virtual switches.
A VM that's enabled for nested will become a Hyper‑V host itself inside the
main host, and we'll have a second layer of switches. So thus, you need to
be much more gracious or much more liberal,
I guess, in terms of your MAC address tolerance and security.
You need to relax those controls a little bit. Let's do a demo.