Hyper-V VMM 服務失敗,且事件識別碼 14050 dynamicportrange 已在 Windows Server 2012

如果有使用 VMM 2012 sp1 管理Windows Server 2012 Hyper-V的朋友,若有發生失敗

事件日誌有出現類似如下訊息

Log Name: Microsoft-Windows-Hyper-V-VMMS-Admin
Source: Microsoft-Windows-Hyper-V-VMMS
Date: <Date> <Time>
Event ID: 14050
Level: Error
Description: Failed to register service principal name.
Event Xml: …
<Parameter0>Hyper-V Replica Service</Parameter0>

 

微軟已經在2014.1.2提供絕決方案:kb2761899

http://support.microsoft.com/kb/2761899

原因

如果 TCP 動態連接埠範圍超出預設範圍,可能會發生這個問題。Hyper-V 虛擬管理服務 (Vmms.exe) 可讓您使用 Windows 服務強化,並限制本身動態連接埠範圍。
如果要判斷 TCP 動態連接埠範圍,請在提高權限的命令提示字元執行下列命令:

C:\>netsh int ipv4 show dynamicportrange tcp
Protocol tcp Dynamic Port Range
---------------------------------
Start Port      : 49152
Number of Ports : 16384

若要解決這個問題,請執行下列指令碼一次,每個受影響 Hyper-V 主機。此指令碼加入自訂的通訊埠範圍,才能啟用通訊 9000 到 9999 之間的額外的連接埠範圍的 Vmms.exe。指令碼可以視需要修改。
若要設定指令碼,以新增自訂的連接埠範圍,請依照下列步驟執行:

  1. 啟動文字編輯器,例如 「 記事本 」。
  2. 複製下列程式碼中,並將程式碼再貼到文字檔案:

    'This VBScript adds a port range from 9000 to 9999 for outgoing traffic  
    'run as cscript addportrange.vbs on the hyper-v host
    
    option explicit
    
    'IP protocols
    const NET_FW_IP_PROTOCOL_TCP = 6
    const NET_FW_IP_PROTOCOL_UDP = 17
    
    'Action
    const NET_FW_ACTION_BLOCK = 0
    const NET_FW_ACTION_ALLOW = 1
    
    'Direction
    const NET_FW_RULE_DIR_IN = 1
    const NET_FW_RULE_DIR_OUT = 2
    
    'Create the FwPolicy2 object.
    Dim fwPolicy2
    Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2")
    
    'Get the Service Restriction object for the local firewall policy.
    Dim ServiceRestriction
    Set ServiceRestriction = fwPolicy2.ServiceRestriction
    
    'If the service requires sending/receiving certain type of traffic, then add "allow" WSH rules as follows
    'Get the collection of Windows Service Hardening networking rules
    
    Dim wshRules
    Set wshRules = ServiceRestriction.Rules
    
    'Add outbound WSH allow rules
    Dim NewOutboundRule
    Set NewOutboundRule = CreateObject("HNetCfg.FWRule")
    NewOutboundRule.Name = "Allow outbound traffic from service to TCP 9000 to 9999"
    NewOutboundRule.ApplicationName = "%systemDrive%\WINDOWS\system32\vmms.exe"
    NewOutboundRule.ServiceName = "vmms"
    NewOutboundRule.Protocol = NET_FW_IP_PROTOCOL_TCP
    NewOutboundRule.RemotePorts = "9000-9999"
    NewOutboundRule.Action = NET_FW_ACTION_ALLOW
    NewOutboundRule.Direction = NET_FW_RULE_DIR_OUT
    NewOutboundRule.Enabled = true
    wshRules.Add NewOutboundRule
    
    'end of script

  3. 將檔案儲存為”Addportrange.vbs”(包含引號)。正確,這會建立為具有.vbs 副檔名的檔案。檔案圖示會從 [記事本] 圖示變更為指令碼圖示。
  4. 執行 cscript 指令碼。


本篇瀏覽人數: 1906
分類: Hyper-V篇, MIS文章-虛擬化篇。這篇內容的永久連結

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *