VMware {code} Community
kri-2
Hot Shot
Hot Shot

Vim::find_entity_view in vSphere 6.5

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

0 Kudos
1 Reply
aleex42
Enthusiast
Enthusiast

    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?

-- Alex (VMware VCAP-DCV, NetApp NCIE, LPIC 2)
0 Kudos