VMware Cloud Community
Bernhard1502
Contributor
Contributor
Jump to solution

Configure Cluster, HBDatastoreCandidatePolicy

Hi All,

i want to configure a (new) Cluster with PowerCLI v5.

Now i want to set the HBDatastoreCandidatePolicy -Option to use all feasible Datastores. When i run the script i get a Error "invalid argument". With PowerCLI i see the setting is ok, in vSphere Client the setting is on old Radiobutton...

What am i doing wrong?

Here's my function:

function

Set-HBDataStorePolicy() {

param

(

[

string] $ClusterName, #zu bearbeitender Cluster

[

string] $Policy #welche Richtlinie für Datenspeicher Taktsignale soll gewählt werden

#erlaubte Werte: allFeasibleDs, allFeasibleDsWithUserPreference, userSelectedDs

)

$clusterMoRef = Get-Cluster -Name $ClusterName | Get-View

#Cluster und Heartbeat-Datastore-ConfigInfo bauen

$clusterSpec = New-Object VMware.Vim.ClusterConfigSpecEx

#bestehende Configuration kopieren

$dasInfo = $clusterMoRef.Configuration.DasConfig

#Datenspeicher Taktsignale auf den übergebenen Parameter setzen

$dasInfo.HBDatastoreCandidatePolicy = $Policy

$clusterSpec.DasConfig = $dasInfo

$clusterMoRef.ReconfigureComputeResource($clusterSpec,$true) | Out-Null

}


Call the function:

Set-HBDataStorePolicy -ClusterName "Cl01" -Policy "allFeasibleDS"


Thank you!

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try the call with

Set-HBDataStorePolicy -ClusterName "MyCluster" -Policy "allFeasibleDs"

These values are often case-sensitive (notice the lower-case 's' at the end).


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

View solution in original post

Reply
0 Kudos
4 Replies
MartinAmaro
Expert
Expert
Jump to solution

have you look at this "ClusterDasConfigInfo"

http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.cluster.Da...

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful.
Reply
0 Kudos
Bernhard1502
Contributor
Contributor
Jump to solution

yes, thank you.

I tried both - to modify the settings and to set it to default ($true and $false). With both options is the result the same...

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try the call with

Set-HBDataStorePolicy -ClusterName "MyCluster" -Policy "allFeasibleDs"

These values are often case-sensitive (notice the lower-case 's' at the end).


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

Reply
0 Kudos
Bernhard1502
Contributor
Contributor
Jump to solution

Thanks LucD!

That's it...i did not see this anymore....

Reply
0 Kudos