XlistAllVMs.pl
This one is next in my series of old scripts. It is pretty much the simplest VC1.x SDK perl script possible. It is largely based off the sample code available from VMware.
Where: XlistAllVMs.pl (186)
When: 2/13/2006
What:
Produces a simple list of all virtual machines
Written in perl, uses Virtual Center 1.x Web Services
Requirements:
Virtual Center 1.x
Run on any box with the proper perl modules. Activestate on windows has not been tested. Will not run on an ESX box.
Click if you need to test or change your VC 1.x Web Service
Output is csv to STDOUT. Example:
“hostname”,”path”
“myVM”,”/vcenter/Xcedex/Folder/myVM”
Usage:
./XlistAllVMs.pl [-server server] [-username username] [-password password]
example ./XlistAllVMs.pl -s virtualcenter.example.corp -u joeuser -p w00t
Notes:
This script, as with any perl VI1.x SDK script is pretty slow. If you are small, it is acceptable. But if you have hundreds of VM’s, expect slow.