VMware Cloud Community
ChrisKuhns
Enthusiast
Enthusiast

VSAN Automated Shutdown Script with PowerCLI (Or Any Alternatives)

Good morning VSAN fans!

I am trying to create an automated shutdown script using PowerCLI. I have a good thing going thus far, except for the Maintenance Mode piece. I cannot find anywhere where PowerCLI addresses the additional options for entering in to Maintenance Mode. I need to have the selection be No Data Migration. Is this anywhere that I am not seeing by chance?

Does anyone already have a good VSAN shutdown script they are willing to share?

Thanks,

Chris

Tags (2)
0 Kudos
2 Replies
vuzzini
Enthusiast
Enthusiast

Hello Chris,

Not sure of the PowerCLI cmdlet, but to take the ESXi host to maintenance mode while specifying an action the VSAN service must take before the host can enter maintenance mode (default noAction) you may try the below command:


esxcli system maintenanceMode set -e true -m ["ensureObjectAccessibility" or "evacuateAllData" or "noAction"]

NOTE: These options exist for ESXi 6.0.

If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points. Sandeep Vuzzini Sr. DevOps Engineer
0 Kudos
ChrisKuhns
Enthusiast
Enthusiast

Vuzzini,

Thanks for this. I do know about the ESXCLI command, but the script I have been working on is for emergency shutdown of the data center here. We have limited backup batteries and zero backup generators for now (school district, lol) Basically, this is to kill everything before power dies.

Chris

0 Kudos