Created
December 28, 2015 05:12
-
-
Save noorul/108bf3b25ff38b374f26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| for vmid in `vim-cmd vmsvc/getallvms | grep -v template | awk -F ' ' 'NR>1 {print $1}'` | |
| do | |
| if vim-cmd vmsvc/power.getstate $vmid | grep -q "Powered off" ; then | |
| vmname=`vim-cmd vmsvc/get.summary $vmid | grep name | sed -e 's/.*\"\(.*\)\".*/\1/g'` | |
| echo VM $vmname is powered off, powering on | |
| vim-cmd vmsvc/power.on $vmid | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment