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

Re: get esxi storage path details using powercli

$
0
0

I'm not able to modify it the way I want, basically I'm looking for output something like  hostname, hba, activepaths, standbypaths, deadpaths

 

 

 

$dsHt= Get-View -ViewType Datastore -Property"Info","Summary.Type"-Filter@{"Summary.Type"="VMFS"}|
Select@{N="DSName";E={$_.Info.Vmfs.Name}},@{N="Capacity";E={[math]::round(($_.Info.Vmfs.Capacity /1024/1024),0)}},
@{N="Extent";E={$_.Info.Vmfs.Extent[0].DiskName}},@{N="VMFS Version";E={$_.Info.Vmfs.Version}}|
Group-Object"Extent"-AsHashTable -AsString

 

$results=@()
Get-View -ViewType HostSystem -SearchRoot (Get-Cluster ClusterPod8).id -Property Name, Config.StorageDevice |%{
   $thisHostName=$_.Name
   $_.Config.StorageDevice.PlugStoreTopology.path |?{$_.Name -match'naa'}|Group-Object LunNumber |Sort-object Name |%{
     try {
       $thisNaaId=($_.Group[0].Name -split "naa.")[1]
       $results+=New-Object psobject -Property@{
         HostName =$thisHostName
         LunNumber =$_.Name
         PathCount =$_.Count
         DSName =$dsHt["naa.$thisNaaId"][0].DSName
         Capacity =$dsHt["naa.$thisNaaId"][0].Capacity
         "VMFS Version"=$dsHt["naa.$thisNaaId"][0]."VMFS Version"
       }
     } catch {
       Write-Warning"Found something with $thisNaaId"
     }
   }# end this Lun
}# end this host

 

$results|Group-Object pathcount


Viewing all articles
Browse latest Browse all 168455

Trending Articles



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