Solution for "Already Used" state

Solution for "Already Used" state

Hi all

There's been quite a few posts here recently about the "Already Used" state some VMs in Linked Clone pools can end up in. I think we've developed a solution.

The problem appears to occur when a user in an Automated, Linked Clone Pool with the "Refresh OS disk on Logoff" option enabled hits the Shutdown option in Windows rather than logoff. We mitigate the risk of this by setting a GPO to make the default shutdown option "logoff" but there's no hope for some users Smiley Happy.

My solution uses the View PowerCLI to find machines with this state and trigger a refresh. We run this script on one of our connection servers overnight via a Windows scheduled task to make sure any VM's that have found themselves in this state are OK by the time the users arrive in the morning, there's no reason it couldn't be scheduled to run more often. Typically in our environment we're only seeing a couple of VM's getting like this a day but I could see how it'd be more a problem in a larger deployment.

The problem is there's no one command you can run in the PowerCLI to return VMs with this state, instead the script has to go into the View ADAM database and iterate through all the VMs finding those machines that have the attribute "pae-dirtyfornewsessions" set to "1". These typically are the machines that are in the "Already Used" state.

This runs fine on for us on a Windows 2008 R2 x64, View 5.0 Connection server. Note this is my first attempt at a "long" powershell script i.e. more than a couple of lines so forgive me it it's not as efficient as it could be!

Usual disclaimers apply, use this at your own risk etc etc. This was written for our View 5.0 environment and is untested on any other version. Hopefully View 5.1 will resolve this issue or at least allow us to query it better from the PowerCLI.

See attached.

This document was generated from the following discussion: The specified discussion was not found.

Attachments
Comments

This document was created based on Paul's post and script found here, http://communities.vmware.com/thread/389590.

Version history
Revision #:
1 of 1
Last update:
‎02-06-2012 10:38 AM
Updated by: