Windows 8 and Windows 2012 Server or later virtual machines fail upon reboot
search cancel

Windows 8 and Windows 2012 Server or later virtual machines fail upon reboot

book

Article ID: 317557

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
When running on ESXi 5.5 with virtual machine hardware version 10 (vmx-10), you may experience these symptoms:
  • Rebooting Windows 8 or 2012 Server or later virtual machines fail at the Microsoft Windows boot splash screen.
  • After resetting or power cycling the virtual machine, virtual machines boot successfully.
  • The virtual machine may resume booting after multiple hours or days.
  • A memory dump analysis reveals thread blocking on a timer expiry hours or days in the future.
  • The blocking thread may be stuck in KeDelayExecutionThread() during PciStallForPowerChange().
     
Note: This issue is seen to occur when:
  • The virtual machine has not experienced a full power cycle (powered off / powered on) for more than two months.
  • The virtual machine is configured with more than one vCPU.


Cause

Starting with Windows 8 or Windows Server 2012 or later, during the boot process, the operating system resets the TSC (TimeStampCounter, increments by 1 for each passed cycle) on CPU0 when it detects it to be equal or larger than 0x40000000000000. It does not reset the TSC of the other vCPUs and the resulting discrepancy between two vCPUs TSC values may result in the issues described under the Symptoms section. This only applies to virtual machine hardware version 10 as Windows resets the TSC on all CPUs on virtual machines with older hardware versions (which do not support hypervisor.cpuid.v2).
 
For virtual machines with legacy BIOS:
 
Rebooting Windows on virtual machines up to hardware version 10 (vmx-10) is done through a soft reset during which INIT is asserted. Unlike after a hard reset (assert of CPURST, PCIRST# and RSTDRV), operating systems should not expect the TSC to be reset to 0x0 after a soft reset. The default behavior of not resetting the TSCs upon a soft reset can be changed using the configuration option.
 
For virtual machines with EFI:
 
This is a known issue with the VMware EFI Firmware. Hard reset appears to be available in VMware EFI Firmware, but it does a soft reset.

Resolution

This issue is resolved in:
Alternatively, to resolve this issue for earlier ESXi 6.0 versions, upgrade the virtual machine to Hardware Version 11.

Note: The fix will not resolve this issue for virtual machines that have Windows 8 or Windows Server 2012 or later installed but do not have the Guest OS set to Windows 8 or Windows Server 2012 or later.
 
To work around this issue, update the advanced configuration in vSphere Web Client.
 
To add monitor_control.enable_softResetClearTSC = TRUE to the virtual machines advanced configuration in the vSphere Web Client:
  1. Log in to the vSphere Web Client.

    Note: Ensure that the virtual machine is powered off prior to proceeding.
     
  2. Right-click the virtual machine and click Edit Settings to open the Virtual Machine Edit Settings window.
  3. Click VM Options.
  4. From the list on the left, expand the Advanced option.
  5. Click Edit Configuration.
  6. Click Add Row.
  7. Type monitor_control.enable_softResetClearTSC in the new Name column.
  8. Type TRUE in the new Value column.
  9. Click OK to save the change to the virtual machine.
  10. Power on the virtual machine.
For more information, see Monitoring software shows incorrect system uptime for Windows 2008 R2 or later on hardware version 10 (2082042).

Alternatively, you may use this PowerCLI script for multiple virtual machines:

Notes:
  • After running this script, virtual machine(s) must be vMotioned or shut down and powered on for the changes to take effect.
  • The script does not work around this issue for virtual machines that have Windows 8 or Windows Server 2012 or later installed but do not have the Guest OS set to Windows 8 or Windows Server 2012 or later.
 
ForEach ($vm in (Get-VM)){
$vmv = Get-VM $vm | Get-View
$name = $vmv.Name
$guestid = $vmv.Summary.Config.GuestId
$vmx = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmx.extraConfig += New-Object VMware.Vim.OptionValue
$vmx.extraConfig[0].key = "monitor_control.enable_softResetClearTSC"
$vmx.extraConfig[0].value = "TRUE"
if ($guestid -like "windows8*Guest") {
($vmv).ReconfigVM_Task($vmx)
}
}


Additional Information

To calculate how long after the last full power cycle a Windows 8 or Windows Server 2012 or later virtual machine with hardware version 10 takes to hang upon reboot:
 
0x40000000000000 (Windows TSC reset value) -> 0n18014398509481984 /86400 (cycles to days) /1000000000 (Hz to GHz)
 
GHz:
/2 -> 104 days
/3 -> 69 days

Monitoring software shows incorrect system uptime for Windows 2008 R2 or later on hardware version 10
Windows 8 和 Windows 2012 Server 或更高版本虚拟机在重新引导时出现故障
Windows 8 および Windows 2012 Server 以降の仮想マシンが再起動時に失敗する