VMware Cloud Community
A_Mikkelsen
Expert
Expert

Cluster availability report

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

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points. Regards A. Mikkelsen
0 Kudos
5 Replies
LucD
Leadership
Leadership

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

0 Kudos
Zsoldier
Expert
Expert

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.

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos
A_Mikkelsen
Expert
Expert

I'm looking for a way to show the availability of a cluster in regards to (Last month):

  1. Sufficient cluster resources to run the VM's
  2. Hosts downtime in minutes (Scheduled/failure)
  3. VM's downtime in minutes (Scheduled/failure) - a reboot with in the OS is to be seen as Scheduled

Ideally I like to show the above graphically

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points. Regards A. Mikkelsen
0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
A_Mikkelsen
Expert
Expert

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:

  • A power on event will occur after the HA event - so downtime will be the time from the HA event to the power on event (alternative until Tools status -eq "running") **

For a host:

  • A host connected event will occur after the HA event - so downtime will be from the HA event to the connected event

Scheduled downtime, could be calculated as:

For a VM:

  • From the time of a "shutdown" event to the power on event (alternative until Tools status -eq "running") **h

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:

  • From host a hosts successful "Enter maintenance mode" event to host a successful "Exit maintenance mode" event

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

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points. Regards A. Mikkelsen
0 Kudos