VMware {code} Community
Afgdd
Contributor
Contributor

Get WWN of a ESXi host by using vSphere SDK for Perl

I tried to get wwn of a ESXi host by using vSphere SDK for Perl, but it does not success. All the information I can get is bus number, device's name, driver's name ... (https://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.host.HostBusAdapter.h...) of a adapter, but I seem does not have any information related to WWN. So, is there any way to get that information by using vSphere SDK for Perl? Thanks in advance! 
0 Kudos
2 Replies
natxoasenjo
Enthusiast
Enthusiast

probably (I have no fc or iscsi initiators on esxi on our environment) poking around config.storageDevice.hostBusAdapter?

my $hosts_view;

$hosts_view = Vim::find_entity_views(

    view_type => 'HostSystem',

    properties    => [ 'name','config.storageDevice.hostBusAdapter', ],

);

print Dumper $hosts_view;

Edit: I added a iscsi initiator just for testing and it is indeed in there:

'iScsiName' => 'iqn.1998-01.com.vmware:hostname-590171e5',

As i do not have any fibre channel, I have no means of getting this info for that, but it should be quite similar.

0 Kudos
Afgdd
Contributor
Contributor

Thank you very much, that's exactly what I'm looking for.
0 Kudos