Symptom: VM stuck in Reboot Loop. Often due to Failed Windows Updates.
Resolution:
- Delete the isolated VM, keeping the disks associated with it.
- Wait for the disk lease to expire. (About 3 mins)
- Attach the OS disk of the broken VM to a recovery VM located in the same Region and Cloud Service.
- Once the disk is attached ensure that the disk is flagged as ONLINE in the Disk Management console.
- Before doing any changes create a copy of the folder windowssystem32config incase rollback is needed
- On the recovery machine, open up registry editor (regedit)
- Click on ‘HKEY_USERS’ and select File -> Load Hive
- Browse up to the file windowssystem32configSYSTEM of the attached affected VMs OS Disk. Most likely this will be Drive E: or F:
- When opening it will ask for a name, put ‘BROKENSYSTEM’ and select okay
- Unfold HKEY_USERS and there will be a folder called ‘BROKENSYSTEM’
- In there, make the following changes:
HKEY_USERSBROKENSYSTEMSelectCurrent From 1 to 2
HKEY_USERSBROKENSYSTEMSelectDefault From 1 to 2
HKEY_USERSBROKENSYSTEMSelectFailed From 0 to 1
HKEY_USERSBROKENSYSTEMSelectLastKnownGood From 2 to 3
HKEY_USERSBROKENSYSTEMControlSet002ControlCrashControlAutoreboot From 1 to 0 - Select ‘HKEY_LOCAL_MACHINEBROKENSYSTEM’ and go to File -> unload the hive from the menu
- Remove the disk from the troubleshooting VM
- Recreate the machine using the now restored OS disk
- Navigate to OS Disks (Classic) in the Azure Portal
- Select the now fixed OS disk and select Create VM
- Continue to recreate the VM with the same name and add it to the same cloud service as before.