Hyper-v-Server-2012-R2

移動 VMStorage 失敗並出現錯誤 0x80070005

  • June 6, 2016

我在 Hyper-V 主機 SERVER2 上發出此命令:

Clear; Get-VM | ForEach { 
 Write-Host "Migrating: "$_.Name;
 Move-VMStorage `
   -VM $_ `
   -DestinationStoragePath "\\SERVER1\D$";
}

兩台伺服器均已加入域,非集群。

這是我得到的結果:

Move-VMStorage:虛擬機“ADMIN”(4F452569-7DB9-4606-9371-A905267A7B0F)的儲存遷移失敗,出現錯誤“正常訪問被拒絕錯誤”(0x80070005)。遷移沒有成功。無法啟動 VHD 文件“D:\Virtual Hard Disks\ADMIN.vhdx”到“\SERVER1\D$\Virtual Hard Disks\ADMIN.vhdx”的鏡像操作:“正常訪問被拒絕錯誤”(“0x80070005”)。您無權執行該操作。如果您認為您應該有權執行此操作,請聯繫您的管理員。

ACL 已正確配置:

PS C:\Users\domain.admin> Get-Acl 'D:\Virtual Hard Disks' | FL


Path   : Microsoft.PowerShell.Core\FileSystem::D:\Virtual Hard Disks
Owner  : BUILTIN\Administrators
Group  : DOMAIN\Domain Users
Access : CREATOR OWNER Allow  268435456
        NT AUTHORITY\SYSTEM Allow  FullControl
        BUILTIN\Administrators Allow  FullControl
        BUILTIN\Users Allow  CreateFiles, AppendData
        BUILTIN\Users Allow  ReadAndExecute, Synchronize
        NT VIRTUAL MACHINE\Virtual Machines Allow  CreateFiles, AppendData, Read, Synchronize
        DOMAIN\SERVER2$ Allow  -2147483642
        DOMAIN\SERVER2$ Allow  CreateFiles, AppendData, Read, Synchronize
Audit  :
Sddl   : O:BAG:DUD:AI(A;OICIIO;GA;;;CO)(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;CI;DCLC;;;BU)(A;OICI;0x1200a9;;;BU)(A;OICI;0x
        12008f;;;S-1-5-83-0)(A;CIIO;DCLCGR;;;S-1-5-21-369066176-630964511-2072824237-1119)(A;;0x12008f;;;S-1-5-21-3690
        66176-630964511-2072824237-1119)

和:

C:\Users\domain.admin>net localgroup Administrators
Alias name     Administrators
Comment        Administrators have complete and unrestricted access to the compu
ter/domain

Members

-------------------------------------------------------------------------------
Administrator
DOMAIN\Domain Admins
The command completed successfully.

C:\Users\domain.admin>net group "Domain Admins"  <==(on the PDC)
Group name     Domain Admins
Comment        Designated administrators of the domain

Members

-------------------------------------------------------------------------------
Administrator            domain.admin
The command completed successfully.

C:\Users\domain.admin>whoami
DOMAIN\domain.admin

我已將 Kerberos 委託給此處討論。在任何可用網路下的 Kerberos 上,兩台機器上都啟用了傳入和傳出遷移。兩個防火牆都關閉了。

我已經聯繫了我的管理員,我也不知道出了什麼問題。

接下來看哪裡?

問題是我沒有將源和目標機器添加到目標共享的權限:

# Create folder
MD X:\VMS

# Create file share
New-SmbShare -Name VMS1 -Path X:\VMS -FullAccess Domain\HVAdmin, Domain\HV1$, Domain\HV2$, Domain\HVC$

# Set NTFS permissions from the file share permissions
Set-SmbPathAcl VMS1

這記錄在這裡:

https://technet.microsoft.com/en-us/library/jj134187(v=ws.11).aspx#BKMK_Step3

一旦我添加了它們,遷移就順利通過了。

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