This issue was a bad incident which we faced in one of my clients environments. vCenter was not accessible due to a hardware failure and the entire environment was configured using the distributed switches. vCenter was recovered with a backup and registered in an ESXi host, but connectivity to a distributed port was not successful. This is my personal experience and this how I resolved it.
When I was trying to add the vCenter to the distributed port group it was throwing the below error message. I know, it’s a configuration option in distributed portgroup, but it is not the time to change the configuration.
Addition or reconfiguration of network adapters attached to non-ephemeral distributed virtual port groups is not supported.
So I decided to create a standard switch in the ESXi host and add an uplink which is consumed by the distributed switch. The available throughput and the redundancy will be impacted, but recovering the vCenter was crucial at this point.
Command line tools can easily be used in this scenario and you can either use the GUI interface, I preferred to use the command line.
I created a new Standard Switch Portgroup called “VMnetwork” with the below command
esxcfg-vswitch -A VMnetwork vSwitch0
If you don’t have a Standard vSwitch available you can create it, using below command
esxcfg-vswitch -a [vSwitch_name]
Checked the Standard Switch portgroup creation and the Distributed Switch Uplink assignment with below command and also the distributed port ID (DVPort ID) connected the uplinks
Removed the uplink from the Distributed Switch. In my case vmnic2 which was assigned to the 9967 port
esxcfg-vswitch -Q -v 9967 [distributed_switch_name]
Added the uplink to the created Standard Switch using the below command
esxcli network vswitch standard uplink add --uplink-name=[vmnic_name] --vswitch-name=[vSwitch_name]
Checked the switch status and the uplink assignment again
Once the Standard vSwitch is created and assigned the uplink, I connected the recovered vCenter to the created portgroup and restore the connectivity. Migrating the Standard Switch portgroup to Distributed Switch portgroup can be performed later and uplinks can be reconfigured.
Again, this is how I resolved it and if you think you have some other workaround or fix to the same situation feel free to share it in a comment.