The vSAN Cluster Shutdown capability has been around since vSAN 7 Update 3 and has been enhanced over the years, most recently with the introduction of a vSAN Cluster Shutdown Wizard as part of the VMware Cloud Foundation (VCF) 9.0 release.

For those looking to automate the shutdown of their vSAN Cluster, we have a number of PowerCLI cmdlets: Get-VsanClusterPowerState, Start-VsanCluster and Stop-VsanCluster that simplifies this process in addition to the new UI interface, all leveraging the vSAN Management APIs.
Before the vSAN Cluster can initiate the shutdown workflow, it needs to make sure all VMs (excluding the vCenter Server VM that is managing the vSAN Cluster) has been powered off. For large environments, it can take some time to power off all VMs, which means you might need to poll or wait before running the Stop-VsanCluster cmdlet.
Instead of having to write additional code to wait for all your VMs to shutdown, you can leverage one of the vSAN Health Check Perspectives that will conveniently let you know when the vSAN Cluster is ready to be shutdown.
The vSAN Perspective is called clusterPowerOffPrecheck and can be used by the Test-VsanClusterHealth cmdlet. If there are still running VMs, the vSAN Health Check will fail (simliar to what you see in the UI) as shown in the screenshot below.
![]()
When you perform a large shutdown of VMs, there maybe a few stragglers that just take longer than expected to shutdown or in some cases, they get stuck or do not shutdown at all. It certainly would be nice to quickly understand which VMs are still running, so that you can perform some additional automation to forcefully shutdown the VM or at least quickly identify those VMs.
As you can see the output from the Test-VsanClusterHealth only returns pass/fail, the underlying vSAN Management Health Check API actually provides a ton more details that just is not exposed in the generic vSAN Health Check cmdlet.
To demonstrate the underlying vSAN Management API using PowerCLI, I have created a function called Get-VsanClusterShutdownPrecheckResults which fetches the additional information with the list of VMs that are still running:

Thanks for the comment!