You can use the "begin_entity" as part of your filter to search within a specific cluster. Here's a quick snippet that'll get you started which accepts a Cluster name and will filter only VMs within that cluster.
#!/usr/bin/perl -w
use strict;
use warnings;
use VMware::VILib;
use VMware::VIRuntime;
my %opts = (
cluster => {
type => "=s",
help => "Name of vSphere Cluster",
required => 1,
},
);
Opts::add_options(%opts);
Opts::parse();
Opts::validate();
Util::connect();
my $cluster = Opts::get_option('cluster');
my $cluster_view = Vim::find_entity_view(view_type => 'ClusterComputeResource', filter => {'name' => $cluster});
my $vm_views = Vim::find_entity_views(view_type => 'VirtualMachine', begin_entity => $cluster_view);
foreach my $vm (@$vm_views) {
print $vm->name . "\n";
}
Util::disconnect();
Now that you have the list of VMs, you'll need to iterate through each of it's VirtualDisk and look at it's Shares and check on the limit property as referenced in the vSphere API - http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.StorageRes... and if it's -1 it means it's unlimited and any other value, there is a limit set.
I would recommend taking a look at the vSphere SDK for Perl programming guide to help get started http://www.vmware.com/support/developer/viperltoolkit/doc/perl_toolkit_guide_idx.html