VMware Cloud Community
langleyj
Contributor
Contributor
Jump to solution

Historical Data report

I am trying to get 3 historical data of what happened on a specific VM and a specific ESX box in a cluster at a specific range.

vMotion: I saw a script by LucD that gets me VMotion for that day http://communities.vmware.com/message/1165979#1165979 for a specific VM...not sure how to see vMotion that was done on that ESX box as a whole.

Get-Stats: Memory, CPU, and IO for a time period.Get-stat wasworks well for live...but how does it work with historical data? I tried something like: Get-Stat -Entity $vm -stat mem.usage.average,disk.usage.average and putting date ranges in...but I seem to have messed up somewhere?

Finally, I am trying to use Get-VIEvent for info, errors and warnings for that day. I seem to have done this based off an example from LucD but what is odd is that it does not correspond to the vMotion script that I ran earlier ( some DRS events are in this viewer and not in teh vMotion script earlier).

Any help would be mucho appreciated.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

vMotion: the script you refer to had a slightly different purpose. It looks for all Tasks that were fired by DRS for a specific VM. In other words all vMotion tasks that DRS initiated.

Once the Tasks are found, the script collects all events related to each Task.

And from these Events the source and destination ESX host were extracted.

And yes, the script can be used for an ESX. It just requires you to store a MoRef to an ESX server in the entity field

Get-Stats: this depends how you have the Historical Intervals defined.

In the VIC go to .

Depending on what you have there for each of the four intervals, the statistical data will be kept for a specific period of time.

Also important are the Levels you define for each interval. It defines which metrics are available in each interval.

The events you get from the script are only the events that are related to DRS initiated vMotions.

If you do a manual vMotion it won't be in the list produced by the script.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

vMotion: the script you refer to had a slightly different purpose. It looks for all Tasks that were fired by DRS for a specific VM. In other words all vMotion tasks that DRS initiated.

Once the Tasks are found, the script collects all events related to each Task.

And from these Events the source and destination ESX host were extracted.

And yes, the script can be used for an ESX. It just requires you to store a MoRef to an ESX server in the entity field

Get-Stats: this depends how you have the Historical Intervals defined.

In the VIC go to .

Depending on what you have there for each of the four intervals, the statistical data will be kept for a specific period of time.

Also important are the Levels you define for each interval. It defines which metrics are available in each interval.

The events you get from the script are only the events that are related to DRS initiated vMotions.

If you do a manual vMotion it won't be in the list produced by the script.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
langleyj
Contributor
Contributor
Jump to solution

Hi LucD Smiley Happy

1. It just requires you to store a MoRef to an ESX server in the entity field --> not sure what you mean?

2. Stat level 2 and 2 min, 30 min (1 week), 2 hrs. (1 month), and 1 day... I would need the data from less than a week ago so it still falls in that 30 minute range. Level 2 gives me memory, cpu, and disk. Now the question is how to get it out correctlyusing the Get-Stat cmdlet

3. Understood..I guess an admin did a manual one, I will have to follow up on that. The question I had was in the info, error, warning wouldn't it says the ones that DRS did automatically? if yes, I did not see them listed..if not, then it makes sense Smiley Happy

Reply
0 Kudos
langleyj
Contributor
Contributor
Jump to solution

OK, so I see from the sdk that MoRef is essentially a pointer ... having said that, how would that be modded into your script. Appreciate the help LucD!

Reply
0 Kudos