About vCenter Server Folders and how to Copy them


Recently, while working on a new deployment, it was determined to copy the folder structure from an existing vCenter Server to a new instance.
As the folder structure is complex and the vCenter Servers were located in separated environments, exporting and importing the folder structure seems the way to go.
Before continuing, let’s see how folders are organized in vCenter Server.

Each folder in vCenter Server has properties, which can be observed using one of the following commands:

PS> Get-Folder | Select *
PS> Get-View -ViewType Folder

In vCenter Server you can create Folders directly under the vCenter Object and under each Datacenter. Folders created under the vCenter Object will appear on each of the four tabs (“Host and Clusters”, “VMs and Templates”, “Storage” and “Networking”).
On the Datacenter level, you can create different folder structures for each of the four tabs. After creating a new Datacenter object, vCenter Server creates four hidden folders, named “host”, “network”, “datastore” and “vm”, which function as parent folders for each tab.

In the diagram (Fig. 1) I’ve tried to present an overview for a vCenter Server with two Datacenters (Datacenter1 and Datacenter2) and a few folders like “Discovered virtual machine” and ”Templates”.
On the far left is the root object which is always called “Datacenters”.
The folders marked with a red X are not visible in the vCenter GUI. Visible folders are marked with a blue folder icon. The properties “Name”, “Id” and “ParentId” are shown in the diagram. Each folder is uniquely identified with it’s “Id” and “ParentId”.

Fig. 1

Read the rest of this entry »