Return to Snippet

Revision: 29093
at July 21, 2010 11:25 by seanboycegmailcom


Initial Code
#!/bin/bash

if [ $# -ne 1 ]; then
  echo Usage: `basename $0` [VMX FILE]
  echo Get vmid of virtual infrastructure virtual machine
  echo
  echo Parameter expected 1>&2
  exit 65
fi

if [ ! -s $1 ]; then
  echo Virtual machine does not exist or is empty.
  exit 1
fi

/usr/bin/vmware-cmd "$1" getid | cut -d' ' -f3
exit $?

Initial URL


Initial Description
Gets the vmid of the virtual machine.  The first and only argument is the .vmx config file.

Initial Title
Get vmid of ESX(i), VSphere virtual machine

Initial Tags


Initial Language
Bash