VMware Cloud Community
IveMarshall
Contributor
Contributor
Jump to solution

ESX Performance Statistics

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
IveMarshall
Contributor
Contributor
Jump to solution

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

&gt; 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&gt; Get-VMHost ##HOSTNAME-REMOVED## | Get-Stat -Stat disk.commands.summation

C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI&gt;

...

Just comes back as blank .. zip .. zero ..

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
IveMarshall
Contributor
Contributor
Jump to solution

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 ?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
IveMarshall
Contributor
Contributor
Jump to solution

That's the strange thing .. see the attachment ..

If I go into the Performance tab of the ESX .. Disk .. Pask Week .. select "commands" (Disk Commands Issued) .. I get stats ..

So I don't know why I get a blank ..

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
IveMarshall
Contributor
Contributor
Jump to solution

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 ...

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
AlbertWT
Virtuoso
Virtuoso
Jump to solution

Wow, thanks man, this is just what i need.

Kind Regards,

AWT

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos