mthiha207au
Contributor
Contributor

PowerCLI Cluster "Admission Control"

Jump to solution

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?

pastedImage_0.png

Thanks!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Can't you do that with the Set-Cluster cmdlet and the HAAdmissionControlEnabled switch?


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership

Can't you do that with the Set-Cluster cmdlet and the HAAdmissionControlEnabled switch?


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

0 Kudos
mthiha207au
Contributor
Contributor

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

0 Kudos
nicholas1982
Hot Shot
Hot Shot

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?

Nicholas
0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
mikenyil
Contributor
Contributor
When I run this command, it changes the 'define host failover capacity by' back to the slot policy (powered-on VMs). Is there anyway to keep the cluster resource percentage setting in place at all?
0 Kudos
LucD
Leadership
Leadership

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

0 Kudos
IMMIAnt
Enthusiast
Enthusiast

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

0 Kudos