While trying to move a host from an NSX prepared cluster with security to another NSX cluster, or when adding a standalone host to an NSX cluster, NSX fails to install.
The transport node preparation shows a Failed status with the error: Failed to send the HostConfig message. [TN=TransportNode/########-####-####-####-###########]. Reason: Failed to send HostConfig RPC to MPA node:########-####-####-####-############.
The error is repeatable, appearing each time the host is moved out and back into the cluster, or when moved into the original cluster.
VMware NSX 4.x
NSX was not properly uninstalled from the host.
Evacuate the host & remove the host from the cluster.
Ensure the host is not visible in the UI: System > Fabric > Hosts > Clusters, also check Other Nodes, and Standalone.
If the Host is still found on one of those locations, choose to Remove NSX.
Once that has completed successfully, from the command line of the ESXi host:
net-dvs -l | grep com.vmware.nsxnsxcli -c del nsxnet-dvs -l | grep -E "^switch|com.vmware.nsx.*.enable|com.vmware.common.alias"net-dvs -u com.vmware.nsx.<property>.enabled -p hostPropList <dvsName>net-dvs -u com.vmware.nsx.kcp.enable -p hostPropList <dvsName>Re-add the affected host to the new cluster, and NSX preparation of the host should complete successfully.