Am trying to migrate Esxi host from one vCenter to another vCenter
Backup vDS from Source vCenter with Port Group Identifiers
Import the backed up vDS on New vCenter
Disconnect the host from Old vCenter and then connect them in new vCenter and add to imported vDS
Am trying to do all the above using powercli, I was able to export and import vDS with no issues.
I was able to disconnect the host from old vCenter and add it to new vCenter
When I saw virtual switch on the esxi host it seems like it has reference of vDS from old vCenter. When I try to add to vDS on the new vCenter it works if I do it manually. But if I do it with powercli it throws back host is already added to switch. Any idea how do I do this ?
Command -->
$dest_vds = Get-VDSwitch -Location $datacenter -Server $newvc -ErrorAction Stop
$dest_vds | Add-VDSwitchVMHost -VMHost (Get-VMHost -Name $esxi -Server $newvcenter) -ErrorAction Stop
$dest_vds -> vDS on new vCenter
Error --> Add-VDSwitchVMHost : 01/21/2020 22:17:47 Add-VDSwitchVMHost VMHost 'labesxihost.labtzu.com' is already added to VDSwitch 'Lab-Fx-SWT'