Gabrie1
Commander
Commander

Script to view HA heartbeat datastores

Jump to solution

Noticing an unexpected behaviour, at least to me, when querying for the datastores HA is using for heartbeat. I query the cluster HA setting for the datastores it is using for heartbeat and the result doesn't always match what is shown in the vSphere HA Heartbeat monitoring. But maybe I'm looking at the wrong value.

$clusterView = $cluster | get-view
$clusterView.Configuration.DasConfig.HeartbeatDatastore

This shows me the datastores that HA should use for heartbeat. I'm just not sure if this is the running value (because that doesn't always match) or just the configured value and therefore not matches the datastores mentioned in the vSphere Web interface -> cluster -> monitor -> vSphere HA -> Heartbeat.

Anyone know if there is a different value I should query?

 

Some background info: We're moving to new storage arrays and after storage VMotioning datastores and wanting to unmount, our engineers often get the message the the datastore is still in use for HA heartbeating. So I wanted to report them the HA heartbeat datastores so they can change this before working on that cluster.

http://www.GabesVirtualWorld.com
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

You have to call the RetrieveDasAdvancedRuntimeInfo method to get at that info.
Something like this

$clusterName = 'cluster'
$cluster = Get-Cluster -Name $clusterName


$haConf = $cluster.ExtensionData.RetrieveDasAdvancedRuntimeInfo()
Get-View -Id $haConf.HeartbeatDatastoreInfo.Datastore | Select Name

 


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

View solution in original post

2 Replies
LucD
Leadership
Leadership

You have to call the RetrieveDasAdvancedRuntimeInfo method to get at that info.
Something like this

$clusterName = 'cluster'
$cluster = Get-Cluster -Name $clusterName


$haConf = $cluster.ExtensionData.RetrieveDasAdvancedRuntimeInfo()
Get-View -Id $haConf.HeartbeatDatastoreInfo.Datastore | Select Name

 


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

View solution in original post

Gabrie1
Commander
Commander

Thanks!!! Worked.

http://www.GabesVirtualWorld.com
0 Kudos