VMware {code} Community
meskola
Contributor
Contributor

Getting Moref from hash

Hi!

I am trying to get the moref for a resourcepool that I only have the name for.

If i do a Vim::find_entity_view(view_type => 'ResourcePool', filter => \{'name' => 'webservers'}, on the resource pool I get the hash.

Now here's the bit I have a problem with:

if I then try to find all VMs in this certain respool I need to know the moref for the resourcepool, not the hash.

Is there anyway I can get the moref with the hash? or is there a better way using find_entity_view directly?

Cheers and thank for any help beforehand...

/markus

Message was edited by:

meskola

0 Kudos
1 Reply
bhoke
Enthusiast
Enthusiast

$mo_ref = $view->\{mo_ref}

You should use Data::Dumper to print a hash. That's very helpful.

0 Kudos