ADSI Edit to the Rescue: Modifying VM Folder Settings in VMware View

One thing that has always bugged me are the few, seemingly random properties of a VMware View pool that cannot be modified once the pool is created. At the top of my list is the VM Folder property in an automated pool. This is the vSphere folder (sometimes referred to as a “blue folder”) created by the View Administrator to house provisioned desktop VMs. By default, the folder name is identical to the name of the pool and cannot be modified, which I find very frustrating.

In this post, I’ll go into more detail on this process, and then show you a trick using ADSI edit to change the location, along with the results. Comments especially welcome; I’d love to hear any pain points you’ve had with VM Folders (if any) and how you overcame them.

Note! Use of ADSI edit may not be strictly supported by VMware. The post below was performed in a home lab environment. Use at your own risk – wear a helmet!

Examining View Pool Settings

For this scenario, I’m using an automated pool in my home lab that is creatively called Home. You can see that the virtual machine settings include a VM folder set to the path of:

/WahlNetwork (datacenter name) /vm /View (parent folder) /Home (child folder)

Here is a snapshot of the settings in the View Administrator

You can also see that the two desktops that are provisioned for this pool are sitting happily in the Home folder in vSphere.

The path to this folder is referenced as a string value to View. Meaning, you can’t change the name of any folder along the path, be that the parent(s) or the child folder. If you do, future provisioning efforts will fail citing that the folder could not be found. I don’t have enough vSphere API knowledge to specifically understand why a string path was chosen; in PowerCLI you can see that each folder has an Id value that doesn’t change based on the name.

For example, my “Home” folder has an Id value of Folder-group-v69. When I change the name to “Blah” it retains that same Id. Here is a dump of the info in PowerCLI

Name Id
---- --
Home Folder-group-v69
Blah Folder-group-v69

Drastic measures are needed. We must hack the Gibson.

This is what hacking looks like. Can you spot the garbage file?

Using ADSI Edit

Active Directory Service Interfaces Editor (ADSI Edit) is an invaluable tool that is used by administrators to do custom edits to an LDAP database. VMware View actually uses a combination of Active Directory Application Mode (ADAM) and Active Directory Lightweight Directory Services (AD LDS) to store information on the environment, meaning you can use the standard ADSI Edit tool to view and configure this information.

In this particular scenario, I have used remote desktop to connect into my View Connection Server so that I can run adsiedit.msc (the console tool). You should be able to launch it directly from the Run prompt, otherwise it should be in the Administrative Tools program folder.

Once you have ADSI Edit running, right click the ADSI Edit root object and select “Connect to…”

You’ll need to modify a few of the settings in order to connect to the View environment. These settings are:

  • Name: Arbitrary, but I use “View” to remind myself what this connection is in the future.
  • Connection Point: Change to “Select or type a Distinguished Name or Naming Context” and then enter dc=vdi,dc=vmware,dc=int
  • Computer: Change to “Select or type a domain or server:” and put in localhost
    • Note: This assumes you are locally connected to the Connection Server

Click OK and a new entry will be added to the tree. Expand the tree until you find the “OU=Server Groups” folder. This contains the View Pools. In my scenario, there is only one pool (CN=Home). Right click on this entry and select Properties.

There are tons of properties available for the pool. The one we’re interested in is the pae-VmPath value of /WahlNetwork/vm/View/Home. This is the string of the path that View is using to identify the vSphere folder (blue folder). If, for example, I wanted to change the “Home” folder to “ZeroCool” I would make the edit to the pae-VmPath property to read:

/WahlNetwork/vm/View/ZeroCool

I’d also need to change the name of the vSphere folder to be ZeroCool as well.

Results

Now that the change has been made in both ADSI edit and in vSphere, a quick check to the View Administrator reveals that the pool is ready to go. Notice that there is no “Browse…” button next to the VM folder setting.

The ultimate sign of success is seeing a new desktop provisioned in the ZeroCool folder. Maybe I should make an AcidBurn pool as well?

Thoughts

Why is the VM Folder setting not changeable from the GUI? It seems like such a harmless thing. I’ve come across multiple environments that set up their first pool(s) and didn’t quite understand the vSphere folder piece, and then discovered it was too late to change things and had some spider web of weird folder nesting. I also like the idea of changing the folder to something that isn’t tied to the pool ID, as some of my View deployment use cases aren’t strictly for end users that don’t see vSphere (such as in pre-prod testing with application groups).

Until this is a supported, editable GUI field, I will say that the method I show above works fine and I’ve used it a few times to fix some weird vSphere folder nesting. Again, however, use at your own risk (and wear a helmet!).