Search This Blog


VMware Batch Machine Operations

Turning off/on all VMs at Once
A useful utility might be either to turn on or off all VMs subsequently. This gives you an idea of how you would perform operations against all VMs. It can be extended to other operations specific to that VM's vmid.

for i in `vim-cmd vmsvc/getallvms | awk '{print $1}' | grep -v Vmid`; do /bin/vim-cmd vmsvc/ $i; done

A short description of what it does: 

  1. Gets a list of all of the VMs with their corresponding Vmid's
  2. Strips out JUST the vmid number (excluding the first header line)
  3. Powers them off.
It's a pretty simple for loop but I usually forget the command to list all of the VMs. There may be an easier way that I don't know about.

If I think of more batch commands I will be adding them here but for now that's the only one I manually use fairly frequently.

No comments:

Post a Comment