Resolution for Hyper-V VM (Server 2012 R2) – updates stuck at x%
OK – so this was partly (well… completely) my fault. Rebooted a Hyper-V Host Server whilst one of the VMs was running updates.
I know – should have checked, should have downed or moved the VMs first etc etc – but I didn’t.
When the host came back up, most of the VMs, but one, were fine – fortunately nothing too important on it, just the helpdesk system and portal (Spiceworks in this case).
Took me the best part of an hour to get it back up and running (any longer and I’d have created a new server and restored the Spiceworks backup) – eventually hit on the following sequence to recover successfully. Part way there (renaming the xml and first attempts at dism) I got rid of the stuck update message and was presented with endlessly circling dots – very frustrating.
Anyway – this worked for me:
- F8 on boot to get recovery console
- Go to Command prompt
- Navigate from X: to system drive installation folder (usually C:\Windows\winsxs)
- Rename pending.xml to pending.bak
- Create empty pending.xml (‘echo > pending.xml’ from Command prompt)
- Run: ‘dism.exe /image:C:\ /cleanup-image /revertpendingactions’
- Reboot (not ‘Continue to Server 2012’)
Note that on reboot the server dropped to a black empty screen (just showing ‘Hyper-V’) for about a minute before successfully rebooting – fortunately I sat there staring blankly at the screen for long enough to see it actually come up.
Tried initially without renaming original pending.xml or creating a blank pending.xml file – dism failed with various errors (3017, 87).