Symptoms:
When you try to import a virtual machine that has been exported by using Hyper-V Manager, you cannot import the virtual machine by using Hyper-V Manager on a different Hyper-V server. Additionally, you receive an error message that resembles the following:
A Server error occurred while attempting to import the virtual machine. Failed to import the virtual machine from import directory . Error: One or more arguments are invalid (0x80070057). When you try to use System Center Virtual Machine Manager (SCVMM) to import a virtual machine that was exported by using Hyper-V Manager, you receive the following error message:
Error (12700) VMM cannot complete the Hyper-V operation on the server because of the error: Failed to import the virtual machine from import directory . Error: One or more arguments are invalid (0x80070057) (Unknown error (0x8005))
Workaround:
To work around this issue, follow these steps:
Locate the exported virtual machine folder, and then open the .exp file.
In the line between and , delete the GUID. Here is a sample that shows a code example from the .exp file and the value that you should remove:
222dea57-bedd-465c-8fe4-54f2ad7ae699 ** => DELETE THIS GUID**
Save the changes, and then exit Notepad.
Import the modified virtual machine again.
代码
Option Explicit
Dim WMIService
Dim VMList
Dim VM
Dim VMSystemGlobalSettingData
Dim VMManagementService
Dim Result
'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject("winmgmts:\\.\root\virtualization")
'Get a VMManagementService object
Set VMManagementService = WMIService.ExecQuery("SELECT * FROM Msvm_VirtualSystemManagementService").ItemIndex(0)
'Get all the MSVM_ComputerSystem object
Set VMList = WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem")
For Each VM In VMList
if VM.Caption = "Virtual Machine" then
Set VMSystemGlobalSettingData = (VM.Associators_("MSVM_ElementSettingData", "Msvm_VirtualSystemGlobalSettingData")).ItemIndex(0)
VMSystemGlobalSettingData.ScopeOfResidence = ""
Result = VMManagementService.ModifyVirtualSystem(VM.Path_.Path, VMSystemGlobalSettingData.GetText_(1))
end if
Next
SO娱乐城:真_人.足球.彩票齐全| 开户送10元.首存送58元.手机可投ц注任何游戏顶级信用ц提现即时到账SO.CC