I have a bit of code which I have included below. This works fine for getting the virtual machines common name(Earth). I am looking for the proper value of the vm to look at to gain access to it's dns name(Earth.SolarSystem.com).
Has anyone done this? If so how?????
-
Code----
my $vm = Vim::find_entity_views(view_type => "VirtualMachine");
foreach (@$vm) {
eval {
my $vmname = $_->name;
Do Something
}
}
Thanks
Chris
Hi,
try this one:
my $vm = Vim::find_entity_views(view_type => "VirtualMachine");
foreach (@$vm) {
print $_->\{guest}->\{'hostName'} ;
}
Hi,
try this one:
my $vm = Vim::find_entity_views(view_type => "VirtualMachine");
foreach (@$vm) {
print $_->\{guest}->\{'hostName'} ;
}
This will only work if you have VMware Tools installed.
Tom