Hello. We have a vsphere 5.0 environment and we are experiencing some heavy io latency. I have been looking for a powercli script that will get the io latency for each vm and get the datastore name it currently resides on. We access our storage over fiber. I'm trying to get a good overview of io latency in one nice view in a csv. I found what might be a good base at https://communities.vmware.com/thread/304827?start=0&tstart=0 but I'm not quite sure how to get the datastore name into the array and I think it is written for nfs storage anyway. Thanks in advance for any info\advice!
Yes, but it requires the Statistics Level (in the vCenter) to be set to 4 (which will grow your vCenter DB).
And if you change that value now, it will take time before you see it reflected in the Historical Intervals.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the help..
All your inputs are highly helpful.
For now we will not be able to change statistical value at vcenter level, hence couldn't get historical value of read latency at vdisk level. With the script in this discussion, for 80% of the VMs in the cluster getting the junk value of disk latency at datastore level. Hence can you provide a script to find the Read Rate of VM disks, so that we can get VMs with high disk read rate and will work on vFRC.
Thanks in advance.
Collect the vdisk.numberReadAveraged.average and vdisk.numberWriteAveraged.average.
Those metrics require Statistics Level 1 for the aggregate over all vDisks per VM, and Statistics Level 3 for values per vDisk per VM.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I have modified your another script and used it as below.
Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer *****************
$vmName = Get-Content -Path "C:\Temp\vm.txt"
$stat = 'virtualDisk.numberReadAveraged.average','virtualDisk.numberWriteAveraged.average'
$entity = Get-VM -Name $vmName
Get-Stat -Entity $entity -Stat $stat -Realtime -MaxSamples 1
I'm new to scripting, not sure how to change this script to get historical value(for 15 days).
And statistical value of vcenter is as follows.
You can do something like this
$vmName = Get-Content -Path "C:\Temp\sevicm07_vm.txt"
$stat = 'virtualDisk.numberReadAveraged.average','virtualDisk.numberWriteAveraged.average'
$entity = Get-VM -Name $vmName
$start = (Get-Date).AddDays(-15)
Get-Stat -Entity $entity -Stat $stat -Start $start -MaxSamples ([int]::MaxValue)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It fails for me when i ran the script
That metric requires Statistics Level 3.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is there any other way I can fetch the report without changing statistic level .I tried esxtop but there a lot of vms in one esxi host and becomes very difficult .
Not that I know of I'm afraid.
If the Statistics level is not at the right level, the vCenter will not save the values for the metric in the vCenter DB.
The only numbers you can retrieve are the ones for the Realtime interval, which are kept on each ESXi node for about 1 hour.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference