Friday 2 November 2012

Change ODBC DSN User name and Password on vCenter Server and SQL DB

Yesterday I just got messed up with the SQL System DSN of vCenter and SQL Servers but later resolved it somehow. All this lead to little deep dive to SQL authentication from vCenter upto windows registry. Interesting!!

Issue:

I'm using vCHB server (IP 172.x.x5), on both HB  servers I have configured the ODBC DSN SQL with account "vcenter_ID" and  same has been configured in SQL studio as well having proper access to  VC DB that is being used... Everything was running perfect but due to  some security issue we change MS SQL "sa" password and by some other  means we switchover the heartbeat of VC from one server to another HB  server ( this restarted the vCenter Service). Post this, I found that  vCenter service was not coming online.

When I checked the SQL logs, I found "sa" is not able to login from (IP 172.x.x5)

Now I'm confused, why this happened and when I change my "sa" password back to old .. and vCenter Service got started.

I'm  using "vcenter_ID" account in DSN and DB for vcenter connection how it  was affected by changing "sa" password. Can anyone please help me to  sort this out.

S/W version used:
1. vcenter 5.0 patch7
2. sql 2008
3. vCHB Server 6.5.3



Root Cause:

Initially when VC was installed, we used "sa" account but later on in DSN it was changed to "vcenter_ID"... due to this "sa" was stored in registry of SQL server... and was not updated automatically when user changed to "vcenter_ID"


Resolution:

              Change user in vCenter registry

·         Take a full backup of the registry prior to editing it. Do not skip this step.
·         Click Start > Run, type “regedit” and click OK.
·         In the Windows Registry Editor, navigate to:
·         HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VirtualCenter\DB (under My Computer)
·         For vCenter Server 5.0: HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VirtualCenter\DB
·         Right-click 2 and click Modify.
·         Enter the database user ID “vcenter_ID” in the Value data field.
·         Click OK.

Now we need to update the password used by the vCenter Server for database connections to the SQL Database in registry following below steps:

·         Click Start, right-click Command Prompt, and select Run as administrator to open a command prompt as an administrator.
·         Run this command:  “C:\Program Files\VMware\Infrastructure\VirtualCenter Server\vpxd.exe –p”
·         Enter a new password when prompted. (password of “vcenter_ID”)



Posted in VM Community as well: