VMware Cloud Community
OmokbelW
Contributor
Contributor

I need a PowerCLI script to list all the fibre channel HBAs and WWNs and WWPNs for each ESXi host in vCenter with the ability to go back in time 2 or 3 weeks ago.

Hello all,

Can I please get your help on getting a PowerCLI script with the ability to select the date I want? for example I know that one of the HBAs on some hosts were offline two weeks ago. it is resolved now but I want to be able to obtain the data and also choose the date I want for all the fibre channel HBAs and WWNs and WWPNs for each ESXi host in vCenter.

Thank you

Reply
0 Kudos
5 Replies
berndweyand
Expert
Expert

Get-Cluster clustername | Get-VMhost | Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}} | Sort VMhost,Device

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

Moderator: Moved to PowerCLI


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
LucD
Leadership
Leadership

If I understand the question correctly, you want a kind of 'timemachine' to run the Get-VMHostHba and Get-ScsiLun cmdlet for any point in time.

I'm afraid that is not possible with those cmdlets.

They always return the current situation.

What you could do is have a look at the events and look for indirect events like LUN getting an APD status at that time.

Another option is search the logs.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
OmokbelW
Contributor
Contributor

Thank you bewe. But I need to get it dated two weeks ago. LucD mentioned that it is not possible.

Reply
0 Kudos
OmokbelW
Contributor
Contributor

Thank you so much LucD

Appreciate it.

Reply
0 Kudos