Hi All,
Getting the below error when trying to migrate using the attached script. Debug shows that the object types being passed to the Move-VM parameters are correct. Thanks in advance..
None of the 2 Vmware flings for cross-VC migration also works
Move-VM The operation for the entity "FAPL_s65nbu05" failed with the following message: "A general system error occurred: The requested name is valid, but no data of the requested type was found"
+ $vm | Move-VM -Destination $destination -NetworkAdapter $networkAdapt ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Move-VM], SystemError
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM
#Variables
$sourceVC = 'mySourceVC'
$sourceVCUsername = 'administrator@vsphere.local'
$sourceVCPassword= 'MySecurePW'
$destVC = 'myDestinationVC'
$destVCUsername = 'administrator@sso.mydomain.local'
$destVCPassword= 'S3cur3p@$$'
$Vmhosts = '10.10.10.10'
$vms = 'vm_to_migrate'
# Connect to the vCenter Servers
$sourceVCConn = Connect-VIServer -Server $sourceVC -user $sourceVCUsername -password $sourceVCPassword
$destVCConn = Connect-VIServer -Server $destVC -user $destVCUsername -password $destVCPassword
Foreach ($vm in $vms) {
$vmobj = Get-VM $vm -Server $sourceVC
$strVMdatastore = ($vmobj | get-datastore).name
$networkAdapter = $vmobj | Get-NetworkAdapter
$strSourceVDPG = ($networkAdapter | Get-VDPortgroup).name
$destinationHost = Get-VMHost -name $vmhosts -Server $destVCConn
$destinationPortGroup = Get-VirtualPortGroup -name $strSourceVDPG -Server $destVCConn
$destinationDatastore = Get-Datastore $strVMdatastore -Server $destVCConn
Move-VM -VM $vmobj -Server $destVC -Destination $destinationHost -NetworkAdapter $networkAdapter -PortGroup $destinationPortGroup -Datastore $destinationDatastore
}
Try it in "manual mode" using the utility Cross vCenter Workload Migration Utility
Maybe the problem is not in the script.
Does that VM have more than 1 vNIC?
If yes, I suspect that the NetworkAdapter and Portgroup parameters should have values of the same size (i.e. arrays of the same dimension).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc - The VM has only 1 nic and 1 virtualdisk
Tried this previously. Interestingly enough, it was throwing the exact same error
Are the vCenters in the same SSO domain, or in different SSO domains?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Different sso domain. It's supposed to work even for different sso domain..
Oops, it's in the title of the thread :smileygrin:
In any case, did you already try with William's xMove.ps1 script?
See When to use Move-VM cmdlet vs xMove.ps1 script for performing Cross vCenter vMotions?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Maybe you are migrating VM between Distributed Switch and Standard Switch?
Nope, both source and destination are distributed switch
Nope. will give it a try
Hello Luc - Tried Williams script, got the same error. Also realized that his script has been ported over to move-vm since PowerCLI 6.5, (I'm using v 10) so I'm essentially using the same thing. Would be great if VMware can look into this, afraid it's one of those features that have been rushed out.
Would also be great if VMware can make the '-networkAdapter' parameter of move-vm take a hastable value that "maps" a networkAdapter name to a target portgroup if a VM has multiple NICs. Move-VM cannot handle multiple NICs at the moment
I suggest you open a SR.
And yes, PowerCLI is supported, see PowerCLI Support Breakdown
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference