Hello,
I am struggling with the object usage in perl; my goal is to pass a VM name as parameter and return some information of the ESXi parent host:
But the output is:
Connecting
Connected
vm-test
ManagedObjectReference=HASH(0x2435648)
Undefined subroutine &ManagedObjectReference::name called at ./test.pl line 24
So it looks like I can get the host with no issues but I don't know how to access its properties having a Managed Object Reference.
Any help is appreciated, thank you.
Juan.
You have a MOREF from the runtime.host property, you need another get_view call on it.
my $host = Vim::get_view(mo_ref => $HostRef);
print $host->{name} . "\n";
You have a MOREF from the runtime.host property, you need another get_view call on it.
my $host = Vim::get_view(mo_ref => $HostRef);
print $host->{name} . "\n";
Perfect, thanks for the quick reply.