Our site has limited power availability for when the lights go out - enough to shutdown everything manually at the least. However there isnt always someone proficient onsite to be able to shutdown the infrastructure.
Ive been writing a powershell script that gets called by our APC virtual appliance - the script shutsdown all the VMs in the right order etc, however I have yet to be able to shutdown the cluster scripted.
Running a 'cluster stop' has a confirmation prompt that my script cannot handle - as the powershell command doesnt run a session, but just a single command.
The method im using is as follows:
$result = Invoke-SshCommand -ComputerName $cvmIPs -Command '/home/nutanix/cluster/bin/cluster status | grep state'
Has anyone a script for shutting down the whole cluster? I'd think sending all the CVMs a 'sudo shutdown -h 0' will certainly shut them down, but id be a little worried about the state of the cluster when they are started again.