mclark
Expert
Expert

VirtualCenter service not starting on reboot

Jump to solution

My VC server VirtualCenter service will not start automatically on reboot. The SQL 2005 Express edition is installed on the same VM. I have the VC service set to depend on MSSQLSERVER, but it has not made a difference. The event viewer logs show VC trying to hit SQL before it's ready, so I assume that MSSQLSERVER shows started, and then VC tries to start, but SQL is not quite ready yet even though it's started. Anyone else having this problem and have a good way to fix it? It is not helpful to have to log into the ESX host to start the VC service every time...

Thanks!

0 Kudos
1 Solution

Accepted Solutions
geob
Enthusiast
Enthusiast

I have had a simular issue and was able to ovfercome this by creating a vbscript to check the service and start it if not running. I then set the script to run as a scheduled task.

Script Starts Here

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!
" & strComputer & "\root\cimv2")

Set colAllRunningServices = objWMIService.ExecQuery("Select * from Win32_Service")

Const EVENT_SUCCESS = 0

Const EVENT_ERROR = 1

Set objShell = Wscript.CreateObject("Wscript.Shell")

For Each objService In colAllRunningServices

If objService.DisplayName = "VMware VirtualCenter Server" Then

If objService.State = "Stopped" Then

objShell.LogEvent EVENT_ERROR, "Virtual Center Server is Stopped"

objService.StartService()

objShell.LogEvent EVENT_SUCCESS, "AutoStartVC_V2.vbs is attempting to start Virtual Center Server"

Else

End If

Else

End If

Next

Script Ends Here

View solution in original post

0 Kudos
45 Replies
wpatton
Expert
Expert

mclark,

I have run into this a few times before. What we did is set it to depend on the MSSQLSERVER service, but then also set the VC service to Restart on First and Second failures. That seemed to give it the time necessary to wait for SQL to become fully available.

*Disclaimer: VMware Employee* If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
mclark
Expert
Expert

I just looked at the service. 1st, 2nd and subsequent failures show "Restart the Service" with the fail count reset after 1 day and the "restart after" set to 2 minutes.

0 Kudos
wpatton
Expert
Expert

This might actually be an AD problem and not just SQL. I assume VC is running as an AD process user, and if AD is not yet available that will cause VC to not start properly. Try adding this to your vpxd.cfg file in the <config> section:

<security>

<ignoreUserResolveFailures>true</ignoreUserResolveFailures>

</security>

*Disclaimer: VMware Employee* If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
mclark
Expert
Expert

I checked and the VC service is set to "Local System account".

0 Kudos
scerazy
Enthusiast
Enthusiast

Same problem here, was through ALL the troubleshoting available, but none of it helped

I just live with connecting to server after reboot & starting it by hand

Seb

0 Kudos
fishface
Contributor
Contributor

We have the same issue.

At first we thought it was a VC update 2 issue, however rolling back to a fresh database and VC 2.5 Update 1 is no better. Have found that inmstalling VC and only adding 3x ESX 3.5 hosts to the inventory is fine. The ESX Server are ver 3.5 build 64607

We have upgraded one ESX Host to Update 2 - and whenever we add this host to the VirtualCenter Inventory - things go OK - until we reboot VirtualCenter.

Starting Virtual Center Manually gives the following on the VC console... (is this the same problem as everyone else has?)

C:\Program Files\VMware\Infrastructure\VirtualCenter Server>vpxd -s

Current working directory: C:\Program

Files\VMware\Infrastructure\VirtualCenter Server

HOSTINFO: Seeing AMD CPU, numCore

sPerCPU 2 numThreadsPerCore 1.

<snip>

6 reserved short LROs

4 reserved long LROs

600-second task lifetime

Couldn't read re

gistry entry vmdbPort

Couldn't read re

gistry entry managedIP

Invoking callbac

ks for key vpxd.npivWwnGeneration.singleNodeWwn

Invoking callbac

