Hello,
I would like to script the graceful shutdown of my running VMs by connecting to my host using SSH and running some commands.
I have the appropriate command to shutdown a VM gracefully as:
vim-cmd vmsvc/power.shutdown VMID
What I need assistance with, is to try and use:
vim-cmd vmsvc/getallvms
To try and only return a list of VMs currently running, and to also filter out one specific VM (which the script will effectively be run from).
Is there a way to either do this directly in the commands, or can I capture the output of vim-cmd and interpret it in a script to achieve this?
Cheers
Eds