I have just had the pleasure of running into this bug when replacing a ESXi host in our vsphere cluster.
There is no fix but a workaround. And thats all fine... except there is no description for a workaround if you are running VCSA...
Have anyone else had this problem with VCSA? and maybe now if there's a fix... workaround.. anything.
Thanks
/Tomas
To answer my own question.
enable SSH access to your VCSA.
login in as root
Stop vxpd service
service vmware-vpxd stop
A good thing is also to take a backup of your database.
VMware KB: Backing up and restoring the vCenter Server Appliance vPostgres database
Connect to postgresql
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
Run:
select id,name,port_counter FROM VPX_DVS;
That gives you an output of the distributed switches
VCDB=# select id,name,port_counter FROM VPX_DVS;
id | name | port_counter
----+-----------------------+--------------
47 | blabla-dvs-storage01 | 2
32 | blabla-dvs-mics01 | 266
50 | blabla-dvs-storage02 | 0
Next run select om the ID's of the switches
select * from VPX_DVPORT_MEMBERSHIP WHERE DVS_ID=<switchID>;
Take a note of the highest number you can find in the DVPORT_KEY column
Do the same for the rest of the dvswitches ID's.
Update the port_counter table with the correct value.
UPDATE VPX_DVS SET port_counter=<insert the highest number you got earlier+1. ex. If you got 18 then 19 would be the correct value here) WHERE id=<switchID>;
To the same for the rest of the distributed switches.
quit postgresql
/q
Start vxpd service.
service vmware-vpxd start
To answer my own question.
enable SSH access to your VCSA.
login in as root
Stop vxpd service
service vmware-vpxd stop
A good thing is also to take a backup of your database.
VMware KB: Backing up and restoring the vCenter Server Appliance vPostgres database
Connect to postgresql
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
Run:
select id,name,port_counter FROM VPX_DVS;
That gives you an output of the distributed switches
VCDB=# select id,name,port_counter FROM VPX_DVS;
id | name | port_counter
----+-----------------------+--------------
47 | blabla-dvs-storage01 | 2
32 | blabla-dvs-mics01 | 266
50 | blabla-dvs-storage02 | 0
Next run select om the ID's of the switches
select * from VPX_DVPORT_MEMBERSHIP WHERE DVS_ID=<switchID>;
Take a note of the highest number you can find in the DVPORT_KEY column
Do the same for the rest of the dvswitches ID's.
Update the port_counter table with the correct value.
UPDATE VPX_DVS SET port_counter=<insert the highest number you got earlier+1. ex. If you got 18 then 19 would be the correct value here) WHERE id=<switchID>;
To the same for the rest of the distributed switches.
quit postgresql
/q
Start vxpd service.
service vmware-vpxd start