Q: What VMware PowerCLI commands will create a datacenter and cluster, and then join hosts?
June 8, 2011
A: VMware PowerCLI is a command-line shell for executing Windows PowerShell scripts or commands against VMware ESX or ESXi servers. A separate installation, PowerCLI can be downloaded from VMware's site.
Four commands are necessary to connect to a vCenter server, create a datacenter and cluster, and then join hosts to the cluster. Those four commands, in order, are
Connect-VIServer –username -password
New-DataCenter –Location –Name
New-Cluster –Location -Name -DRSEnabled –DrsAutomationLevel FullyAutomated –HAEnabled –HAAdmissionControlEnabled
Add-VMHost -Location -Password
Note in the third command above that both DRS and HA are enabled for the created cluster, and that the DRS automation level is set to Fully Automated.
About the Author
You May Also Like