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!
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
have you look at this "ClusterDasConfigInfo"
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...
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
Thanks LucD!
That's it...i did not see this anymore....