Set-Cluster Command | Vmware PowerCLI Reference

Set-Cluster

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.

Syntax

Set-Cluster
-Cluster < Cluster[] >
[ [-Name ] < String > ]
[-BaseImage < BaseImage > ]
[-Component < Component[] > ]
[-CryptoMode < CryptoMode > ]
[-DepotOverride < String[] > ]
[-DrsAutomationLevel < DrsAutomationLevel > ]
[-DrsEnabled < Boolean > ]
[-DrsMode < DrsMode > ]
[-EVCMode < String > ]
[-FirmwareAddon < Package > ]
[-HAAdmissionControlEnabled < Boolean > ]
[-HAEnabled < Boolean > ]
[-HAFailoverLevel < Int32 > ]
[-HAIsolationResponse < HAIsolationResponse > ]
[-HARestartPriority < HARestartPriority > ]
[-Profile < VMHostProfile > ]
[-ProgressAction < ActionPreference > ]
[-RemovedComponent < String[] > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[-VMSwapfilePolicy < VMSwapfilePolicy > ]
[-VendorAddOn < AddOn > ]
[-VsanDiskClaimMode < VsanDiskClaimMode > ]
[-VsanEnabled < Boolean > ]
[-VsanEsaEnabled < Boolean > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Cluster Cluster[] named
  • pipeline
  • wildcards
Specifies the name of the cluster you want to configure.
optional Name String 1
Specifies a new name for the cluster.
optional BaseImage BaseImage named
Specifies the ESXi base image that the cluster's hosts should comply with.
optional Component Component[] named
Specifies the ESXi components that the cluster's hosts should comply with.
optional CryptoMode CryptoMode named
Specifies 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.
optional DepotOverride String[] named
Specifies a depot address from where the cluster can fetch metadata and resources for the vSphere Lifecycle Manager operations.
optional DrsAutomationLevel DrsAutomationLevel named
Specifies a DRS automation level. The valid values are FullyAutomated, Manual, and PartiallyAutomated.
optional DrsEnabled Boolean named
If specified, enables VMware DRS.
optional DrsMode DrsMode named
This parameter is deprecated and scheduled for removal. Use the DrsAutomationLevel parameter instead. Specifies a DRS mode. The valid values are FullyAutomated, Manual, and PartiallyAutomated.
optional EVCMode String named
Specifies the EVC mode of the newly created cluster. If not specified or set to $null, EVC is deactivated.
optional FirmwareAddon Package named
Specifies a package from a hardware support manager that the hosts on a cluster should comply with. This parameter has been renamed from "Package". A PowerShell alias "Package" for this parameter has been added for backward compatibility of PowerShell scripts.
optional HAAdmissionControlEnabled Boolean named
Indicates that the virtual machines in the cluster will not start if they violate availability constraints.
optional HAEnabled Boolean named
If specified, enables VMware High Availability.
optional HAFailoverLevel Int32 named
Specifies 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.
optional HAIsolationResponse HAIsolationResponse named
Specifies 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 deactivated in a future release.
optional HARestartPriority HARestartPriority named
Specifies the cluster HA restart priority. The valid values are Disabled, Lowest, Low, Medium, High, and Highest. 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 deactivated in a future release.
optional Profile VMHostProfile named
  • wildcards
Specifies a host profile you want to associate with the cluster. If the value of this parameter is $null, the current profile association is removed.
optional ProgressAction ActionPreference named
optional RemovedComponent String[] named
Specifies a list of components that you want to remove from the base image. Calling the commandlet with a new value for this parameter overrides any previously configured value. It does not add new components to the list of removed ones. To reset the list of removed components provide an empty array to this parameter.
optional RunAsync SwitchParameter named
Indicates 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.
optional Server VIServer[] named
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.
optional VMSwapfilePolicy VMSwapfilePolicy named
Specifies 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.
optional VendorAddOn AddOn named
Specifies the ESXi vendor add-on that the cluster's hosts should comply with.
optional VsanDiskClaimMode VsanDiskClaimMode named
Specifies the mode by which disks are claimed by vSAN.
optional VsanEnabled Boolean named
Specifies whether the vSAN feature is enabled on this cluster.
optional VsanEsaEnabled Boolean named
Indicates that the vSAN ESA feature is enabled on this cluster. This feature is supported from vSphere 8.0.
Set-Cluster
-Cluster < Cluster[] >
-Remediate
[-AcceptEULA ]
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Cluster Cluster[] named
  • pipeline
  • wildcards
Specifies the name of the cluster you want to configure.
required
Remediate SwitchParameter named
Indicates that you want to remediate the cluster's hosts to the target state.
optional AcceptEULA SwitchParameter named
Indicates that the End User License Agreement (EULA) is accepted for the images that you want to install on the cluster's hosts in order to comply with the target state.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates 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.
optional Server VIServer[] named
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.

Output

VMware.VimAutomation.ViCore.Types.V1.Inventory.Cluster

Examples

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.

Example 5

Set-Cluster -Cluster "MyClusterName" -BaseImage $myBaseImage -RemovedComponent "VMware Host Client"

Customizes the base image by removing a component. With vSphere 8.0 Update 3, you can remove only the VMware Host Client and ESXi VM Tools components from the base image.

Related Commands

Cluster

This cmdlet retrieves the clusters available on a vCenter Server system.

This cmdlet moves a vCenter Server cluster from one location to another.

This cmdlet creates a new cluster.

This cmdlet deletes the specified clusters.

This cmldlet modifies the configuration of a cluster.