Creating Datacenter & Cluster using PowerCLI

A qucik one liner for creating datacenter and cluster using PowerCLI. We have good cmdlets in powerCLI which will help us to perform the task without need to open vSphere Client/webclient.

To create a Datacenter we have cmdlet called New-Datacenter which will help us to create a datacenter in the vCenter. The parametes required are Name and Location. The syntax to create a datacenter would be

New-Datacenter -Location “VI Container” -Name”DatacenterName


Once you have the datacenter created its now time to create a cluster and to do that we use the cmdlet New-Cluster. When creating the cluster you have option to enable HA and DRS using the below parameters

  • HAEnabled
  • DrsEnabled

It is also possible to set the advanced setting of HA & DRS like the automation level, Admission Control etc.

Syntax to create a cluster

New-Cluster -Location “String” -Name “String”


Incase if cluster is created without using any addition parameter one can use Set-Cluster to enable HA and DRS and set additional settings for the cluster

3Enjoy 🙂


You must be logged in to post a comment.

Proudly powered by WordPress   Premium Style Theme by