VMWare VSAN emergency shutdown procedure

You may need to get your VMWare/VSAN infrastructure to shut down quickly and safely. Usually a power cut/issues will force you to get everything shut down cleanly as quickly as possible.

Here's one way of doing this:
-Log onto VCenter or VSphere client and shut down the guests in your preferred order (eg shut down VCentre before the SQL server it relies on!).
-Now without the VSAN you could use the client to put the physical hosts into maintenance mode.
However with a VSAN (distributed storage across all the physical hosts) you'll want to shut down each portion of the storage cleanly. to do this you need to SSH onto each host and issue the following command:

esxcli system maintenanceMode set -e true -m noAction

-After a minute or so you should be returned to the command prompt. If it appears stuck, then you probably still have a guest machine running!

-Finally, once they are all in maintenance mode, power off the physical hosts.

To start everything up again:
-Boot up the ESXi hosts through remote console session or physically.
-Connect to each ESXi host and exit maintenance mode using one of these options:
Using the vSphere Host Client
From the shell using this command: esxcli system maintenanceMode set -e false
Locate your vCenter virtual machine and power it on using a vSphere Host Client.
Using the vSphere Host Client, connect to the ESXi host that contains your vCenter virtual machine. Power on your vCenter Server

Note: This should be on the first ESXi host, If you moved this virtual machine to that host in step 2 of the shut down procedure.

Connect to your vCenter Server using the vSphere Web Client.

Note: It may take a few minutes for vCenter Server to become available again.

-Do a quick health check on the vSAN cluster. Check for network partitions and resyncing components. For more information, see:
The Monitoring Virtual SAN section of the Administering VMware Virtual SAN guide.
The Check vSAN Health section of the Administering VMware Virtual SAN guide.
Power on the remaining virtual machines in the vSAN cluster.