Datasheet
CONFIGURE DATACENTERS AND CLUSTERS 27
Install, Con gure, and
Manage the vSphere
Environment
PART I
Creating Datacenters
Datacenters are generally created as part of the initial setup process. e setup can
be automated by using the following code, which will create a datacenter called
Boston and store it in a variable. e
Datacenter
object held within the variable
can then be referred to later in the code as you create clusters or folders:
$BostonDC = New-Datacenter -Name Boston
Creating Clusters
Clusters are more complex than datacenters; there are many con gurable items
available for a new cluster. Consider the options the vSphere Client gives us: the nor-
mal cluster options as well as con guration options for VMware High Availability
(HA), VMware Distributed Resource Scheduler (DRS), VMware Enhanced VMotion
Compatibility (EVC), and VMware Distributed Power Management (DPM).
To create a new cluster in the Boston datacenter you created earlier, you can use the
following code:
$ProductionCluster = New-Cluster -Location $BostonDC `
-Name “Production”
is code line gives you the basic settings. e sections that follow discuss the addi-
tional cluster settings available to you.
Configuring High Availability
When con gured in a cluster, VMWare HA gives you many advantages, including
the following:
Proactive monitoring of all vSphere hosts and VMs
Automatic detection of vSphere host failure
Rapid restart of VMs a ected by host failure
Optimal placement of VMs a er server failure
Much like the con guration of a cluster through the vSphere client, you can con g-
ure HA within a cluster either as part of the initial cluster setup or you can alter an
existing cluster object. For example, to con gure a new cluster named
Production
with HA enabled and an HA failover level of 1 physical host failure and the HA
Restart Priority as Medium, you would use the code in Listing 1.8.
890790c01.indd 27890790c01.indd 27 3/3/11 10:22:16 AM3/3/11 10:22:16 AM