Windows

是否可以查看觸發 Azure VM 重新啟動的原因?

  • August 13, 2021

我收到了一些來自 Azure 的電子郵件通知,其中包含:

Activity log alert  Alert [Server Name] Health Status  
Properties {
   "title":"Reboot initiated from inside the machine",
   "details":"A reboot was triggered from inside the virtual machine. This could be due to a virtual machine operating system failure or as requested by an authorized user or process. The virtual machine will be back online after the reboot completes.",
   "currentHealthStatus":"Unavailable",
   "previousHealthStatus":"Unavailable",
   "type":"Downtime",
   "cause":"UserInitiated" }

這絕對不是“UserInitiated”,但可能是由 Windows 更新引起的,因為時間落在定義的“非工作時間”視窗內。

但是,有什麼方法可以在日誌中說明是什麼觸發了重啟?

查看“資源執行狀況”以查看歷史記錄中是否還有其他事件。你是對的,如果它屬於“非工作時間”視窗,它可能是 Windows 更新。在我們的環境中,當 Windows 更新觸發重新啟動時,我們會收到這些通知。

如果您想 100% 確定它是 Windows 更新,請過濾系統事件日誌中的 ID 1074、6006 和 6008。在重新啟動時查找事件。它應該這樣說:

   The process C:\windows\system32\wbem\wmiprvse.exe (HOSTNAME) has initiated the restart of computer HOSTNAME on behalf of user NT AUTHORITY\SYSTEM for the following reason: No title for this reason could be found
Reason Code: 0x80070015
Shutdown Type: restart
Comment: 

微軟本可以添加一個原因,以便更容易確定原因……

引用自:https://serverfault.com/questions/1074327