1 Reply Latest reply on Apr 8, 2018 6:14 PM by aleex42

    Vim::find_entity_view in vSphere 6.5

    kri-2 Hot Shot

      Hi folks,

       

      we have installed our first vCenter 6.5 appliance and now a script that ever worked without any problems doesn't work anymore.

      The PerlSDK is still on 6.0, but I can not believe that they did such a change in this fundamental function.

       

      To simplify it, I try to find a given host:

       

      $host_view = Vim::find_entity_view( view_type => "HostSystem", 
                                          filter    => {'name' => qr/^$host/i} 
      );       
      

      This won't give a object back although everthing in the name is correct of course. In vCenter 5.5 this works.

       

      What I found out, that script needs the properties attribut newly:

       

      $host_view = Vim::find_entity_view( view_type => "HostSystem", 
                                          filter    => {'name' => qr/^$host/i}, 
                                          properties => [ 'name'],
      );
      

       

      this works again, but e.g.

       

      properties => [ 'name', 'summary', 'config']

      does not again.

       

      Since I need more properties (summary and config for the configManager) this does not realy help me.

       

      So as summary:

      find_entity_view() seems to need the properies attribut now, but than accepts exact only one property.

       

      Did anyone hit the same problem yet? Is this a known bug? Any idea how to work around this problem?

       

      Any help would be appreciated.

       

      Chris

        • 1. Re: Vim::find_entity_view in vSphere 6.5
          aleex42 Enthusiast
          vExpert
              my $host_views = Vim::find_entity_views(view_type => 'HostSystem', properties => ['summary', 'name', 'config'], filter => {'name'' => qr/^$host/i});
          
              foreach my $host (@$host_views) {
                  my $hostname = $host->name; 
                   ...
              }

           

          Works perfect for me.

           

          But I'm using SDK Version 6.5. Can you just try an upgrade?