The script attached to this article prevents the VMware VirtualCenter Server service from failing when this issue occurs.
To permanently resolve this issue:
- Download 1020317_recreate_vpx_guest_disk.zip (attached to this article).
- Extract the SQL script.
- Stop the VMware VirtualCenter Server service.
- Open up and run the recreate_vpx_guest_disk.sql file within the SQL Enterprise Manager Tool on the SQL Server.
- Start the VMware VirtualCenter Server service.
Workaround:
If you cannot apply the resolution, workaround this issue by performing one of these options:
- Ensure that you use unique folder names for all mount points.
- Uninstall VMware Tools from the virtual machine that has multiple mount points. When VMware Tools is not available to send the partition information to vCenter Server, this issue does not occur.
However, before you can apply the workaround, you must determine which virtual machine is causing the problem. You may already know this information, but determining the virtual machine can be difficult in large environments.
To identify the virtual machine that is causing the failure:
-
-
When vCenter Server fails, open the vpxd.log file and identify the thread number that is causing the service to crash. For example:
[<date> <time> 'App' 1234 error] An unrecoverable problem has occurred, stopping the VMware VirtualCenter service. Check database connectivity before restarting. Error: Error[VdbODBCError] (-1) "ODBC error: (23000) - [Microsoft][SQL Native Client][SQL Server]Violation of PRIMARY KEY constraint 'PK_VPX_GUEST_DISK'. Cannot insert duplicate key in object 'dbo.VPX_GUEST_DISK'." is returned when executing SQL statement "INSERT INTO VPX_GUEST_DISK (VM_ID, PATH, CAPACITY, FREE_SPACE) VALUES (?, ?, ?, ?)".</time>
In this example, the thread number is 1234 .
-
Take the thread number and search backwards in the log until you see a set of log lines that look similar to:
[<date><time> 'PropertyProvider' 1234 trivia] RecordOp 2: summary.guest.guestFullName, vm-123456
</time>[<date><time> 'PropertyProvider' 1234 trivia] RecordOp 2: guest.guestFullName, vm-123456
</time>[<date><time> 'PropertyProvider' 1234 trivia] RecordOp 2: guest.disk, vm-123456
</time>[<date><time> 'PropertyProvider' 1234 trivia] RecordOp 2: guest.screen, vm-123456</time>
This identifies the virtual machine that is causing the failure. In this example, the virtual machine is vm-123456 .
-
To determine the virtual machine name, login to the vCenter Server database server and run the following query against the vCenter Server database:
SELECT NAME FROM VPX_ENTITY WHERE ID = '123456';
where '123456' is the number of the virtual machine identified in Step 3. The query results return the virtual machine name.