i need a perl api script to get the dns name of vm from vshere webclient ..
The DNS name, as reported by the Guest Tools, is available through the GuestInfo properties of the VirtualMachine in the API.
You would need to look the managed object "VirtualMachine" to figure out where properties have the information you need. For example, the "guest" property.
To find out what information is provided within the "guest" property, notice that the property is of the "guestinfo" data type. Look up that datatype and notice the "hostName" property. That is the dns Name of the guest.
https://www.vmware.com/support/developer/converter-sdk/conv51_apireference/vim.vm.GuestInfo.html
Here are some sample codes:
my $vms = Vim::find_entity_views(view_type => 'VirtualMachine',properties => ['name', 'guest'], filter => {"name" => qr/^$vmName/i});
print "\nName: <$vm->{'name'}>\n";
my $DNSname = $vm->guest->hostName;
