I am trying to cross migrate VM across two Vcenters ( from 6.5 to 7.0)
with move-vm command, but something is wrong, couldn't find my test-vm, even basic get-vm find it.
$global:DefaultVIServers
Name Port User
---- ---- ----
host1.. 443 x.LOCAL\Admini...
host2.. 443 y.LOCAL\Admini...
$destination = 'new-host'
get-vm test-vm
Name PowerState Num CPUs MemoryGB
---- ---------- -------- --------
test-vm PoweredOff 2 4.000
Move-VM -VM test-vm -Destination $destination
Move-VM : 10/12/2022 7:16:06 AM Move-VM Could not find VirtualMachine with name 'test-vm'.
At line:1 char:1
+ Move-VM -VM test-vm -Destination $destination
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (test-vm:String) [Move-VM], VimException
+ FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM
Move-VM : 10/12/2022 7:16:06 AM Move-VM Value cannot be found for the mandatory parameter VM
At line:1 char:1
+ Move-VM -VM test-vm -Destination $destination
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Move-VM], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM
trying with -Server option: not works, looks that I can use this option only once in whole command
Move-VM -VM test-vm -server 'host1' -Destination $destination -Server 'host2'
Move-VM : Cannot bind parameter because parameter 'Server' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3".
At line:1 char:98