This vSphere SDK for Perl sample script demonstrates the listing of all supported guestOSes for a given vSphere Cluster.
For more details, please visit this blog article: http://blogs.vmware.com/vsphere/?p=7980
Disclaimer: These script are provided for informational/educational purposes only. It should be thoroughly tested before attempting to use in a production environment.
Here is an example of how the script works:
./getSupportedGuestOSes.pl --server [VCENTER] --username [USER] --cluster [CLUSTER]