Service cannot be started. Microsoft.VirtualManager.DB.CarmineSqlException: Unable to connect to the VMM database. Ensure that the SQL Server is running and configured correctly
I am setting up SCVMM 2012 R2 in a production environment. Whenever I restart the SCVMM virtual machine the VMM service doesn't start automatically, I have to manually start it. I checked the VMM logs and in the event viewer i find the below error,
Service cannot be started. Microsoft.VirtualManager.DB.CarmineSqlException: Unable to connect to the VMM database. Ensure that the SQL Server is running and configured correctly. ---> System.Data.SqlClient.SqlException: Cannot open database "VirtualManagerDB"
requested by the login. The login failed. Login failed for user 'NXTRA\VMMSVC'. at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&
dataReady) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.Sq...
I added the 'VMMSVC' account as db_owner and sysadmin and also NT_Authority\System with same permissions still the service doesn't start on the start up.
I googled a lot and I find the threads with the error containing "General failure" but not with the above. Can someone please help me to find out why this error is occuring.
It's often only a problem of the service dependencies. SCVMM starts to fast, SQL server on the same machine in not initialized yet. Here are working service dependencies to ensure SQL server is initializes before SCVMM starts.
You can set the service dependencies directly in regedit (as always: be careful modifying the registry ...)
Here is the content of a reg file setting the dependency.
Windows Registry Editor Version 5.00