this is a start
At this point the script:

logins to ESX server
Downloads a bunch of info about VMS
Parses it out into a bunch of objects - type list - listOfVMs
Prints all the info for each objects
it's working pretty darn well with the esxcmd-info --resource command
but since that's not getting powered off VMs I'm going to head a
different route
Now this silly thing returns a list of objects that it's created from the
vim-cmd /vmsvc/getallvms command. This doesn't include all the disks like
the prior command I used did, but it does include VMX files so from there
hopefully we can find disks.
Successfully adding all the necessary object data
defined function and tested for identifying the "-v" argument which is
The VM targeted to be backed up. If it finds too many it complains.
If it doesn't find any it complains. If it finds one, it returns the vmid
At this point the script copies the vmx file to the shared location,
then reads it and identifies all of the VMKDs that need to be backed up.
It creates a list that lives under the targetvm object and adjusts in
the full path to be recognized by the ESX host. Next is snapshots.
this thing is fully working alpha code at this point

Takes snapshot
copies files
removes snapshots

ToDo:
Add logfile output
Cleanup cmd line arguments
Add cmd line argument for vm (needs to be done before using)
I guess I'd already done that argument for the VM... duh
I did just add some verbose output so we know what's going on though.
copying to bareos host and trying now
this is the copy that ran live, made some mods while using live on
backup server including adding hostname etc internal in the script
Checking in a working copy before totally mangling it to make it work for both
The pre and post portions of the business. Turning a lot of stray code into
functions so that it can be called based upon what the script is supposed to be
doing at the end
It now creates that log file and uses that logfile to clean up the
working directory when it's finished using a -p flag
snafu, didn't configure delete portion to get rid of 'flat.vmdk' files
more of the same
added nice message for the post backup cleanup
more of the same
Merge branch 'master' of github.com:jrdalrymple/bareos-vmware