stumpr
Virtuoso
Virtuoso

Yeah, probably have to hop through the host.

my $vm_name = "test_vm_template";

my $vm = Vim::find_entity_view(view_type => 'VirtualMachine', filter => { 'name' => $vm_name });

my $host_ref = $vm->{'runtime'}{'host'};

my $host = Vim::get_view(mo_ref => $host_ref, properties => ['name', 'parent']);

my $compute = Vim::get_view(mo_ref => $host->{'parent'}, properties => ['name', 'resourcePool']);

my $pool = Vim::get_view(mo_ref => $compute->{'resourcePool'}, properties => ['name']);

# Now use $pool as parameter to MarkAsVirtualMachine

I'm doing this completely from the SDK doc, so I'm sure there are typos.

Reuben Stump | http://www.virtuin.com | @ReubenStump

View solution in original post

Reply
0 Kudos