Hi,
I'm looking for a script that reports a clusters availability/uptime during the last month, been looking but haven't been able to find any.
I prefere the script to integrate into vCheck, but thats not required.
does anyone have or know of such a script ?
br
A. Mikkelsen
Can you be a bit more specific on what kind of availability you want to report on ?
Is it the availability of the ESXi nodes in the cluster only ? That would then just need to measure the uptime of each of the ESXi nodes.
Or the availability of sufficient resources to run all the VMs in the cluster ?
Or ...
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That's a somewhat loaded question since a cluster is made up of several hosts and is in itself a 'virtual' object. In other words, a cluster could technically be considered up by simply just existing. It doesn't necessarily have to have any hosts associated w/ it. That's why, at least in 5.0, there is no 'uptime' metric for a cluster. You would have to figure out how you want to measure that from the individual hosts and possibly provide an average.
So something like this:
$Stats = Get-Cluster NameofClusterYouWantToMeasure | Get-VMHost | Get-Stat -Stat sys.uptime.latest -Start ((get-date).addminutes(-10))
$AvgUptimeinDays = ($Stats | where {$_.value -ne "0"} | Measure-Object -Property Value -Average).Average / 86400
If your average uptime in days was longer than 30, than you were probably 'up' for the last month.
I'm looking for a way to show the availability of a cluster in regards to (Last month):
Ideally I like to show the above graphically
How would you be able to distinguish host and VM downtime as scheduled or failure ?
Is that info available somewhere ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The info is not directly available, but it is in the event db.
My initial take on how to create this report is:
Downtime caused by a failure will trick an HA event.
For a VM:
For a host:
Scheduled downtime, could be calculated as:
For a VM:
Because I can't come up with an suggestion on how to calculate downtime from a "restart" or "reset" event, I have to leave it out of the report.
For a host:
**) Not sure that the event db has/hold an entry for when a VM's tool status -eq "Running", so this might not be possible.