Reply to Message

View discussion in a popup

Replying to:
Trondesson
Contributor
Contributor

Good Morning.

I tried to adopt your code for my script but it didn't work.

my $vms = Vim::find_entity_views(view_type => 'VirtualMachine', filter => { 'guest.guestState' => 'running' }, properties => ['summary.customValue',], );

for my $value (@$vms) {

        my $cv_ref = $value->{'summary.customValue'};

        for (@$cv_ref) {

                print "key: ",$_->key, "\tvalue: ",$_->value, "\n";

        }

}

On my vCenter I created the custom field "email" and put for one VM the value "foo@bar.com" in. When I run the script I didn't get any output. Could you explain where I'm wrong?

Reply
0 Kudos