Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 168455

get esxi storage path details using powercli

$
0
0

ran the below script but getting an error saying "Get-ScsiLunPath        Value cannot be null" , any help would be appreciated!!

 

$results= @()
foreach ($VMHost in $VMHosts) {
[ARRAY]$HBAs = $VMHost | Get-VMHostHba -Type "FibreChannel"

    foreach ($HBA in $HBAs) {
    $scsiluns = Get-ScsiLun -Hba $HBA -LunType "disk"
    foreach ( $scsilun in $scsiluns) {
    $pathState = $scsilun | Get-ScsiLunPath | Group-Object -Property state
    $pathStateActive = $pathState | ? { $_.Name -eq "Active"}
    $pathStateDead = $pathState | ? { $_.Name -eq "Dead"}
    $pathStateStandby = $pathState | ? { $_.Name -eq "Standby"}
    $results += "{0},{1},{2},{3},{4},{5}" -f $VMHost.Name, $HBA.Device, $VMHost.Parent, [INT]$pathStateActive.Count, [INT]$pathStateDead.Count, [INT]$pathStateStandby.Count
    }
}
}

ConvertFrom-Csv -Header "VMHost","HBA","Cluster","Active","Dead","Standby" -InputObject $results | Ft -AutoSize

 

ERROR:


Get-ScsiLunPath : 12/2/2015 1:49:18 PM    Get-ScsiLunPath        Value cannot be null.
Parameter name: array   
At line:13 char:29
+     $pathState = $scsilun | Get-ScsiLunPath | Group-Object -Property state
+                             ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ScsiLunPath], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetScsiLunPath


Viewing all articles
Browse latest Browse all 168455

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>