Hi All,
with update of HA behaviour in 6.5, I have to update Admission Control setting in my environment. I need to uncheck "Override failover capacity...".
I am looking for PowerCLI command to do it as I have a number of clusters to be updated.
The only closet place I can find is under (Get-Cluster test01).ExtensionData.Configuration.dasconfig.admissioncontrolpolicy
Is there anyway to do this via PowerCLI?
Thanks!
Can't you do that with the Set-Cluster cmdlet and the HAAdmissionControlEnabled switch?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Can't you do that with the Set-Cluster cmdlet and the HAAdmissionControlEnabled switch?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD. You are right.
Setting -HAAdmissionControlEnabled switch to True set back to default and uncheck the setting.
Get-Cluster test01 | Set-Cluster -HAAdmissionControlEnabled:$True -Confirm:$false
Hi Luc,
Can you confirm this still works, i'm trying to set "override calculated failover capacity" but HAAdmissionControlEnabled does not seem to work, i can't even find the API for it?
Yes, the following still works for me (PowerCLI 6.5.4 in vSPhere 6.5U1)
Note that you have to include the failover method.
Get-Cluster MyCluster | Set-Cluster -HAAdmissionControlEnabled $true -HAFailoverLevel 1 -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Not with the cmdlet afaik, you'll have to use the API method.
Something like this (as a sample I configured both percentages to 33%)
$clusterName = 'MyCluster'
$cluster = Get-Cluster -Name $clusterName
$spec = New-Object VMware.Vim.ClusterConfigSpec
$spec.DasConfig = New-Object VMware.Vim.ClusterDasConfigInfo
$spec.DasConfig.AdmissionControlPolicy = New-Object VMware.Vim.ClusterFailoverResourcesAdmissionControlPolicy
$spec.DasConfig.AdmissionControlPolicy.AutoComputePercentages = $false
$spec.DasConfig.AdmissionControlPolicy.CpuFailoverResourcesPercent = 33
$spec.DasConfig.AdmissionControlPolicy.MemoryFailoverResourcesPercent = 33
$cluster.ExtensionData.ReconfigureCluster($spec,$true)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I had issues getting the configuration to work unless I turned off HA first and then turned it back on and configured the settings. See below
$clusterName = "MyCluster"
$cluster = Get-Cluster -Name $clusterName
$spec = New-Object VMware.Vim.ClusterConfigSpec
$spec.DasConfig = New-Object VMware.Vim.ClusterDasConfigInfo
$spec.DasConfig.Enabled = $false
$cluster.ExtensionData.ReconfigureCluster($spec,$true)
$spec.DasConfig.Enabled = $true
$spec.DasConfig.AdmissionControlPolicy = New-Object VMware.Vim.ClusterFailoverResourcesAdmissionControlPolicy
$spec.DasConfig.AdmissionControlPolicy.AutoComputePercentages = $false
$spec.DasConfig.AdmissionControlPolicy.CpuFailoverResourcesPercent = 50
$spec.DasConfig.AdmissionControlPolicy.MemoryFailoverResourcesPercent = 50
$cluster.ExtensionData.ReconfigureCluster($spec,$true)
Is there any way to get the settings to stick without disabling HA and then re-enabling it?
Not to worry I have worked out how to do it. Just need to add the line
$spec.DasConfig.Enabled = $true
And this allows the update to happen without needing to disable HA first