vCLS Retreat Mode: How to Enable and Disable using PowerCLI
In this article, we will explore how to enable and disable the vCLS Retreat Mode using PowerCLI. We will also discuss how to check the current state of the Retreat Mode and how to retreat a cluster using PowerCLI.
Background
———-
vSphere 7.0u1 introduced a new feature called vCLS (vSphere Cluster Services) which replaced the previous DRS (Distributed Resource Scheduler) and related clustering functionality. As part of this change, the Retreat Mode was moved from vCenter to vCLS. This means that the Retreat Mode is now controlled by vCLS rather than vCenter.
Enabling and Disabling Retreat Mode
————————————
To enable or disable the Retreat Mode for a cluster, we can use PowerCLI. We will start by connecting to our vCenter server using PowerCLI.
“`
$vc = Connect-VIServer -Name “vcenter-server”
“`
Next, we will retrieve information about the cluster using the Get-Cluster cmdlet.
“`
$cluster = Get-Cluster -Name “my-cluster”
“`
We can then check the current state of the Retreat Mode by using the Get-AdvancedSetting cmdlet.
“`
$retreatMode = Get-AdvancedSetting -Name “config.vcls.clusters.domain-c3012.enabled” -ComputeResource $cluster.MoRef
“`
If the Retreat Mode is currently enabled, we can disable it by setting the value of the Advanced Setting to false.
“`
$retreatMode = Get-AdvancedSetting -Name “config.vcls.clusters.domain-c3012.enabled” -ComputeResource $cluster.MoRef | Set-AdvancedSetting -Value $false
“`
Conversely, if the Retreat Mode is currently disabled, we can enable it by setting the value of the Advanced Setting to true.
“`
$retreatMode = Get-AdvancedSetting -Name “config.vcls.clusters.domain-c3012.enabled” -ComputeResource $cluster.MoRef | Set-AdvancedSetting -Value $true
“`
We can also check the current state of the Retreat Mode using the Get-AdvancedSetting cmdlet.
“`
$retreatMode = Get-AdvancedSetting -Name “config.vcls.clusters.domain-c3012.enabled” -ComputeResource $cluster.MoRef
“`
Retreating a Cluster
———————-
If we need to retreat a cluster, we can use the Set-Cluster cmdlet with the Retreat parameter set to true.
“`
$cluster = Get-Cluster -Name “my-cluster”
$cluster | Set-Cluster -Retreat $true
“`
This will retreat the cluster and disable the Retreat Mode. To enable the Retreat Mode again, we can use the same command with the Retreat parameter set to false.
“`
$cluster = Get-Cluster -Name “my-cluster”
$cluster | Set-Cluster -Retreat $false
“`
Conclusion
———-
In this article, we have covered how to enable and disable the vCLS Retreat Mode using PowerCLI. We have also discussed how to check the current state of the Retreat Mode and how to retreat a cluster using PowerCLI. It is important to note that the Retreat Mode should only be enabled or disabled by experienced administrators who understand the implications of changing this setting.