Hi,
I'm trying to get a specific Virtual Machine view from an hypervisor.
Basically I tried to reuse an idea found on the cdromdisconnect.pl script, an addressed in http://communities.vmware.com/message/1192878#1192878
The code would be
my $host_view = Vim::find_entity_view (
view_type => 'HostSystem',
filter => { 'name' => $vm_hypervisor_name},
);
my $host_moref = $host_view->{mo_ref}{value};
$vm_view = Vim::find_entity_views (
view_type => 'VirtualMachine',
filter => {
'runtime.host' => $host_moref,
'name' => $vm_name,
},
);
But the API says that "Filtering is only supported for Simple Type"
So actually i'm just getting the host_view, and then call the "->vm" property to retrieve all the vm of the Host, and then I loop inside the array to fetch the name and have the VM I'm looking for
But, Isn't there a smoother way to get directly the entity view of a specific host's VM?
Thanks