What is the best way to add VMkernel virtual adapters when migrating a host using VDS from vCenter1 to vCenter2? I've attached a sample script I'm using for the process. The last Add-VDSwitchPhysicalNetworkAdapter command fails with a "Value cannot be null" error.
For background, I have a source vCenter Server (version 5.0) and a target vCenter Server (version 5.5). I would like to do a hot migration of a host that uses VDS from vCenter1 to vCenter2. If I run the script step by step, everything works as expected until the Add-VDSwitchPhysicalNetworkAdapter command. I can then complete the process manually using the following process in the vSphere Client:
Hosts and Clusters -> Select host -> Configuration -> Networking -> vSphere Distributed Switch -> Manage Virtual Adapters (for the appropriate VDS) -> Add -> Migrate existing virtual adapters
After completing the manual steps above, I can then remap the VMs and then remove the old VDS (which no longer exists).