Udostępnij za pośrednictwem


Troubleshoot a Broken Azure VM using Nested Virtualization in Azure (Managed Disk)

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

Also note that as of right now, Nested Virtualization is only available in the following geographic locations:

US
-West 2
-East

Europe
-West

Asia Pacific
-Southeast

Reference Links:
Nested Virtualization in Azure New DV3 and EV3 Series Virtual Machines

  1. Delete the Broken Virtual machine
  2. Create a new Recovery VM
    1. OS: Windows Server 2016 Datacenter
    2. Select the same Location and Resource Group as the Broken VM
    3. Size: Any V3 series with at least 2 cores
    4. Select to use Managed Disks
  3. Once the Recovery VM is created select it in the Portal
  4. Select Disks
  5. Add Data Disk
  6. Select the Broken VHDs OS disk from the drop down list
  7. Save the Changes
  8. Once the disk has successfully attached RDP to the Recovery VM
  9. In Server Manger select Manage -> Add Roles and Features
  10. For Installation Type select Role-based or feature-based installation
  11. Ensure the Recovery VM is selected
  12. Select the Hyper-V role
  13. 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
  14. On the Migration Page select Next
  15. On the Default Stores Page select Next
  16. Check the box to restart the server automatically if required
  17. Select Install
  18. 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
  19. Once the VM starts back up RDP back into it
  20. Open Disk Management and ensure the VHD of the Broken VM is set to Offline
  21. In Server Manger select the Hyper-V role
  22. Right click on the server and select the Hyper-V Manger
  23. In the Hyper-V manager right click on the Recovery VM and select New -> Virtual Machine
  24. Select Next
  25. Name the Virtual Machine and select Next
  26. Select Generation 1
  27. Leave the startup memory at 1024MB unless your VM requires more.
  28. If applicable select the Hyper-V Network Switch that was created. Else just move on to the next page
  29. Chose the option to Attach a Virtual Hard Disk Later
  30. Select Finish and the VM will be created
  31. Right click on the VM we just created and select Settings
  32. Select IDE Controller 0
  33. Select Hard Drive and click Add
  34. 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
  35. Select Apply and OK
  36. Double Click on the VM and Start it
  37. Depending on your scenario, apply any troubleshooting/ mitigations steps now that you have console access
  38. Once you get the VM back online shutdown the VM in the Hyper-V manager
  39. Go back to the Azure Portal
  40. Select the Recovery VM
  41. Select Disks
  42. Select Edit and remove the now fixed VHD from the Recovery VM and save the changes
  43. Proceed to rebuild the now fixed VM. Refer to How to Rebuild an Azure VM from an Existing Managed Disk

Comments

  • Anonymous
    August 04, 2017
    This is really awesome! Now you really don't need any console access in Azure or Azure Stack at all.
    • Anonymous
      August 04, 2017
      Totally agree! With the ability to have console access fixing problematic VMs will continue to get increasingly easier :)
  • Anonymous
    August 08, 2017
    Very nice workaround. But, what if your broken VM is a Linux VM ?
    • Anonymous
      August 08, 2017
      Hey Stefano, The process will work the same regardless of it being a Linux or Windows VM.