Troubleshoot a Broken Azure VM using Nested Virtualization in Azure (RDFE)

Please note that 3rd party virtualization software(s) for Windows 2016 Nested Virtualization feature is not supported. Only Hyper-V is currently supported.

Create a new Recovery VM

    1. OS: Windows Server 2016 Datacenter
    2. Size: Any V3 series with at least 2 cores
    3. Same Location, Storage Account and Resource Group as the Broken VM
    4. Select the same storage type as the broken VM (Standard or Premium)
  1. Delete the Broken VM. Ensure to KEEP all attached disks
  2. Once the Broken VM is deleted navigate to the Recovery VM
  3. Select Disks
  4. Select Attach Existing
  5. Browse to the location of the Broken VMs VHD
  6. Select the Broken VMs VHD and click OK
  7. Once the disk has successfully attached RDP to the Recovery VM
  8. In Server Manger select Manage -> Add Roles and Features
  9. For Installation Type select Role-based or feature-based installation
  10. Ensure the Recovery VM is selected
  11. Select the Hyper-V role

  12. Select Next on the Features Screen.
    1. If a Virtual Switch is available, select it and continue. Otherwise select Next and continue without a switch
  13. On the Migration Page select Next
  14. On the Default Stores Page select Next
  15. Check the box to restart the server automatically if required
  16. Select Install
  17. Allow the Server to install the Hyper-V role. This will take a few mins and the server will reboot automatically. You can monitor the reboot cycle using the Boot Diagnostics Tab in the Azure Portal
  18. Once the VM starts back up RDP back into it
  19. Open Disk Management and ensure the VHD of the Broken VM is set to Offline
  20. In Server Manger select the Hyper-V role
  21. Right click on the server and select the Hyper-V Manger
  22. In the Hyper-V manager right click on the Recovery VM and select New -> Virtual Machine
  23. Select Next
  24. Name the Virtual Machine and select Next
  25. Select Generation 1
  26. Leave the startup memory at 1024MB unless your VM requires more.
  27. If applicable select the Hyper-V Network Switch that was created. Else just move on to the next page
  28. Chose the option to Attach a Virtual Hard Disk Later
  29. Select Finish and the VM will be created
  30. Right click on the VM we just created and select Settings
  31. Select IDE Controller 0
  32. Select Hard Drive and click Add
  33. Under Physical Hard Disk select the VHD of the broken VM we attached to the Recovery VM
    1. If you do not see any disks listed it is because the VHD attached to the Recovery VM is set to Online. Refer back to step 22
  34. Select Apply and OK
  35. Double Click on the VM and Start it
  36. Depending on your scenario, apply any troubleshooting/ mitigations steps now that you have console access
  37. Once you get the VM back online shutdown the VM in the Hyper-V manager
  38. Go back to the Azure Portal
  39. Select the Recovery VM
  40. Select Disks
  41. Detach the now fixed VHD  from the Recovery VM
  42. Proceed to rebuild the now fixed VM. Refer to How to Rebuild an Azure VM from an Existing Disk OS disk

Leave a Reply

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