It is possible to use a GUI to start up and shut down VMware vSphere clusters, but as we all know, using a GUI does not usually scale well. PowerCLI combined with a bit of PowerShell is a much better way to manage the startup and shutdown of vSphere as I will show in this article.
Unfortunately, there may be instances where it is necessary to shut down and or start up entire vSphere clusters. An example would be if there is a power outage in a datacenter and there is no generator, or if a generator malfunctions. For this reason, it is a good idea to understand not only the proper sequence for these processes, but also the most efficient one.
Since vCenter is the heart of a vSphere cluster, it is probably the most important aspect of these processes. It is important to understand that not properly dealing with vCenter during a shutdown or startup can cause many issues with VMs and hosts.
This article assumes a very simple vSphere setup, with multiple hosts: one vCenter (with local database) that is a VM in the cluster, and only one cluster. It also assumes all VMs have VMtools running, which is necessary for shutdown with PowerCLI.
Shutting down a vSphere cluster
The process of shutting down a cluster is as follows:
- Shut down all virtual machines (VMs) except for the vCenter VM.
- Place the hosts in maintenance mode.
- Shut down the vCenter virtual machine.
- Shut down each ESXi host.
The first task we will do is connect to vCenter in PowerCLI:
C:\> Connect-ViServer vcenter