vSphere 5 Top 10 – HA

The second post originating from our presentation at the Dutch VMUG Event 2011 is about HA. vSphere High Availability appeared in the 2nd place of the vSphere 5 features Top 10. For the HA feature we showed how you could find out the FDM master and slaves in your cluster, and how to find the heartbeat datastore.

The FDM roles

The following script will show,for each cluster node, which FDM role it holds.

To call the function you can pass a clustername or the output of a Get-Cluster cmdlet. Something like this.

or this

The output looks like this

Note that there are more DasHostState values, besides master and connectedToMaster, possible. The complete list can be found in the ClusterDasFdmAvailabilityState enumeration.

And you can of course provide this functionality as a New-VIProperty.

Now you can find the FDM states with a call like this

The output will look exactly the same as the output that comes out of the Get-DasHostState function.

The heartbeat datastore

Another HA novelty in vSphere 5 is that it will now use, besides a network-based heartbeat, a datastore heartbeat, to check the presence of the nodes. To find out which of the shared datastores is used as the heartbeat datastore, you can use the following function.

The function can be called again with the name of a cluster or with the object returned by the Get-Cluster cmdlet.

The output looks something like this.

And of course, the same functionality as a New-VIProperty.

You can now use the HeartbeatDatastore property to get the datastore that is used for the heartbeat.

Which will result in

Enjoy !

7 Comments

    Bern

    Hi LucD

    Below argument shows when host HA State is on N/A, how can I convert it to readable output instead? (eg. Not Applicable)

    Get-View : Cannot validate argument on parameter ‘Id’. The argument is null or empty. Provide an argument that is not null or empty, and then try the
    command again.
    At E:\vmw\Get-DasHostState.ps1:23 char:31
    + StateReporter = (Get-View -Id $_.RunTime.DasHostState.StateReporter -Property Na …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Get-View], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    jrob24

    I believe that line09 in the function Get-DasHostState might need to be updated. When I run the function it returns all of the FDM roles for ALL of the hosts in vCenter. I changed it to:

    Get-View $cluster.ExtensionData.Host -Property Name,Runtime.DasHostState

    That only returned the roles from the specified cluster, which was the output I was looking for.

      LucD

      Thanks for spotting that one jrob24, you’re absolutely right.
      A typo, in the New-VIProperty I did use the correct MoRef.
      I correct the script.

    Abhishek

    Lucd,

    Thanks so much, this is useful for me.

      LucD

      Thanks, glad it’s useful for you.

    Rick van Wijnen

    Luc,
    Thanks very much! You write so much useful stuff!
    Kind regards,
    Rick

    Uttam kumar

    Gr8′
    How can we find out same information thro esxi cmd console,In previous version we cold execute ./Cli and know the pri or sec…but here in new stuff the master n the slaves.
    Uttam.kr@gmail.com

    Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.