Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

VMware VirtualCenter Server service fails with the error: Violation of PRIMARY KEY constraint 'PK_VPX_GUEST_DISK' (1020317)

Last Updated: 4/22/2019Categories: TroubleshootingTotal Views: 15104Language:
English

Subscribe to get an email
newsletter with new updates

Please provide article feedback:

Symptoms

The VMware VirtualCenter Server service fails to start

The VMware VirtualCenter Server service is up and running, but hosts report the warning:

Cannot synchronize host. database temporarily unavailable or has network problems.

In the vpxd log of vCenter Server, you see entries similar to:

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 (?, ?, ?, ?)"

Purpose

Overview

The vCenter Server database is case insensitive. This issue occurs when a Linux virtual machine presents two duplicate mount points that are distinguished by case to the vCenter Server database.

For example, the Linux guest sees the following as two separate mount points:

/dev/mapper/mount1 on /opt/Folder1

/dev/mapper/mount2 on /opt/folder1

To vCenter Server, however, the two mount points appear to have the same value. This violates primary key constraints and causes the VirtualCenter Server service to fail.

Note: Only Microsoft SQL exhibits this behavior. Oracle and IBM DB2 use case sensitive databases and therefore do not exhibit this behavior.

Resolution

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:

Enable trivia logging on vCenter Server. For more information, see Enabling trivia logging in VirtualCenter (1001584).

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.

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

1020317_recreate_vpx_guest_disk.zip

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Windows 仮想マシンでの MAC アドレスの変更 (1008473)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-3 of 3

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware VirtualCenter

VMware vCenter Server

Related Versions:

VMware VirtualCenter 2.5.x

VMware vCenter Server 4.1.x

VMware vCenter Server 4.0.x

Take Our Survey

Support Assistant