During VMware SRM recovery plan testing, some times a VM will get marked dirty, and will boot into the “System Recovery Options”.
When it’s in “System Recovery Options”, it will just stay there, until the the VM’s power is reset
I can reset the VM’s power, then it boots up fine.
To reset power, I do that either manually, or automatically (after a short timeout) by enabling the VMware vSphere HA\VM Monitoring for that Cluster.
The fix is to not have the VM to boot into “System Recovery Options” console, but to always boot into windows.
If the “Time to display recovery options when needed:” is set, if a system has a boot up issue, then instead of booting in “System Recovery Options”, it will instead just show the boot up menu for 30 seconds (if using the default timeout), then will boot up windows normally.
If you go to: Control Panel \ System and Security \ System \ Advanced system settings, it will run open an elevated prompt to run:
Then go to: “Advanced” tab \ Startup and recovery \ Settings
Then check to enable the “Time to display recovery options when needed:”
The issue about that is if you need to do it programmically.
I wrote the below power shell script to do this for you.
The commands will need to be run in an elevated context.
#### Enable the checkbox for "Time to display recovery options when needed:" and set to 10 seconds ####
## This script assumes that the %systemroot% is c:\windows\
# first make a backup
copy C:\windows\bootstat.dat C:\windows\bootstat.dat.backup
# If for some odd reason, the Advanced system settings is open, then close it, or else it will have a file lock on the bootstat.dat file
C:\windows\system32\taskkill.exe /f /im SystemPropertiesAdvanced.exe
# temporarily remove the "system" attribute from bootstat.dat
attrib -s C:\windows\bootstat.dat
# for "System Recovery Options" to ever work, which you might need one day, the bootstat.dat file needs to NOT have NTFS Compression, but must be uncompressed, per KB309481
compact /u C:\windows\bootstat.dat
# Read in the file, bootstat.dat
$bytes = [System.IO.File]::ReadAllBytes("c:\windows\bootstat.dat")
# set the offset to 8
$offset = 8
# offset 8: default setting is 0x00
# offset 8: 0x00 disables, 0x01 enables
$bytes[$offset] = 0x01
# offset 9: default setting is 0x1E
# offset 9: 0x1E is 30seconds, 0x0A is 10seconds.
$bytes[$offset+1] = 0x0A
# write back the file with the new values
# Set the system attribute on bootstat.dat
attrib +s C:\windows\bootstat.dat