vCenter Server does not start when connecting to an Oracle database with the vpxd.log error: Unable to get exclusive access to VC repository
search cancel

vCenter Server does not start when connecting to an Oracle database with the vpxd.log error: Unable to get exclusive access to VC repository

book

Article ID: 340912

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • When connecting to an Oracle database, vCenter Server fails to start.

  • The C:\ProgramData\VMware\VMware VirtualCenter\Logs\vpxd.log file contains error messages similar to:

    [00336 error 'App'] [Vdb::LockRepositoryHelper] SQLExecDirect failed: HY000:6510:ODBC error: (HY000) - [Oracle][ODBC][Ora]ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at line 10
    [00336 error 'App'] Unable to get exclusive access to VC repository. Please check if another VirtualCenter instance is running against the same database schema.

  • In the C:\ProgramData\VMware\VMware VirtualCenter\Logs\vpxd.log file on vCenter Server 5.0, you see entries similar to:

    2012-01-15T12:16:15.989+03:00 [04044 info 'Default'] [Vpxd::ServerApp::Init:841] Calling: VpxdCharacterizeThreadpool(ltud)
    2012-01-15T12:16:15.989+03:00 [04044 info 'Default'] [Vpxd::ServerApp::Init:842] Calling: VpxdCertificate_Load(gDB, CERTIFICATE_VMDBPATH )
    2012-01-15T12:16:15.989+03:00 [04044 info 'Default'] [Vpxd::ServerApp::Init:843] Calling: VpxdVdb::Init(VpxdVdb::GetVcVdbInstId(), false, false, NULL)
    2012-01-15T12:16:15.989+03:00 [04044 info 'Default'] Registry Item DB 5 value is '50'
    2012-01-15T12:16:20.145+03:00 [04044 error 'Default'] [Vdb::LockRepositoryHelper] SQLExecDirect failed: HY000:20001:ODBC error: (HY000) - [Oracle][ODBC][Ora]ORA-20001: Failed to Lock vCenter Repository!!
    --> ORA-06512: at line 1
    -->
    2012-01-15T12:16:20.145+03:00 [04044 error 'Default'] Unable to get exclusive access to vCenter repository. Please check if another vCenter instance is running against the same database schema.
    2012-01-15T12:16:20.177+03:00 [04044 error 'Default'] [Vpxd::ServerApp::Init] Init failed: VpxdVdb::Init(VpxdVdb::GetVcVdbInstId(), false, false, NULL)
    2012-01-15T12:16:20.177+03:00 [04044 warning 'VpxProfiler'] ServerApp::Init [TotalTime] took 4188 ms
    2012-01-15T12:16:20.177+03:00 [04044 error 'Default'] Failed to intialize VMware VirtualCenter. Shutting down...
    2012-01-15T12:16:20.192+03:00 [04044 info 'Default'] Wrote uptime information
    2012-01-15T12:16:20.208+03:00 [04044 error 'Default'] Alert:false@ d:/build/ob/bora-455964/bora/vpx/vpxd/util/vpxdVdb.cpp:408
    --> Backtrace:
    --> backtrace[00] rip 000000018013d40a (no symbol)
    --> backtrace[01] rip 00000001800ffa38 (no symbol)
    --> backtrace[02] rip 00000001800fffee (no symbol)
    --> backtrace[03] rip 0000000180094b8a (no symbol)
    --> backtrace[04] rip 000000013f5b8763 (no symbol)
    --> backtrace[05] rip 000000013feff5ce (no symbol)
    --> backtrace[06] rip 000000013feff7b3 (no symbol)
    --> backtrace[07] rip 000000014011dea7 (no symbol)
    --> backtrace[08] rip 000007feff34a82d (no symbol)
    --> backtrace[09] rip 000000007731652d (no symbol)
    --> backtrace[10] rip 000000007744c521 (no symbol)
    -->

    Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.


Environment

VMware vCenter Server 4.0.x
VMware vCenter Server 4.1.x
VMware vCenter Server 5.0.x

Resolution

This issue can occur when VirtualCenter Server service has not exited gracefully when the operating system shuts down, or when other system events cause the VirtualCenter Server service to stop abruptly. Because of this, the Oracle network is not able to detect termination of a previous connection between the vCenter Server and the Oracle server. It then seems as though the previous session is still running, and the lock from the previous session is not released.
This issue is resolved in vCenter Server 5.5. You can download the latest vCenter Server release, available at VMware Downloads.

To avoid this problem, enable KeepAlive parameters on the Oracle server and on the vCenter Server machine.

Note: These parameters can also be used on a SQL server, to resolve locks with the database.

To enable the parameters on the Oracle server:

  1. Configure TCP/IP KeepAlive parameters on the Oracle database.

    • On Windows, set these DWORD parameters in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters:

      • KeepAliveTime = 60000 (where the value is in milliseconds, so it is equal to 60 seconds or one minute)
      • KeepAliveInterval = 1000 (where the value is in milliseconds, so it is equal to 1 second)
      • TcpMaxDataRetransmissions = 5

    • On Linux, add these entries in the /etc/sysctl.conf file:

      • net.ipv4.tcp_keepalive_time=3000 (where the value is in seconds, so it is equal to 50 minutes)
      • net.ipv4.tcp_retries2=5
      • net.ipv4.tcp_syn_retries=1

  2. To apply the new TCP/IP parameters, perform one of these options:

    • Reboot Windows.
    • On Linux, run sysctl -p.

  3. Configure Dead Connection Detection (DCD) by adding this entry in the $ORACLE_HOME/network/admin/sqlnet.ora file:

    SQLNET.EXPIRE_TIME = 1

To enable the parameters on the vCenter Server machine:

  1. Configure TCP/IP KeepAlive parameters by adding these DWORD keys in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters:

    • KeepAliveTime = 60000 (where the value is in milliseconds, so it is equal to 60 seconds or one minute)
    • KeepAliveInterval = 1000 (where the value is in milliseconds, so it is equal to 1 second)

  2. Shut down vCenter Server to close existing Oracle connections.
  3. Restart the server to apply the new TCP/IP parameters.

As an alternative workaround, create a shutdown script that stops the vCenter Server service when Windows shuts down. This automatically releases the database connection.

  1. Create a Windows command file (a text file ending in .cmd).
  2. Open the file for editing, and add this command:

    net stop /y vpxd
    ping -n 61 127.0.0.1 > null

  3. Save the changes and exit from the batch file.
  4. Open the Windows Group Policy Editor, gpedit.msc.
  5. Go to Computer Configuration > Windows Settings > Scripts (Startup/Shutdown).
  6. Right-click Shutdown and click Properties.
  7. Click Add.
  8. Enter the name of the command file that you created in step 1.
  9. Click OK twice to save the changes.
  10. Exit the Windows Group Policy Editor.
Additional Information:
For translated versions of this article, see: