Posted by: Akutz
Andrew Kutz, VMware
The VirtualCenter2 management service (vpxd) is not very robust. If it cannot connect to the back-end database, the service will halt. It *should* continue to run, periodically trying to connect to the database, but this is not the case. There are also problems with the service coming up before the network when the server boots, causing the service to halt upon start. IPSec SA token mismatch/renewal issues also cause the service to halt. The vpxd service is very important — it manages DRS, collects performance statistics, and allows users to manage their VMs. This is a service that should be a lot more capable of handling foreseeable circumstances. To that end I have written a script that can be used to restart the vpxd service in case it halts or fails to start. This script can be linked to an often underutilized feature of Windows — the ability for the Service Control Manager (SCM) to restart a service upon failure.
The script is fairly basic. I will not post it in its entirety in this blog because its formatting will get munged by WordPress’ draconian style settings. You can download the script from www.lostcreations.com.
A description of the script can be found in the script’s source, “This script will attempt to start the vpxd service if it is not started. If the serivce is already started or it starts successfully the first time no further action is taken. This script can also be run upon a VCMS failure. It will notify a specified e-mail address of the failure. It will check the connection to the VCMS database. If the database connection is valid then the script will start the VCMS service. If the connection is not valid then the script will go into a loop, attempting to restart the VCMS service every specified number of minutes. This script assumes your VC database is on a SQL server. If it is not then please see www.carlprothman.net for a good reference on how to build an ADO connection string to fit your needs.”
In addition to using this script to correct a vpxd service failure, it can also be run as a scheduled task, set to run 5 minutes after the server boots. This can correct the problem of the vpxd service not starting successfully on boot because it comes up before the network is available.
I hope this script helps to make your VMware VirtualCenter2 Management Server a little more robust, and a lot more script-diddly-licious!