In my previous post I wrote about patching a VCSA box. At the end of that patching processes a reboot (according to VMware) is an optional step. However, in my case, the vCenter Web Services didn’t appear to have restarted correctly. A reboot ultimately did resolve that issue for me, but it did start me thinking about how would I go about restarting VCSA services if the Web Client was down. It turns out vCenter 6 has a new recommended way of restarting services using the Service Control command for both the VCSA and the Windows version.
As with my post on modifying NTP settings. Restarting services can be done via two methods, the Web Client or via the console. Method 1 is the easiest when access to the Web Client is there. Method 2 relies on using the VCSA console when access to the Web Client doesn’t exist or is lost.k
Restarting services via the Web Client
On the Home screen of the Web Client select Administration -> System Configuration
Click on the Services button on the right pane.
As I’ve mentioned previously finding what you want in the Web Client isn’t always intuitive as you might think. Clicking on Services in the left pane isn’t what you want. Rather clicking on the Services tab button on the right pane gives you a better overall status of services.
From here was can right click on any services, start, stop, restart, edit startup, and change settings on that service. Not all services have modifiable settings via the Web Client. This options will show up grayed out. Once you change the state of a service you’ll find you have to refresh the page for the next state to be displayed correctly.
Restarting services via the Console
I’ll assume you already know how to enable and have access to SSH or at least the Remote Console. If not I cover enabling SSH here.
You may come across doco that says you have to enable and enter the pi shell / bash, but this isn’t required. Everything can be done from the VMware Command prompt
We can start of by running a command that simply lists services.
Command> service-control --list
This will list all vCenter specific services. We can then run service-control --status for a bit of a messy view of what’s currently Running and Stopped.
Command> service-control --status
Unlike the Web Client there is no restart Service Control switches, Only start and stop. To stop a service we run the below at the prompt. servicename being the name of a service displayed using --list
Command> service-control --stop servicename
or to start
Command> service-control --start servicename
You can also use the --all switch in place of servicename. I see this as a bit of a catch all. Using this switch will only start services that have a startup type of Automatic and are currently stopped. If a service is currently running it will be skipped. This is a great way to get everything back up and running quickly.
Command> service-control --start --all
The reverse is true when using --all to stop services. All services that have a startup type of Automatic and are currently running will attempt to be stopped. Everything else will be skipped.
Command> service-control --stop --all
There are two final switches that can also be used with the --all. --ignore and --dry-run. The --ignore will continue to start or stop all services if an error is encountered at any point. --dry-run will display what actions the take place with the service without actually changing anything.
Command> service-control --start --all --ignore
Command> service-control --start --all --dry-run