NetWorker:多個 VM 的 NMM Hyper-V 平行還原在某些 VM 上失敗
Summary: NetWorker:適用於多個虛擬機器的 NMM Hyper-V 平行還原,
Symptoms
如果 Hyper-V 虛擬機已損壞,並且需要恢復多個虛擬機:
NMM 可以將多個虛擬機恢復到其原始(源)位置。
先決條件:
● 若要將虛擬機恢復到源 Hyper-V 伺服器,請確保源伺服器上存在虛擬機的原始驅動器號或裝入點。
目錄路徑會自動建立。將虛擬機恢復到源伺服器會覆蓋源虛擬機。
● 由於 Hyper-V 使用內部 GUID 識別虛擬機,因此請確保在恢復操作期間不要移動或重命名虛擬機。
當對多個虛擬機器執行平行還原時,某些虛擬機器的復原會失敗。
nsrnmmrc: Restore failed with the error: Failed to complete BBB restore.
Cause
在復原程序中,NMM 會嘗試使用 PowerShell 命令,從 Hyper-V 管理員中停止並移除 VM。 Get-VM -ComputerName '<hostname>' | Where-Object {$_.name -eq '<VMName>' } | Stop-VM -Force
這樣無法停止並移除部分 VM,進而導致還原失敗。
事件記錄 > Hyper-v VMMS 管理員記錄顯示下列錯誤:
Failed to perform the operation. The virtual machine is currently performing another operation <VMName> failed to perform the 'Turning Off' operation. The virtual machine is currently performing the following operation: 'Shutting Down'.(Virtual machine ID GUID)
PowerShell 嘗試停止 VM 失敗,並傳回:
Get-VM -ComputerName '<hostname>' | Where-Object {$_.name -eq '<VMName>' } | Stop-VM -Force
Stop-VM : '<VMName>' failed to shut down. (Virtual machine ID <GUID>)
Failed to perform the operation. The virtual machine is currently performing another operation.
+ ... '<hostname>' | Where-Object {$_.name -eq <VMName> } | Stop-VM -Force
+ ~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Stop-VM], VirtualizationException
+ FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.StopVM
PS C:\Using VHD> Get-VM -ComputerName '<hostname>' | Where-Object {$_.name -eq '<VMName>' } | Remove-VM -Force
Remove-VM : Deleting '<VMName>' failed.
Resolution
因應措施:
如果遇到此問題,請手動停止並移除虛擬機器,然後再執行還原。
從 Powershell
步驟 1:- 關閉虛擬機。Get-VM -ComputerName '<hostname>' | Where-Object {$_.name -eq '<VMName>' } | Stop-VM -TurnOff
注意:關閉虛擬機器 <VMName>。
此操作相當於斷開虛擬機的電源,並可能導致未保存的數據丟失。
步驟 2:- 移除虛擬機器。 Get-VM -ComputerName '<hostname>' | Where-Object {$_.name -eq '<VMName>' } | remove-VM
從 Hyper-V Manager
步驟1:- 打開Hyper-V管理器,右鍵按兩下 VM, 然後按兩下關閉。
步驟 2:- 在「關閉」後,右鍵按下虛擬機器,然後按兩下刪除”
