I need some help ..
After watching an interesting VMware info session on PowerCli I realised that I could obtain IOPs (and other Performance stats) from the ESX servers via PowerCli.
I had a script that went to each VMhost (ESX) and asked for the disk.commands.summation for each VM & datastore.
Then I could sum these up, take averages and give myself a report on how the IO was going.
I had to go directly to the ESX rather than through vCenter, as the standard vCenter stats level only had disk.commands.summation in Real Time; and the ESX keeps at least a day.
Later on I noticed that I could up the Stats level and get the IOPs from vCenter for a week ..
But, when trying to get the stats from vCenter (via PowerCli) I get nothing.
I did a Get-VMhost | Get-StatType .. and I see the stat .. but when I do Get-VMhost | Get-Stat -Type disk.commands.summation nothing returns ..
Can someone please help .. I would like to know the IOPs for each VM & Datastore for the past week, so I can properly balance my datastores.
Ok, let's try it for the past week.
Get-VMHost <esx-hostname> | Get-Stat -Stat disk.commands.summation -Start (Get-Date).AddDays(-7)
Does this return anything ?
One more thing, you are connected (Connect-VIServer) to the vCenter and not the ESX(i) host ?
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You have to use the -Stat parameter
Get-VMhost | Get-Stat -Stat disk.commands.summation
Have a look at the Get-Stat cmdlet for the parameters.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
My bad .. I meant to say Stat instead of Type .. here's a copy-paste from PowerCli (which is at 4.1 before anyone asks)
C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI
> Get-VMHost ##HOSTNAME-REMOVED## | Get-StatType | Select-string disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
disk.commands.summation
C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Get-VMHost ##HOSTNAME-REMOVED## | Get-Stat -Stat disk.commands.summation
C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI>
...
Just comes back as blank .. zip .. zero ..
Just tried, works for me.
The statistics level for the interval should be at least 2.
Are you perhaps using NFS datastores only ?
I suspect these metrics are only for SCSI commands.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Nope .. Fibre Channel SCSI LUNs ..
I have the vCenter at Stat Level 4 for Day & Week ..
You mention interval .. this is one thing I was wondering .. Did you specify an interval when you tried yours ?
No I didn't. Used the default and selected a couple of values to check.
You could try to see for the last couple of days if there any values in de database.
Btw, are the statistics aggregation jobs running correctly? You can check with the SQL Mgmt Studio
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok, let's try it for the past week.
Get-VMHost <esx-hostname> | Get-Stat -Stat disk.commands.summation -Start (Get-Date).AddDays(-7)
Does this return anything ?
One more thing, you are connected (Connect-VIServer) to the vCenter and not the ESX(i) host ?
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Well .. for now that kinda worked ..
Get-VMHost | Get-Stat -Stat disk.commands.summation -Start (Get-Date).AddDays(-6)
Gave me some data, but as soon as I used -7 it went all silent again.
So I awarded you the "correct answer" as it will work for now ..
Maybe it's because I am set to 3 - 3 - 1 - 1, and maybe I need to increase the Month Stats ...
Yes, it depends a bit on the time the 'aggregation' jobs run on the vCenter database.
To be on the safe side you could indeed consider setting historical interval 3 to level 2.
Have a look at the chart I included in my PowerCLI & vSphere statistics – Part 1 – The basics post. You'll also find more info on the aggregation jobs in that post.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Wow, thanks man, this is just what i need.
Kind Regards,
AWT