Bash Script to Shutdown all your VMs

This script allows you to manually shutdown the VMs and then reboot using vmware-cmd and the trysoft command

From time to time I have to reboot my ESX server. Although I have configured auto-start and shutdown options, I...

have found it sometimes takes a long time to shutdown the VMs. Very often I have found it quicker to manually shutdown the VMs and then reboot. This script below allows this using vmware-cmd and the trysoft command (which tries a soft power shutdown, followed by a hard shutdown if that is unsuccessful)

#!/bin/bash
for vm in ‘vmware-cmd -l’
do
vmware-cmd “$vm” trysoft
done
reboot

This was last published in April 2005

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchServerVirtualization

SearchVirtualDesktop

SearchDataCenter

SearchCloudComputing

Close