PowerCLI – Set-DatastoreHeartbeatConfig – Change Datastore Hearbeat configuration

0

Recently, there was an internal request where the Engineer wanted to change the Datastore Heartbeat Configuration on the HA cluster and he wanted to update the configuration using PowerCLI.

The task was to change the setting to Automatically select the datastores accessible from the hosts. There are three options available in the Web Client and can be seen below:

PowerCLI - Set-DatastoreHeartbeatConfig - Change Datastore Hearbeat configuration

The same can be done through PowerCLI and the values will be as per the same order:

  • allFeasibleDs
  • userSelectedDs
  • allFeasibleDsWithUserPreference

Therefore, I decided to create PowerCLI functions which will get the current setting and also help you modify the settings and names the functions Get-DatastoreHeartbeatConfig and Set-DatastoreHeartbeatConfig.

Below are the functions and they also accept value from pipeline meaning you can use Get-Cluster cmdlet and pipe these functions to change the settings.

The function currently accepts only two datastores as part of the User preference. Something that I think can be enhanced in the near future.

Now, let is go ahead and see this action. First, we will use the Get-DatastoreHeartbeatConfig to see the current Datastore Heartbeat Configuration.

Get-DatastoreHeartbeatConfig -Cluster Bangalore

OR

Get-Cluster Bangalore | Get-DatastoreHeartbeatConfig

PowerCLI - Set-DatastoreHeartbeatConfig - Change Datastore Hearbeat configuration

Next, let us change the current configuration to User Selected Datastores.

Set-DatastoreHeartbeatConfig -cluster Bangalore -Option userSelectedDs

OR

Get-Cluster Bangalore | Set-DatastoreHeartbeatConfig -Option userSelectedDs

Once the function starts to execute, you will see a window which will ask you to select two datastores as seen below:

PowerCLI - Set-DatastoreHeartbeatConfig - Change Datastore Hearbeat configuration

Click OK and the changes should take effect. You can also verify by going to the Cluster configuration again.

PowerCLI - Set-DatastoreHeartbeatConfig - Change Datastore Hearbeat configuration

I hope this has been informative and thank you for reading!

Share.

About Author

I am Adil Arif, working as a Technical Support Engineer at VMware as well as an independent blogger and founder of Enterprise Daddy. In my current role, I am supporting infrastructure related to Windows and VMware datacenters.

Leave A Reply

LIKE WHAT YOU'VE READ?
If so, please join the community.  I’d love to send you exclusive content right to your email, and I’ll send you a free copy of my book, VMware vSphere 6.0 Lab on Workstation too!
Enter your name and email below, and I’ll see you on the inside!

SUBSCRIBE