Set-VsanClusterConfiguration Command | Vmware PowerCLI Reference

Set-VsanClusterConfiguration

This cmdlet modifies vSAN configuration settings for a cluster.

Syntax

Set-VsanClusterConfiguration
-Configuration < VsanClusterConfiguration[] >
[-AddSilentHealthCheck < String[] > ]
[-AllowReducedRedundancy < Boolean > ]
[-CapacityThreshold < VsanHealthCheckThreshold[] > ]
[-CustomizedSwapObjectEnabled < Boolean > ]
[-DefaultIncomingChapSecret < SecureString > ]
[-DefaultIncomingChapUser < String > ]
[-DefaultIscsiNetworkInterface < String > ]
[-DefaultIscsiTargetAuthenticationType < VsanIscsiTargetAuthenticationType > ]
[-DefaultIscsiTcpPort < Int32 > ]
[-DefaultOutgoingChapSecret < SecureString > ]
[-DefaultOutgoingChapUser < String > ]
[-FileServiceEnabled < Boolean > ]
[-FileServiceNetwork < Network > ]
[-GuestTrimUnmap < Boolean > ]
[-HealthCheckIntervalMinutes < Int32 > ]
[-HistoricalHealthEnabled < Boolean > ]
[-HostRebuildReservationState < VsanCapacityReservationState > ]
[-IscsiTargetServiceEnabled < Boolean > ]
[-LargeClusterSupported < Boolean > ]
[-MountRemoteDatastore < Datastore[] > ]
[-MountXVCDatastore < VsanHCIMeshDatastore[] > ]
[-ObjectRepairTimerMinutes < Int64 > ]
[-PerformanceServiceEnabled < Boolean > ]
[-PreferredFaultDomain < VsanFaultDomain > ]
[-ProactiveRebalanceEnabled < Boolean > ]
[-ProactiveRebalanceThreshold < Int32 > ]
[-ProgressAction < ActionPreference > ]
[-RemoteVsanServerClusterConfig < RemoteVsanServerClusterConfig > ]
[-RemoveSilentHealthCheck < String[] > ]
[-ResyncThrottlingMbps < Int32 > ]
[-Server < VIServer[] > ]
[-SiteReadLocalityEnabled < Boolean > ]
[-SpaceCompressionEnabled < Boolean > ]
[-SpaceEfficiencyEnabled < Boolean > ]
[-StoragePolicy < SpbmStoragePolicy > ]
[-StoragePolicyForIscsiTargetService < SpbmStoragePolicy > ]
[-StretchedClusterEnabled < Boolean > ]
[-UnmountRemoteDatastore < Datastore[] > ]
[-UnmountXVCDatastore < VsanHCIMeshDatastore[] > ]
[-VsanBaselinePreference < VsanBaselinePreferenceType > ]
[-VsanMaxEnabled < Boolean > ]
[-VsanOperationReservationState < VsanCapacityReservationState > ]
[-WitnessHost < VMHost > ]
[-WitnessHostCacheDisk < String > ]
[-WitnessHostCapacityDisk < String[] > ]
[-WitnessHostStoragePoolDisk < String[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Configuration VsanClusterConfiguration[] named
  • pipeline
  • wildcards
Specifies the configurations that you want to modify. This parameter supports OBN based on the names of the associated cluster. This parameter also directly accepts objects of type Cluster by silently converting them to the configuration object through ArgumentTransformationAttribute.
optional AddSilentHealthCheck String[] named
Specifies the health checks list you want to add to the silent list.
optional AllowReducedRedundancy Boolean named
Allows a reduced redundancy state. This optional parameter is applicable to specific vSAN cluster reconfigure operations that need to migrate data across cluster for changing the vSAN disk format. When specified, it might make the process move lesser data in order to ensure storage object accessibility, and some objects are kept at reduced redundancy state, which means at a higher risk in case of a hardware failure during the migration process. This is applicable to the SpaceEfficiencyEnabled parameter only. The default value is False.
optional CapacityThreshold VsanHealthCheckThreshold[] named
Specifies the list of capacity thresholds for different kinds of datastores.
optional CustomizedSwapObjectEnabled Boolean named
Activates and deactivates customer's control over the 'proportionalCapacity' policy for the swap object. The default value is False.
optional DefaultIncomingChapSecret SecureString named
Specifies the default CHAP secret for iSCSI targets on this cluster. Applicable when the authentication type is Chap or MutualChap.
optional DefaultIncomingChapUser String named
Specifies the default CHAP user name for the iSCSI targets on this cluster. Applicable when the authentication type is Chap or MutualChap.
optional DefaultIscsiNetworkInterface String named
Specifies the default VMkernel network interface which handles the iSCSI traffic. This can be overridden per target. It's mandatory if IscsiTargetServiceEnabled is specified as $true. This parameter accepts an object of type HostVMKernelVirtualNic by silently converting it to the string name by using ArgumentTransformationAttribute.
optional DefaultIscsiTargetAuthenticationType VsanIscsiTargetAuthenticationType named
Specifies the default authentication type for the vSAN iSCSI targets in this cluster.
optional DefaultIscsiTcpPort Int32 named
Specifies the default network port for the iSCSI targets. This can be overridden per target. If not provided, the default port 3260 is used. The server automatically opens the firewall for the specified port.
optional DefaultOutgoingChapSecret SecureString named
Specifies the default CHAP user secret you want to attach to the initiator. This is applicable when the authentication type is MutualChap.
optional DefaultOutgoingChapUser String named
Specifies the default CHAP user name you want to attach to the initiator. This is applicable when the authentication type is MutualChap.
optional FileServiceEnabled Boolean named
Specifies whether to enable the file service or not. If the value is True, a suitable network should be provided. Note that the file service enablement process takes a long time. Set WebOperationsTimeout to a value such as 1 hour by running Set-PowerCLIConfiguration -WebOperationTimeoutSeconds 3600.
optional FileServiceNetwork Network named
  • wildcards
Specifies the network on which you want to deploy the file service to provide file access. The vSAN File services is supported on DVS version 6.6.0 or later. Creates a dedicated port group for the vSAN File Service in the DVS. The Promiscuous mode and Forged transmits are enabled as part of the vSAN file services enablement process for the provided network entity. If you use NSX-based networks, ensure that similar settings are configured for the provided network entity from the NSX admin console.
optional GuestTrimUnmap Boolean named
Specifies the TRIM/UNMAP for the respective ATA and SCSI protocols. If this setting switches from deactivated to activated for any UNMAP request to the vSAN datastore from powered on virtual machines, this takes effect and succeeds immediately. If you switch it from activated to deactivated dynamically, the running virtual machines that reside on this vSAN datastore understand this change until virtual machine rebooting happens. The default value is False.
optional HealthCheckIntervalMinutes Int32 named
Specifies the health check interval in minutes. If the value of the parameter is non-zero, the health check feature is enabled on the cluster and a health check frequency is set to the specified value. If the value of the parameter is zero, the health check feature is deactivated on the cluster. The accepted values are in the range of 15 minutes to one day (1440 minutes).
optional HistoricalHealthEnabled Boolean named
Activates or deactivates the historical health service on a vSAN cluster.
optional HostRebuildReservationState VsanCapacityReservationState named
Specifies whether the host rebuild threshold is reported from the Get-VsanSpaceUsage cmdlet or vSAN should reserve the capacity to repair objects after a host failure.
optional IscsiTargetServiceEnabled Boolean named
Activates or deactivates the iSCSI target service on a vSAN cluster.
optional LargeClusterSupported Boolean named
Specifies whether large cluster supported feature is enabled or not. If this option is changed before vSAN enabled, you can apply it at the host side immediately. If you change it on a vSAN cluster, all hosts are required to reboot to apply the change. After setting this, review the vSAN health check result which can help to figure out which host requires rebooting. The default value is False.
optional MountRemoteDatastore Datastore[] named
Specifies the remote vSAN datastores (provided by other vSAN clusters) to be mounted to the target vSAN cluster.
optional MountXVCDatastore VsanHCIMeshDatastore[] named
Specifies the remote vSAN datastores from a remote vCenter to be mounted to the target vSAN cluster. You can use this parameter starting from vSAN 8.0 Update 1.
optional ObjectRepairTimerMinutes Int64 named
Determines the delay time in minutes for the missing component to come back before starting the repair process. Allowed values: 0 to 4294967295 Default value: 60.
optional PerformanceServiceEnabled Boolean named
Activates or deactivates the performance service on a vSAN cluster.
optional PreferredFaultDomain VsanFaultDomain named
  • wildcards
Specifies the preferred fault domain. If stretched cluster configuration is enabled, this becomes the preferred fault domain for this cluster. The other fault domain in this stretched cluster becomes the secondary fault domain.
optional ProactiveRebalanceEnabled Boolean named
Specifies whether the proactive rebalance is enabled. If the value is set to True, rebalance data movement starts when the following requirements are met within the vSAN cluster: 1. Current disk fullness - lowest disk fullness > proactive threshold. 2. Current disk fullness > mean disk fulless within cluster. The default value is False.
optional ProactiveRebalanceThreshold Int32 named
Indicates the extent of the imbalance that the cluster can tolerate in percentage. If the disk imbalance (current disk fullness - lowest disk fullness) is below the rebalance threshold, the proactive rebalance will not be triggered. The allowed values are from 25 to 75. The default value is 30.
optional ProgressAction ActionPreference named
optional RemoteVsanServerClusterConfig RemoteVsanServerClusterConfig named
Specifies the remote vSAN server cluster configuration of a stretched cluster for the datastore to be mounted. Use this parameter in combination with the MountRemoteDatastore parameter with one datastore at a time. You can use this parameter starting from vSAN 8.0 Update 1.
optional RemoveSilentHealthCheck String[] named
Specifies the health checks list you want to remove from the silent list.
optional ResyncThrottlingMbps Int32 named
Specifies the resynchronization traffic limit in Mbps for each disk group in the cluster. The valid values are from 1 to 512. If the value of the parameter is zero, throttling resynchronization traffic limits are deactivated.
optional Server VIServer[] named
  • wildcards
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 SiteReadLocalityEnabled Boolean named
Activates and deactivates site read locality. The default value is True.
optional SpaceCompressionEnabled Boolean named
Activates or deactivates the compression only mode on a vSAN cluster.
optional SpaceEfficiencyEnabled Boolean named
Activates or deactivates the deduplication and compression on a vSAN cluster. Both deduplication and compression are activated or deactivated together.
optional StoragePolicy SpbmStoragePolicy named
  • wildcards
Specifies the storage policy. This parameter is applicable in the context of enabling the vSAN performance service. The vSAN performance history database is stored as a vSAN object. The policy controls the availability, space consumption, and performance of that object. If the object becomes unavailable, the performance history for that cluster is also unavailable.
optional StoragePolicyForIscsiTargetService SpbmStoragePolicy named
Specifies the storage policy for the iSCSI target service. When you enable the iSCSI target service, vSAN creates a home object that stores metadata for the iSCSI target service. The storage policy for the home object should have a number of failures to tolerate.
optional StretchedClusterEnabled Boolean named
Activates or deactivates a stretched cluster configuration.
optional UnmountRemoteDatastore Datastore[] named
Specifies the remote vSAN datastores (provided by other vSAN clusters) to be unmounted from the target vSAN cluster.
optional UnmountXVCDatastore VsanHCIMeshDatastore[] named
Specifies the remote vSAN datastores from a remote vCenter to be unmounted from the target vSAN cluster. You can use this parameter starting from vSAN 8.0 Update 1.
optional VsanBaselinePreference VsanBaselinePreferenceType named
Specifies the baseline preference policy for the current vSAN cluster.
optional VsanMaxEnabled Boolean named
Specifies whether to enable vSAN Max service. If the value is True, the cluster should be vSAN ESA enabled.
optional VsanOperationReservationState VsanCapacityReservationState named
Specifies whether the vSAN operation space threshold is reported from the Get-VsanSpaceUsage cmdlet or vSAN should reserve the capacity to perform internal operations.
optional WitnessHost VMHost named
  • wildcards
Specifies the witness host virtual machine in case StretchedClusterEnabled is enabled. It can also be a vSphere virtual appliance called witness appliance. Requirements for the witness host: - Must not be part of any vSAN-enabled cluster. - Must have at least one VMkernel adapter with vSAN traffic enabled. - The adapter must be connected to all hosts in the stretched cluster. In vSAN versions earlier than 6.6, this parameter is only applicable when enabling stretched cluster. If StretchedClusterEnabled is not specified or is false, this parameter is ignored.In vSAN 6.7 or later, this parameter can be specified to update the witness host in a stretched cluster.
optional WitnessHostCacheDisk String named
Specifies ? cache disk canonical name for the disk group that you want to create on the witness host. This parameter accepts ScsiLun or VMHostDisk objects through argument transformation.
optional WitnessHostCapacityDisk String[] named
Specifies the capacity disk canonical names for the disk group that you want to create on the witness host. This parameter accepts ScsiLun or VMHostDisk objects through argument transformation.
optional WitnessHostStoragePoolDisk String[] named
Specifies the disk canonical names for the storage pool that you want to create on the witness host. This parameter accepts ScsiLun or VMHostDisk objects through argument transformation. This parameter is available starting from vSphere 8.0.

Output

VMware.VimAutomation.Storage.Types.V1.Vsan.VsanClusterConfiguration

Examples

Example 1

Set-VsanClusterConfiguration -Configuration (Get-VsanClusterConfiguration $cluster) -SpaceEfficiencyEnabled $true -HealthCheckIntervalMinutes 120

Enables the space efficiency on the $cluster cluster and sets the periodic health check interval to 120 minutes.

Example 2

Set-VsanClusterConfiguration -Configuration "MyCluster" -StretchedClusterEnabled $true -PreferredFaultDomain $fd -WitnessHost $vmHost

Enables a stretched cluster on the "MyCluster" cluster and specifies $fd as the primary fault domain and $vmHost as the witness host.

Example 3

Set-VsanClusterConfiguration -Configuration "MyCluster" -PerformanceServiceEnabled $true -StoragePolicy $policy

Enables a performance service on the "MyCluster" cluster and associates the performance history database object with the $policy storage policy.

Example 4

Set-VsanClusterConfiguration -Configuration (Get-VsanClusterConfiguration $cluster) -HealthCheckIntervalMinutes 0

Deactivates the health check service on the "MyCluster" cluster.

Example 5

Set-VsanClusterConfiguration -Configuration $cluster -SiteReadLocalityEnabled $true -CustomizedSwapObjectEnabled $true -ObjectRepairTimerInMinutes 100

Deactivates periodic health checks on the $cluster cluster.

Example 6

Set-VsanClusterConfiguration -Configuration $cluster -CapacityThreshold (New-VsanHealthCheckThreshold -Enabled 1 -YellowValue 90 -RedValue 99 -Target VsanDirectDatastore )

Sets a vSAN health check threshold for VsanDirectDatastore on the $cluster cluster.

Example 7

Set-VsanClusterConfiguration -Configuration $config -HistoricalHealthEnabled 0

Deactivates the vSAN historical health service on the $cluster cluster.

Example 8

Set-VsanClusterConfiguration -Configuration $cluster -MountRemoteDatastore (Get-Datastore)[0]

Mounts a datastore from another cluster as a remote datastore on the $cluster cluster.

Example 9

$serverconfig = New-RemoteVsanServerClusterConfig -cluster $clusterServer -networktopology "Asymmetric" -ServerSiteName "Secondary"
Set-VsanClusterConfiguration -configuration $clusterClient -mountremotedatastore $datastore -remoteVsanServerClusterConfig $serverconfig

Mounts the $datastore datastore from the $clusterServer stretched cluster as a remote datastore on the $clusterClient jon-stretched cluster with the $serverconfig RemoteVsanServerClusterConfig object.

Example 10

$serverconfig = New-RemoteVsanServerClusterConfig -cluster $clusterServer -networktopology "Asymmetric" -ServerSiteName "Secondary" -ClientSiteName "Preferred"
Set-VsanClusterConfiguration -configuration $clusterClient -mountremotedatastore $datastore -remoteVsanServerClusterConfig $serverconfig

Mounts the $datastore datastore from the $clusterServer stretched cluster as a remote datastore on the $clusterClient stretched cluster with the $serverconfig RemoteVsanServerClusterConfig object.

Example 11

New-VsanHCIMeshDatastoreSource -User '[email protected]' -VCHost '10.161.94.0' -Password 'KUCKM:z3zoyn-g1Q'
$dsSource = Get-VsanHCIMeshDatastoreSource -VCHost '10.161.94.0'
$ds = Get-VsanHCIMeshDatastore -VsanHCIMeshDatastoresource $dsSource
Set-VsanClusterConfiguration -Configuration $clusterClient -MountXVCDatastore $ds

Creates a vSAN HCI Mesh datastore source from a remote vCenter Server with the specified information. Mounts the $ds datastore from the $dsSource datastore source as a remote datastore on the $clusterClient cluster.

Example 12

New-Cluster -Name 'test1'-Location 'DataCenter' -VsanEnabled
$config = get-vsanclusterconfiguration -cluster 'test1'
Set-VsanClusterConfiguration -Configuration $config -VsanMaxEnabled $True

Creates a vSAN enabled cluster named "test1". Enables vSAN Max in cluster "test1", enables vSAN ESA will be enabled by default automatically at the sanme time. Note that enablement of vSAN Max has to be in the process of cluster creation.

Example 13

New-Cluster -Name 'test2'-Location 'DataCenter' -VsanEnabled -VsanEsaEnabled
$config = get-vsanclusterconfiguration -cluster 'test2'
Set-VsanClusterConfiguration -Configuration $config -VsanMaxEnabled $True

Creates a vSAN and vSAN ESA enabled cluster named "test2". Enables vSAN Max in cluster "test2". Note that enablement of vSAN Max has to be in the process of cluster creation.

Related Commands

VsanCluster

This cmdlet executes vSAN cluster power on.

This cmdlet powers off a vSAN cluster.

VsanClusterConfiguration

This cmdlet retrieves vSAN related configuration data from clusters.

This cmdlet modifies vSAN configuration settings for a cluster.

VsanClusterDiskUpdate

This cmdlet starts the update of all vSAN disks of a cluster to the latest vSAN disk format version supported by the cluster.

VsanClusterHealth

This cmdlet runs a health test on the specified vSAN clusters and returns the test results.

VsanClusterPowerState

This cmdlets retrieves the power state of a vSAN cluster.

VsanClusterRebalance

This cmdlet starts the proactive rebalance of the vSAN objects on the cluster hosts based on the vSAN disks usage when the disks are in imbalanced state.

This cmdlet stops the proactive rebalance of the vSAN objects on the cluster hosts.