Quantcast
Channel: VMware Communities : Discussion List - vSphere SDK for Perl
Viewing all articles
Browse latest Browse all 1577

Quickly access to a view by giving full route

$
0
0

Hi,

 

I'd like to know if it was possible to retrieve a view from vsphere by giving it it's "full route".

 

Actually, to be sure to get the right view, because, for example, 2 VMs of the same name can exist on 2 different hypervisors, I'm retrieving the parent view and use it at 'begin_entity' parameter to retrieve my view.

 

But that means that for one VM, I often have to do the following:

 

 

#get vsphere hypervisor's datacenter view    my $dc_view = Vim::find_entity_view(                      view_type   => 'Datacenter',                      filter => {                          name => 'vsphere5_datacenter_name'                      });     #get vsphere hypervisor view    my $hv_view = find_entity_view(                      view_type    => 'HostSystem',                      filter  => {                            name => 'host_name'                                                                                                                                                                          },                      begin_entity => $dc_view,                  );    #get the VM view from vsphere    my $vm_view = find_entity_view(                      view_type    => 'VirtualMachine',                      filter  => {                          name => $self->{host}->host_hostname'                      },                        begin_entity => $hv_view,                   ); 

 

 

So in the end I do 3 API calls to retrieve only 1 exploitable view...

 

Do you guys know any way to retrieve a precise view, with a specific "full route" path?


Viewing all articles
Browse latest Browse all 1577

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>