ks for key vpxd.npivWwnGeneration.portWwnNumber

Locale subsystem initialized from C

:\Program Files\VMware\Infrastructure\VirtualCenter Server\locale/ with default locale en.

Initializing SSL Contexts

Setting VerifySSLCertificates to FALSE

Failed to initialize: notwell-formed (invalid token)

Failed to intialize VMware VirtualCenter. Shutting down...

Forcing shutdown of VMware VirtualCenter now

Cheers

0 Kudos
mclark
Expert
Expert

Here's the error I'm seeing in the VC log when it tries to start itself:

ODBC error: (28000) - [SQL Native Client][SQL Server]Login failed for user 'NT AUTHORITY\SYSTEM'.

Failed to intialize VMware VirtualCenter. Shutting down...

Forcing shutdown of VMware VirtualCenter now

That error does not appear when I start it myself after giving SQL time to boot up completely.

In the event viewer I see the following chain of events:

  • MSSQLSERVER reports that it is ready for client connections

  • The VC service says it is trying to start

  • MSSQLSERVER reports a failure to log in NT AUTHORITY\SYSTEM

  • VC service says it failed to initialize and is shutting down

  • MSSQLSERVER reports another failure to log in NT AUTHORITY\SYSTEM

  • MSSQLSERVER reports that is is starting up database tempdb and then that recovery is complete

  • I start the VC service myself, then the VC service says it is starting, and then MSSQLSERVER reports that it is starting up VIM_VCDB and VIM_UMDB

  • Finally, VC is now started and usable again

So from all of that it seem to me like MSSQL is not fully ready by the time VC tries to start.

0 Kudos
wpatton
Expert
Expert

I would try changing over the service user to a domain or local system user other than Local System Account. Since you are seeing login failures, this might also force VC to wait longer with it's attempts.

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".

*Disclaimer: VMware Employee* If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

This is an MSSQL V's VC Service issue. I see it every week in my teaching environment. You need to set the dependnancy services and ensure that MSSQL is given plenty of time tovstart up before the VC service starts.

0 Kudos
BenConrad
Expert
Expert

Set HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vpxd\DependOnService and add in MSSQLSERVER to make the virtualcenter service depend on SQL server.

0 Kudos
mclark
Expert
Expert

I agree with you completely. However, I can't see how to make VC give MSSQL plenty of time to start. There's no way to delay a service from trying to start that I can find, other than the dependencies. If someone has a way to make the VC service delay trying to start (in addition to the dependency) I'd love to find out how...

0 Kudos
mclark
Expert
Expert

