VMware

Knorrhane

Things that happens and is good to be remembered.

1 Posts tagged with the restart tag
0


Here is a bash script to power off all active VMs on a host.


#!/bin/bash
* IFS='*
* '*
* for vm in `vmware-cmd -l`*
* do*
* name=`vmware-cmd "$vm" getconfig displayname -q`*
* state=`vmware-cmd "$vm" getstate -q`*
* if *
* then*
* echo "Trying to power off $name...."*
* output=`vmware-cmd "$vm" stop trysoft`*
* if $? -eq 0 ; then*
* echo "$name was powered off successfully."*
* fi*
* fi*
* done*
This script was posted some time ago on the VMTN forumsby Alex, but he has now been updated it to report if each VM has successfully powered off

0 Comments Permalink
Click to view nikkar's profile Member since: Apr 12, 2005

Things that happens and is good to be remembered.

View nikkar's profile

Communities