Automatically refreshing VMware View 5.x virtual desktops in “Already used” and “Agent Disabled” status

Administrators who have had to managed large floating pooled desktops in VMware View 4 and later could probably relate when I saw it’s quite the administrative burden to check on these large pools every so often, sort by status and refresh desktops that have the Status as Already used or Agent disabled:

image

I recall spending quite a bit of time 2 year ago trying to see if there was a way to automatically refresh these desktops while working with a 500+ seat deployment that seemingly had 10 or more desktops in such a state every few weeks.  The research didn’t go too far and I got busy so left it till last year when I had to upgrade a View 5.0 pool to 5.1.2 and as I read the release notes, the following was what I noticed:

VMware View 5.1.2 Release Notes
https://www.vmware.com/support/view51/doc/view-512-release-notes.html?ClickID=dkhs0xbx0kzhztss2ynnshxsykxz2zhozybk

In View 5.1.2 and later releases, you can add a View LDAP attribute, pae-DirtyVMPolicy under OU=Server Groups, DC=vdi, DC=vmware, DC=int, and set the following values for the attribute. The pae-DirtyVMPolicy values provide the following options for the Refresh on logoff policy:

  • pae-DirtyVMPolicy=0. Mark virtual machines that were not cleanly logged off as ‘Already used’ and block user access to them. This is the default behavior in View 4.6 and later releases.
  • pae-DirtyVMPolicy=1. Allow virtual machines that were not cleanly logged off to become available without being refreshed. View Client users can access these desktops.
  • pae-DirtyVMPolicy=2. Automatically refresh virtual machines that were not cleanly logged off. View Client users can access these desktops after the refresh operation is completed.

 image

Another public VMware KB about his configuration can be found here:

The View virtual machine is not accessible and the View Administration console shows the virtual machine status as “Already Used” (1000590)
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000590

This was definitely a welcomed feature and as promised by VMware, it does just as it says.  The following are some screenshots I took last year while configuring the parameter.

Log onto your View Connection server, open the run prompt and launch adsiedit.msc:

image

From within the ADSI Edit console, click on Action and then Connect to…:

image

Within the Connection Settings window, enter the following for these fields:

Name:
View Adam Database

Select or type a Distinguished Name or Naming Context:
DC=vdi,DC=vmware,DC=int

Select or type a domain or server: (Server | Domain [:port]):
localhost

image

Navigate to ADSI Edit –> View Adam Database [localhost] –> DC=vdi,DC=vmware,DC=int –> OU=Server Groups:

image

Notice that your desktop pools are listed.  Proceed with right clicking on the pool you would like to edit and select properties:

image

Scroll down to the pae-DirtyVmPolicy and configure a value of either 0, 1 or 2 as described above:

image

image

image

There you have it, an easy way to handle desktops in the Status as Already used or Agent disabled.