Yes, I've done that. However, it seems that MSSQLSERVER technically is "started" even though it's not quite ready for connections (or at least that's what the evidence points to). So the dependency sees that MSSQL says it's ready, and VC then tries to start, but in reality MSSQL isn't really fully ready, therefore the login fails and the VC service terminates.

0 Kudos
alasdair_carnie
Enthusiast
Enthusiast

Once you have set the dependancy service, configure the service restart on first failure to two minutes. I know this is extending the time it takes to restart a VC but it seems to work in my environment.

0 Kudos
mclark
Expert
Expert

The restart on failures is set to 2 minutes, and it still does not make a difference.

0 Kudos
scerazy
Enthusiast
Enthusiast

Same here, 2 min, 5 min, no difference

Seb

0 Kudos
estoeckle
Contributor
Contributor

Note that if you have previously added "MSSQLSERVER" as a dependancy and that service does not exist on your system the service will NOT start automatically. The new VC2.5 Update 2 SQL Server 2005 Express service is called MSSQL$SQLEXP_VIM. Also for the computer_name you should use a 'backslash backslash computer_name'. This forum deletes them. Smiley Sad

For Virtual Center (2.5 Update 2 clean installation)

sc 'backslash backslash computer_name' config vpxd depend= "MSSQL$SQLEXP_VIM"

I was also having issues with the license server so I set it to depend as well.

sc 'backslash backslash computer_name' config "VMware License Server" depend= "MSSQL$SQLEXP_VIM"

These commands set registry values. You can perform them manually

For Virtual Center 2.5 Update 2

To do this, open the registry and go to HKLM\System\CurrentControlSet\Services\vpxd. Double click the "DependsOnService" entry and add the name of the SQL service to the bottom of the list. Your SQL Server service may be different than mine.

Open the registry and go to HKLM\System\CurrentControlSet\Services\VMware License Server. Double click the "DependsOnService" entry and add the name of the SQL service to the bottom of the list. Your SQL Server service may be different than mine.

  • Erick

-


There is also a similar issue with Fileservers and the Windows Server Service not starting so your shares do not come up if you are using the Microsoft iSCSI initiator.

For Windows server service

To do this, open the registry and go to HKLM\System\CurrentControlSet\Services\LanManServer. Double click the "DependsOnService" entry and add the entry "MSiSCSI".

0 Kudos
mclark
Expert
Expert

Since my installation was an upgrade from VC 2.5 and VC 2.5 U1, this command did not work because MSSQL$SQLEXP_VIM does not exist.

I think that the final solution needs to be for VMware to update the VC service so that when it starts it checks to be sure MSSQL is fully initialized before it goes on. Or, make a configurable parameter so that we can tell it to wait 2 minutes or 5 minutes or whatever before it tries to log into the database and fully start.

0 Kudos
abrjgl
Contributor
Contributor

You should upgrade to VC 2.5u2 before adding/upgrading ESX 3.5u2 hosts. I had a ESX 3.5u1 host updating to ESX 3.5u2 and got the same error. Upgrading VC 2.5u1 to VC 2.5u2 solved the problem.

The logfile you appended is from VC 2.5u1? What did VC 2.5u2 log?

0 Kudos
fishface
Contributor
Contributor

Your right - I rolled back to VC 2.5 U1 when I found the new Update 2 version didn't work. Then found it had the same issue. The log from VC update 2 is as follows :

C:\Program Files\VMware\Infrastructure\VirtualCenter Server>vpxd -s

Current working directory: C:\Program Files\VMware\Infrastructure\VirtualCenter Server

HOSTINFO: Seeing AMD CPU, numCore sPerCPU 2 numThreadsPerCore 1.

HOSTINFO: numPhysCPUs is 0, bumpi ng to 1.

HOSTINFO: This machine has 1 phys ical CPUS, 1 total cores, and 1 logical CPUs.

Log path: C:\Documents and Settings\Al l Users\Application Data\VMware\VMware VirtualCenter\Logs

Initializing SSL

Using system libcrypto, version 9 0709F

Vmacore::InitSSL: doVersionCheck = tru e, handshakeTimeoutUs = 120000000

Starting VMware VirtualCenter 2.5.0 bu

ild-84767

Log directory: C:\Documents and Settin gs\axontest\Local Settings\Application Data\VMware\vpx.

Account name: axontest

Enabled low-frag process heap.

Enabled low-frag crt heap .

34 max LROs

6 reserved internal LROs

6 reserved blocker LROs

6 reserved short LROs

4 reserved long LROs

600-second task lifetime

Couldn't read re gistry entry vmdbPort

Couldn't read re gistry entry managedIP

Invoking callbac ks for key vpxd.npivWwnGeneration.singleNodeWwn

Invoking callbac ks for key vpxd.npivWwnGeneration.portWwnNumber

Locale subsystem initialized from C :\Program Files\VMware\Infrastructure\VirtualCenter Server\locale/ with default locale en.

Initializing SSL Contexts

Setting VerifySSLCertificates to FALSE

Failed to initialize: not well-formed (invalid token)

Failed to intialize VMware VirtualCen ter. Shutting down...

Forcing shutdown of VMware VirtualCenter now

I'm waiting on Tech support currently to get a resolution.

0 Kudos