Post migrating the embedded vCenter DB to external Database vCenter inventory shows empty or vCenter service fails to start on vCenter 5.5
Recently I encountered a problem in customer’s environment where customer went ahead from migrating embedded SQL express DB to a external fully blown SQL DB. Once migration was completed services resumed but vCenter was showing empty inventory.
We went ahead and verified ODBC connection and it was properly configured with the new database. But yet we encountered the issue.
Checked the vpxd logs to verify below mentioned error messages was being triggered.
Path would be C:\ProgramData\VMware\VMware Virtual Center\Logs\vpxd.log.
2016-10-21T09:40:09.823+01:00 [11076 info ‘utilvpxdVdb’] Registry Item DB 5 value is ’50’
2016-10-21T09:40:09.824+01:00 [11076 info ‘utilvpxdVdb’] [VpxdVdb::SetDBType] Logging in to DSN: VMware vCenter with username vpxuser
2016-10-21T09:40:09.831+01:00 [11076 error ‘utilvpxdVdb’] [VpxdVdb::SetDBType]: Login failure – retrying once.
2016-10-21T09:40:09.831+01:00 [11076 error ‘utilvpxdVdb’] [VpxdVdb::SetDBType] Failed to connect to database: . Retry attempt: 1 …
2016-10-21T09:40:11.774+01:00 [04608 warning ‘VpxProfiler’ opID=SWI-41a7] VpxUtil_InvokeWithOpId [TotalTime] took 12000 ms
2016-10-21T09:40:19.832+01:00 [11076 info ‘utilvpxdVdb’] [VpxdVdb::SetDBType] Logging in to DSN: VMware vCenter with username vpxuser
2016-10-21T09:40:19.840+01:00 [11076 error ‘utilvpxdVdb’] [VpxdVdb::SetDBType] Encountered login error. Subsequent connection attempt failed: 28000
2016-10-21T09:40:19.840+01:00 [11076 error ‘utilvpxdVdb’] [VpxdVdb::SetDBType] Aborting after 1 retries.
2016-10-21T09:40:19.840+01:00 [11076 error ‘Default’] Error getting configuration info from the database.
2016-10-21T09:40:19.840+01:00 [11076 warning ‘vpxdvpxdMain’] Database not initialized. Nothing to unlock
2016-10-21T09:40:19.841+01:00 [11076 info ‘Default’] Forcing shutdown of VMware VirtualCenter now
Based on logs we determined that vCenter is still expecting the older database to connect due to which it leads to a conflict and configuration files will yet reflect to the older database since vCenter is not aware that the DB has been migrated.
We need to perform following steps to ensure vCenter is properly communicating to the actual database.
If the username via which database was authenticating has been changed then they need to be manually entered in the registry as per below steps
- Take a backup of the Windows registry before proceeding.
- Click Start > Run, type regedit, and click OK. The Registry Editor window opens.
- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware Virtualcenter\DB.
- Edit Key 2 and enter the username in the value data field.(this user name would be the respective user configured to establish ODBC connectivity.)
Note:If the username was configured using SQL authentication then vCenter service service should configured as local system. In case the ODBC has been configured using domain account then the vCenter server service should be configured using same domain account.
Once above steps have been performed, in order to reestablish the connectivity with the vCenter from the new DB we need to perform below mentioned steps.
- Open a command prompt as an administrator.
- Change to the vCenter Server directory by running the command:cd “C:\Program Files\VMware\Infrastructure\VirtualCenter Server” Where C:\ is the drive where vCenter Server is installed.
- Run the command: vpxd.exe -p
- It will prompt you to type a new password, this password would be the same password used during configuring the ODBC connection for the. Underlying username. Retype the password to confirm it.
- Restart the vCenter server service now.
This should ideally fix the issue.