延伸模組套件和二進位檔會在 VM 上下載 (例如 Linux 的 "/var/lib/waagent/custom-script/download/1" 或 Windows 的 "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\Downloads\0")。
其組態和設定會透過 VM 代理程式,從 Azure 平台傳遞至延伸模組處理常式 (例如 Linux 的 "/var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.3/config" 或 Windows 的 "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\RuntimeSettings")
VM 內的延伸模組常式會寫入狀態檔 (例如 Linux 的 "/var/lib/waagent/Microsoft.Azure.Extensions.CustomScript-2.1.3/status/1.status" 或 Windows 的 "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\Status"),接著會向 Azure 平台報告。 該狀態是透過 PowerShell、CLI 或 Azure 入口網站中 VM 的擴充功能刀鋒視窗中報告的狀態。
其也會寫入執行的詳細記錄 (例如 Linux 的 "/var/log/azure/custom-script/handler.log",或 Windows 的 "C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\CustomScriptHandler.log")。
如果 VM 是從現有的 VM 重新建立
您可能會根據來自另一個 Azure VM 的特製化磁碟來建立 Azure VM。 在此情況下,舊的 VM 可能包含擴充功能,因此會有保留二進位檔、記錄檔和狀態檔。 新的 VM 模型不會察覺先前 VM 的擴充功能狀態,而且可能會回報這些擴充功能的狀態不正確。 強烈建議您先從舊 VM 移除擴充功能,再建立新的 VM,然後在建立新的 VM 之後重新安裝這些擴充功能。
當您從現有的 Azure VM 建立一般化映像時,可能會發生相同的情況。 我們邀請您移除擴充功能,以避免擴充功能的狀態不一致。
已知問題
PowerShell 無法辨識為內部或外部命令
您會注意到 RunCommand 擴充功能輸出中有下列錯誤項目:
Log
RunCommandExtension failed with "'powershell' isn't recognized as an internal or external command,"
分析
擴充功能會在本機系統帳戶下執行,因此很有可能在您 RDP 連線到 VM 時,powershell.exe 運作正常,但在使用 RunCommand 執行時會失敗。
Type Microsoft.Compute.VMAccessAgent
Version 2.4.8
Status Provisioning failed
Status level Error
Status message Cannot update Remote Desktop Connection settings for Administrator account. Error: System.Runtime.InteropServices.COMException (0x800706D9): There are no more endpoints available from the endpoint mapper. (Exception from HRESULT: 0x800706D9) at NetFwTypeLib.INetFwRules.GetEnumerator() at
Microsoft.WindowsAzure.GuestAgent.Plugins.JsonExtensions.VMAccess.RemoteDesktopManager.EnableRemoteDesktopFirewallRules()
at Microsoft.WindowsAzure.GuestAgent.Plugins.JsonExtensions.VMAccess.RemoteDesktopManager.EnableRemoteDesktop() at
分析
當 Windows 防火牆服務未執行時,就會發生此錯誤。
方案
檢查 Windows 防火牆服務是否已啟用並執行。 如果未執行,請啟用並啟動服務 - 然後再試一次以執行 VMAccessAgent。
根據驗證程序,遠端憑證無效。
您會在 WaAppAgent.log 中看到下列內容
Log
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.
Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
分析
您的 VM 可能遺失「受信任的根憑證授權單位」中的 Baltimore CyberTrust 根憑證。
कॉन्फ़िगरेशन समस्याओं का निवारण करना सीखें जो आपके Azure-होस्टेड Windows Server वर्चुअल मशीन (VMs) से कनेक्टिविटी को प्रभावित करती हैं। VM स्टार्टअप, एक्सटेंशन, प्रदर्शन, संग्रहण और एन्क्रिप्शन के साथ समस्याओं को हल करने के लिए दृष्टिकोणों का अन्वेषण करें।