Hi friends,
I need script for Cluster infomation and that cluster avalibale Host and that Host connect the HBA sand WWN name and Data Store. in Csv format.
pls help me out. we have one VCs and that haveing 8 Cluster in 90 Esx 4.0 servers.
for this you should use powercli ,this link would be helpful
http://communities.vmware.com/message/1704211
Try something like this
$report = foreach($cluster in (Get-Cluster)){ foreach($esx in (Get-VMHost -Location $cluster)){ $dsTab = @{} foreach($ds in (Get-Datastore -VMHost $esx)){ if($ds.Extensiondata.Info.Vmfs){ $ds.Extensiondata.Info.Vmfs.Extent | %{ $dsTab[$_.DiskName] = $ds.Name } } } foreach($hba in (Get-VMHostHba -VMHost $esx)){ $hba.ScsiLunUids | %{ $id = (Select-String "/ScsiLun=(?<runtime>\S+)/$" -InputObject $_).Matches[0].Groups["runtime"].Value if($dsTab.ContainsKey($id)){ New-Object PSOBject -Property @{ Cluster = $cluster.Name Host = $esx.Name HBA = $hba.Name PortWWN = ("{0:x}" -f $hba.PortWorldWideName) LUNid = $id
Datastore = $dsTab[$id] } } } } } } $report | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference