PowerCLI Reference



This cmldlet modifies the configuration of a cluster.


Set-Cluster [-Cluster] <Cluster[]> [[-Name] <String>] [-DrsAutomationLevel <DrsAutomationLevel>] [-DrsEnabled <Boolean>] [-DrsMode <DrsMode>] [-EVCMode <String>] [-HAAdmissionControlEnabled <Boolean>] [-HAEnabled <Boolean>] [-HAFailoverLevel <Int32>] [-HAIsolationResponse <HAIsolationResponse>] [-HARestartPriority <HARestartPriority>] [-Profile <VMHostProfile>] [-RunAsync] [-Server <VIServer[]>] [-VMSwapfilePolicy <VMSwapfilePolicy>] [-VsanDiskClaimMode <VsanDiskClaimMode>] [-VsanEnabled <Boolean>] [-Confirm] [-WhatIf] [-CryptoMode <CryptoMode>] [<CommonParameters>]

Related Commands

Online Version

Detailed Description

This cmdlet modifies the configuration of a cluster. HAEnabled is automatically set to $true if some of the HA settings, HAAdmissionControlEnabled, HAFailoverLevel, HARestartPriority, or HAIsolationResponse are specified. DrsEnabled is automatically set to $true if some of the DRS settings, DrsAutomationLevel, or DrsMode are specified.


NameTypeDescriptionRequired?Pipeline InputDefault Value
ClusterCluster[]Specifies the name of the cluster you want to configure.trueTrue (ByValue)
NameStringSpecifies a new name for the cluster.falseFalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falseFalse
CryptoModeCryptoModeSpecifies the cluster encryption mode you want to configure. When set to OnDemand, hosts in the cluster are not required to be in a cryptographically "Safe" state. When set to ForceEnable, all hosts in the cluster are forced to be cryptographically "Safe", that is, vCenter Server has installed a host key on the host.falseFalse
DrsAutomationLevelDrsAutomationLevelSpecifies a DRS automation level. The valid values are FullyAutomated, Manual, and PartiallyAutomated.falseFalse
DrsEnabledBooleanIf specified, enables VMware DRS.falseFalse
DrsModeDrsModeThis parameter is deprecated and scheduled for removal. Use the DrsAutomationLevel parameter instead.

Specifies a DRS mode. The valid values are FullyAutomated, Manual, and PartiallyAutomated.
EVCModeStringSpecifies the EVC mode of the newly created cluster. If not specified or set to $null, EVC is disabled.falseFalse
HAAdmissionControlEnabledBooleanIndicates that the virtual machines in the cluster will not start if they violate availability constraints.falseFalse
HAEnabledBooleanIf specified, enables VMware High Availability.falseFalse
HAFailoverLevelInt32Specifies a failover level. This is the number of physical host failures that can be tolerated without impacting the ability to meet minimum thresholds for all running virtual machines. The valid values are in the range of 1 to 4.falseFalse
HAIsolationResponseHAIsolationResponseSpecifies whether the virtual machine should be powered off if a host determines that it is isolated from the rest of the compute resource. The valid values are PowerOff and DoNothing. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.falseFalse
HARestartPriorityHARestartPrioritySpecifies the cluster HA restart priority. The valid values are Disabled, Low, Medium, and High. VMware HA is a feature that detects failed virtual machines and automatically restarts them on alternative ESX/ESXi hosts. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.falseFalse
ProfileVMHostProfileSpecifies a host profile you want to associate with the cluster. If the value of this parameter is $null, the current profile association is removed.falseFalse
RunAsyncSwitchParameterIndicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.falseFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.falseFalse
VMSwapfilePolicyVMSwapfilePolicySpecifies the swapfile placement policy. The following values are valid:

InHostDataStore - stores the swapfile in the datastore specified by the VMSwapfileDatastoreID property of the virtual machine host. If the VMSwapfileDatastoreID property is not set or indicates a datastore with insufficient free space, the swapfile is stored in the same directory as the virtual machine. This setting might degrade the vMotion performance.

WithVM - stores the swapfile in the same directory as the virtual machine.
VsanDiskClaimModeVsanDiskClaimModeSpecifies the mode by which disks are claimed by vSAN.falseFalse
VsanEnabledBooleanSpecifies whether the vSAN feature is enabled on this cluster.falseFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

Zero or more modified Cluster objects



-------------------------- Example 1 --------------------------

Get-Cluster -Name "MyClusterName" | Set-Cluster -Name "NewClusterName" -HAEnabled:$true -HAAdmissionControlEnabled:$true -HAFailoverLevel 2 -VMSwapfilePolicy "InHostDatastore" -HARestartPriority "Low" -HAIsolationResponse "PowerOff"

Renames the "MyClusterName" cluster to "NewClusterName" and changes its VMware High Availability (HA) settings.

-------------------------- Example 2 --------------------------

Set-Cluster -Cluster "MyClusterName" -DRSEnabled:$true -DRSAutomationLevel "Manual"

Changes the VMware Distributed Resource Scheduler (DRS) settings of the "MyClusterName" cluster.

-------------------------- Example 3 --------------------------

Set-Cluster -Cluster "MyClusterName" -EVCMode "intel-nehalem"

Changes the VMware Enhanced vMotion Compatibility (EVC) settings of the "MyClusterName" cluster.

-------------------------- Example 4 --------------------------

Set-Cluster -Cluster "MyClusterName" -CryptoMode "ForceEnable"

Changes the encryption mode settings of the "MyClusterName" cluster.

Copyright © VMware, Inc. All rights reserved.