VMware Cloud Community
mthiha207au
Enthusiast
Enthusiast
Jump to solution

PowerCLI Cluster "Admission Control"

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!

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

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


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

Reply
0 Kudos
mthiha207au
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
nicholas1982
Hot Shot
Hot Shot
Jump to solution

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
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
mikenyil
Contributor
Contributor
Jump to solution

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?
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
IMMIAnt
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos