Hi all
first tks for this forum. i just see that very good tool exist -> powercli
i try to do somethings.
first i want per vm the % of uptime per vm
and the average of cpu usage, mem usage etc... from last year.
i can do this per script but i don't found how.
tks for your help
That explains it, the metric was only introduced in vSphere 5
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you have to go back 1 year in time, the historical interval will only have 1 sample per day.
Is that sufficient for your purpose ?
What exactly do you want to use as a measurement for uptime ?
The percentage of time that a VM was powered on ?
Or do you want to report on the time since the last OS boot ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
hi,
first tks lucD for all your other post
so i must have stats for this year for all of my vm.
i want to know downtime per vm machine or uptime on % for 1 year if it's possible.
tks advance
I think the best option would be to look at the sys.osUptime.latest metric to calculate the uptime.
Since you want to go back for 1 year, the samples will come from Historical Interval 4.
And the statistics level will need to be set to level 4 for Historical Interval 4. Is that the case in your environment ?
The alternative is to use sys.uptime.latest, that only requires statistics level 1.
Let me check how the aggregation jobs handle this kind of metric.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi
tks for your reply
how to know level ?
tks
Like this
$si = Get-View ServiceInstance
$perfMgr = Get-View $si.Content.PerfManager
$perfMgr.HistoricalInterval | Select Name,Level
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok. i'm on level 1 how i can change this ? to have more log ?
tks advance again
Through the vSphere client.
Have a look at my PowerCLI & vSphere statistics – Part 1 – The basics post. There I explain several of these statistics related concepts.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It's ok now i'm on level 4 tks
i suppose level 4 is since this day not before ?
sys.osUptime.latest -> and complete script to export all of this data ?
tks advance
Luc
sorry but sys.osUptime.latest not work. how do you use it ?
tks advance
Over which period did you try to get the sys.osUptime.latest ?
Since you only changed the statistics level to 4 last week, you can only get this for the last couple days right now.
Or do you mean something else ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
if i have last log next time i will know how to do for long time. can you help me ? tks
Ok, the following script reports how long the OS in each VM has been running.
$vms = Get-VM
Get-Stat -Entity $vms -Stat "sys.osUptime.latest" -Realtime -MaxSamples 1 |
Group-Object -Property {$_.Entity.Name} |
Select @{N="VM";E={$_.Name}},
@{N="OS running";E={New-TimeSpan -Seconds $_.Group[0].Value}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ressource unavalaible :s
What version do you have running ?
For PowerCLI do a
Get-PowerCLIVersion
Which vSphere/ESXi versions ?
Does the metric exist ?
$vm = Get-VM -Name MyVM Get-StatType -Entity $vm -Realtime |
where {$_ -match "sys.osUptime.latest"}
Does this return anything ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
esx 4.1 and power cli 5.1 R1
That explains it, the metric was only introduced in vSphere 5
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You might be interested in my post called Game of Nines – VM Uptime Report.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
hi luc
tks for this
i want to test it but nothing appear on my powercli...do you knwo why ?
tks advance
Did you look at the Sample Usage section, it contains several examples on how to use the Get-VMUptime function.
How did you call the function ?
Can you include your code ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference