Migrate VM To NSX-T logicalswitch( Opaquenetwork). If you want to migrate vm to opaquenetwork in another vcenter , then copy the method(reconfigVMNicConnection()) from this sample and replace into in my another sample -i.e, https://code.vmware.com/samples/4607/migrate-a-vm-to-dvportgroup-in-a-second-vc--crossvc dvs vmotion?
MigrateVMToOpaquenetwork.java