To resolve this issue follow the steps below:
- Restore vCenter Server to a state before the upgrade or migration.
- Restore the vCenter Server database from a backup.
- Retrieve the vCenter Server database password. See Delete old tasks, events and statistics data in vCenter Server 5.x and 6.x (2110031)
- Microsoft SQL Server Express
- Log in as an administrator to the vCenter Server machine.
- Open the command prompt and run the following command:
sqlcmd -E -S IP-address-or-FQDN-of-the-database-machine\instance_name -d database-name
- Log in as an administrator to the machine on which Microsoft SQL Server is installed.
- Open the command prompt and run the following command:
sqlcmd -S IP-address-or-FQDN-of-the-database-machine\instance_name -U vCenter-Server-database-user -P password -d database-name
- Log in as an administrator to the Oracle database machine.
- Log in to sqlplus with the vCenter Server database user name and password:
sqlplus vCenter-Server-database-user/password
- Log in as an administrator to the vCenter Server machine
- Run the script by using psql and provide the database password when prompted:
- For vCenter Server, open a command prompt and run the following command:
%VMWARE_CIS_HOME%\vPostgres\bin psql -U vCenter-Server-database-user -d database-name
- For vCenter Server Appliance, log in to the appliance shell and run the following command:
/opt/vmware/vpostgres/current/bin/psql -U vCenter-Server-database-user -d database-name
- Log in to the vCenter Server database and run the following command:
DELETE FROM VPX_VM_CONFIG_INFO WHERE ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_VM_STATIC_OVERHEAD_MAP WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_VM_FILE_LAYOUT_EX WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_VM_DS_SPACE WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_VM_FLE_DISK_LAYOUT WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_COMPUTE_RESOURCE_DAS_VM WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_VM_FLE_FILE_INFO WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_VM_FLE_SNAPSHOT_LAYOUT WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_COMPUTE_RESOURCE_DRS_VM WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
DELETE FROM VPX_GUEST_DISK WHERE VM_ID NOT IN (SELECT ID FROM VPX_VM );
- Run the upgrade or migration again.