INSERT INTO VPX_DVPORT_MEMBERSHIP WITH (ROWLOCK) (DVS_ID, DVPORT_KEY, DVPORTGROUP_ID, HOST_ID) VALUES (?, ?, ?, ?)
, you see the error similar to:ODBC error: (23000) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'PK_VPX_DVPORT_MEMBERSHIP'. Cannot insert duplicate key in object 'VMW.VPX_DVPORT_MEMBERSHIP'. The duplicate key value is (6653, 0).
/var/log/vpxd.log
file.This issue occurs when a DVS configuration which was backed up and restored on vCenter Server, allocates a port ID that is not existent in memory but exists in the database.
Violation of PRIMARY KEY constraint
error message:4. Start the VMware VirtualCenter Server service.