Forum Discussion
Nested virtualization in Azure
I would sugguest you to change the VM size to D4s_v5 to support nested virtualization scenarios.
- abhi2689Jul 06, 2023Copper Contributor
fmartel Please help with this point also as how to run the command.
The documentation says to run it when the VM is in stopped state. While I run to execute the command under 'Run Command' section, it is mentioned that VM must be ON.- fmartelJul 06, 2023Brass Contributor
I have never installed docker desktop, so I don't know what is the enduser experience.
So I think it is because you misunderstood the guide or I misunderstand the need.
I assume it is a some kind of manager that leverage Hyper-V container virtualization and the manager need to have virtualization extensions enabled during the install of during the container creation.
The thing is.. Set-VMProcessor is intended to be ran on a hyper-v host that as a stoped VM.
When ExposeVirtualizationExtensions is set to true to a VM, it allow this vm to run virtualization technologies on this VM. (Hyper-V)
So in your scenario the VM (Standard D4as v4) is managed by Microsoft in Azure and this VM have ExposeVirtualizationExtensions value set to false because nested virtualization is not supported on AMD servers in Azure. You must dealocate your VM, change the VM size to a VM size that support nested virtualization. After that you can install hyper-v in that VM and you should be able to spin a nested VM/container in that VM. Set ExposeVirtualizationExtensions to the new VM/container created would allow this child VM to run another hyper-V host inside.. which is a pretty much uncommon scenario.
Hope it make sense.
- abhi2689Jul 07, 2023Copper Contributorfmartel: Sorry for disturbing you again and again.
I have achieved the nested virtualization following https://learn.microsoft.com/en-us/azure/lab-services/how-to-enable-nested-virtualization-template-vm-using-script?tabs=powershell#enable-nested-virtualization-by-using-windows-tools on the VM size you had suggested.
Thank you for being there.