I've seen a few posts about storage adapters and some mentioned metrics but they weren't new and I haven't been able to get them to work. If I run "Get-Metric -MetricGroup "Storage adapter" |ft -AutoSize" I get the list below but I haven't found out how to query it. I'm mostly looking for latency and contention but I'm sure the solution will apply to all.
advTHANKSance!
You have to use Get-StatType to find the name of the metrics that you can use on the Get-Stat cmdlet.
Storage adapters are connected to the ESXi nodes, so the Entity needs to be an ESXi node.
For example
$esx = Get-VMHost -Name MyEsx
Get-Stat -Entity $esx -Stat 'storageAdapter.read.average','storageAdapter.write.average' -Realtime -MaxSamples 1
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You use the Get-Stat cmdlet to query metrics.
With the Get-StatType cmdlet you can see which metrics are available for which entities and in which intervals.
You then use the desired metrics on the Stat parameter of the Get-Stat cmdlet.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I appreciate your help.
I'm sure I'm missing something obvious but I can't guess I can't find the right entity to query. It doesn't appear to be the host which is what I expected. I've tried isolating adapters from the host but I get 'Cannon convert to type "VMware.VimAutomation.Sdk.Types.V1.VIObject"'.
Sorry for being dense.
How did do the call to Get-Stat?
It's hard to give advice without knowing what you are doing
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
To find out what is available I ran "get-metric -MetricGroup "Storage adapter" which yielded this metric "Storage Adapter Queue Command Latency -- Storage adapter -- ms".
When running "Get-Stat" it requires the "-Entity" with an object passed to it. I'm not sure either/both what object it wants or how to get it.
I've tried "Get-Stat -Entity $esx" and "Get-Stat -Entity $cluster." I assume it wants the storage adapter as an object but I haven't found how to get what it wants.
I've started with "$stor = get-view (Get-VMHostStorage -VMHost (Get-VMHost -Name <ESX-hostname>)).ID" (that code might look familiar) and pulled pieces from that but no dice.
I'm sure it is staring me in the face but I must have my eyes closed.
Thanks
You have to use Get-StatType to find the name of the metrics that you can use on the Get-Stat cmdlet.
Storage adapters are connected to the ESXi nodes, so the Entity needs to be an ESXi node.
For example
$esx = Get-VMHost -Name MyEsx
Get-Stat -Entity $esx -Stat 'storageAdapter.read.average','storageAdapter.write.average' -Realtime -MaxSamples 1
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks!
I used
get-stat -Entity $esx -Realtime -MaxSamples 1 -Stat storageadapter*
To show me all of the available stats and the correct name to use which was also a bit confusing when looking at Get-Metric.
Thanks so much!