大网数据广告活动
Hyper-V与虚拟化

VM shutdown actions don't run

· 52CE 我爱测

Describes a problem that prevents virtual machine shutdown actions from running in Windows Server 2012 and Windows 8. Occurs when shutdowns are triggered by the OS because of a low battery condition.

This article helps solve a problem that prevents virtual machine shutdown actions from running.

Original KB number:   3058418

Symptoms

Consider the following scenario:

  • You're running Windows Server 2012 R2 on a computer that has an attached uninterruptible power supply (UPS) or on a laptop.
  • This Windows Server 2012 R2-based system has the Hyper-V role installed and is hosting virtual machines.
  • The battery is running out of power.
  • The host operating system shuts down because of the low battery condition.
  • After you restart the computer, you notice the virtual machines are in a Stopped state and that errors are logged in the virtual machine event logs.

In this scenario, the configured host shutdown actions for the virtual machine (Stop VM, Save VM state, Shut down VM) don't run as expected, and the virtual machines are not gracefully shut down or saved. This behavior may be indicated by the following event log entries on the guest VMs:

Log Name: Microsoft-Windows-Hyper-V-Worker-Admin
Source: Microsoft-Windows-Hyper-V-Worker
Event ID: 18590
Level: Critical
Description:
'Guestname' has encountered a fatal error. The guest operating system reported that it failed with the following error codes: ErrorCode0: 0xEF, [additional variable information]

Event ID: 6008
Source: Event Log
Type: Error
Description:
The previous system shutdown at Time on Date was unexpected.

Cause

When a shutdown is triggered by a low battery (either Low or Critical levels), services that are running on the system are not notified of the shutdown. This behavior occurs because a clean operating system shutdown is prioritized over stopping services, as stopping services can block shutdowns for a lengthy period. Because Hyper-V relies on service notifications to trigger the configured actions on the guest VMs, the configured actions don't run before the host shuts down.

Note: This behavior does not apply when the system is shut down by third-party UPS software.

Resolution

When you're running a Hyper-V server that has an attached UPS, use the UPS manufacturer's software to correctly handle battery threshold levels and to initiate a regular system shutdown when appropriate.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。