I was trying to move a vm from one datacenter to the other. The destination has 2 host clusters, each with multiple hosts. All hosts connect to the same datastore cluster.
Tried this but got an error: must be on the same datacenter:
$vm | Move-VM -Destination $vmHost -Datastore $ds
But if I tried -Destination as $datacenter object, PowerCLI didn't throw an error:
$vm | Move-VM -Destination $datacenter -Datastore $ds
However, the when I looked at the vSphere Client, it showed an error:
The operation is not supported on the object.
What's the best way to move a vm to a different datacenter?