Creating a virtual datacenter in vCenter
vSphere has several defined objects that are used to create virtual datacenters. For example, an object named Datacenter
sits at the root of vSphere and allows the clusters and other host infrastructures to be placed inside the virtual datacenter. Installations might have multiple datacenters; however, most VMware administrators use additional datacenter objects in vSphere to represent a physical site and use the datacenter object as a boundary where the infrastructure exists. In this recipe, you will take a look at the code needed to create your new datacenter object in vCenter.
Getting ready
For this recipe, you will need to open a PowerCLI prompt, you need the DNS name or IP address of your vCenter host, and the password for the default administrator account in vCenter.
How to do it…
In order to create a virtual datacenter, and to create new datacenter object in vCenter, perform the following steps:
The first step is to connect to your vCenter server...