Hyper-V virtualized in a VM (Nested Virtualization) in Azure

Nested VirtualizationHey guys, how are you?!! Did you know that it is possible to have a virtualized hyper-v inside a Virtual Machine in Azure (Nested Virtualization)? Or even use this same hyper-v to run your Docker containers? This idea is interesting (usually for testing purposes), when you want a server environment as if it were in the on-premisses environment, where there is a need to have host Hyper-V management.

Explaining a little more… See in the image below that all the infrastructure below the Azure VM (created to host our virtualized hyper-v and present at LEVEL 2) will still be Microsoft’s responsibility/management:
Nested Virtualization2
Cool, and what is the requirement to have the Nested Virtualization function in Azure?

  • The Virtual Machine provisioned to host Hyper-v must belong to the DV3 or EV3 series (They already have them in Brazil).

Let’s see it in practice? Here are the steps:

  1. Create the Virtual Machine with Windows Server 2012/2016 that will contain the virtualized Hyper-v, remembering that it must belong to the DV3 or EV3 series. In the example below, I selected Standard D4s V3 size (4vCPUs, 16GB memory): Nested Virtualization_Passo1
  2. Create a disk for DATA, where your virtual machines will be stored. In the example, I created a 1TB SSD disk: Nested Virtualization_Passo2
  3. Virtual Machine created. Now install Hyper-v, by powershell of course, much simpler and practical… changing the parameter “DEMOKIELING01” to the name of your Virtual Machine created in the previous step: Install-WindowsFeature -Name Hyper-V -ComputerName “DEMOKIELING01” -IncludeManagementTools -Restart
    Nested Virtualization_Passo3
    Nested Virtualization_Passo3.1
  4. Your virtualized Hyper-V in an Azure Virtual Machine is ready for use:Nested Virtualization_Passo4

Leave a Reply

Your email address will not be published. Required fields are marked *