New-Cluster
This cmdlet creates a new cluster with the provided inputs in the location that is specified by the Location parameter. 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
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Location | VIContainer | named |
|
Specifies the location where you want to place the new cluster. If a data center is specified for the Location parameter, the cluster is created in its "hostFolder" folder. The "hostFolder" is a system folder and is guaranteed to exist. |
required
|
Name | String | named |
|
Specifies the name of the new cluster. |
optional | BaseImage | BaseImage | named |
|
Specifies the ESXi base image that the cluster's hosts should comply with. |
optional | CryptoMode | CryptoMode | named |
|
Specifies the cluster encryption mode. 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 in a cryptographically "Safe", that is, vCenter Server has installed a host key on the host. |
optional | DrsAutomationLevel | DrsAutomationLevel | named |
|
Specifies a DRS automation level. The valid values are FullyAutomated, Manual, and PartiallyAutomated. |
optional | DrsEnabled | SwitchParameter | 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 VMware EVC mode of the newly created cluster. If not specified or set to $null, EVC is deactivated. |
optional | HAAdmissionControlEnabled | SwitchParameter | named |
|
Indicates that virtual machines cannot be powered on if they violate availability constraints. |
optional | HAEnabled | SwitchParameter | named |
|
If specified, enables VMware HA. |
optional | HAFailoverLevel | Int32 | named |
|
Specifies a configured 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 |
|
Indicates that 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 hosts. Passing values to this parameter through a pipeline is deprecated and will be deactivated in a future release. |
optional | ProgressAction | ActionPreference | named |
|
|
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 that is specified by the VMSwapfileDatastoreID property of the virtual machine host. If the VMSwapfileDatastoreID property is not set or indicates a datastore with unsufficient free space, store the swapfile 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. If not specified and VsanEnabled is specified, the assumed value is Manual. |
optional | VsanEnabled | SwitchParameter | named |
|
Indicates that the vSAN feature is enabled on this cluster. |
optional | VsanEsaEnabled | SwitchParameter | named |
|
Indicates that the vSAN ESA feature is enabled on this cluster. This feature is supported from vSphere 8.0. |
Output
VMware.VimAutomation.ViCore.Types.V1.Inventory.ClusterExamples
Example 1
New-Cluster -Name "MyCluster" -Location "MyDatacenter"
Creates a new cluster named "MyCluster" in the "MyDatacenter" data center.
Example 2
New-Cluster -Name "MyCluster" -Location "MyDatacenter" -HAEnabled -HAAdmissionControlEnabled -HAFailoverLevel 2 -VMSwapfilePolicy "InHostDatastore" -HARestartPriority "Low" -HAIsolationResponse "PowerOff"
Creates a new cluster named "MyCluster" in the "MyDatacenter" data center with specified VMware Hgh Availability (HA) settings.
Example 3
New-Cluster -Name "MyCluster" -Location "MyDatacenter" -DRSEnabled -DRSAutomationLevel 'Manual'
Creates a new cluster named "MyCluster" in the "MyDatacenter" data center with specified VMware Distributed Resource Scheduler (DRS) settings.
Example 4
New-Cluster -Name "MyCluster" -Location "MyDatacenter" -EVCMode 'intel-nehalem'
Creates a new cluster named "MyCluster" in the "MyDatacenter" data center with specified VMware Enhanced vMotion Compatibility (EVC) settings.
Example 5
New-Cluster -Name "MyCluster" -Location "MyDatacenter" -CryptoMode 'ForceEnable'
Creates a new cluster named "MyCluster" in the "MyDatacenter" data center with the specified cluster encryption mode.
Example 6
New-Cluster -Name "MyCluster" -Location "MyDatacenter" -VsanEnabled -VsanEsaEnabled
Creates a new cluster named "MyCluster" in the "MyDatacenter" data center with features vSAN enabled and vSAN ESA enabled. Note: You can use the vSAN ESA enabled feature starting from vSphere 8.0.
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.