Troubleshooting

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.

 

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

 

  1. Take a backup of the Windows registry before proceeding.
  2. Click Start > Run, type regedit, and click OK. The Registry Editor window opens.
  3. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware Virtualcenter\DB.
  4. 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.

 

  1. Open a command prompt as an administrator.
  2. 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.
  3. Run the command: vpxd.exe -p
  4. 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.
  5. Restart the vCenter server service now.

 

This should ideally fix the issue.

Ritesh Shenoy
Hey, My name is Ritesh Shenoy working a Tech Support Engineer for VMware. Had an idea on blogging tasks faced on my daily basis which would ideally help other on their daily lives.

Leave a Response