puppet/vmware/files/scripts/vmware-suspend

18 lines
287 B
Bash
Executable file

#!/bin/sh
. /usr/local/lib/vmware.sh
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <vm>" 1>&2
exit 1
fi
vm="$1"
vmid="`vmid \"${vm}\"`"
if [ "${vmid}" = "" ]; then
echo "Cannot find virtual machine ${vm}" 1>&2
exit 1
fi
vmware-vim-cmd vmsvc/power.suspend ${vmid}