Feb
27

No Desktops, Big Problems

I was looking for a way to be notified when provisioning would fail on floating-assignment pools with VMware View. When updating floating-assignment pools our operations teams would set the desktops to delete after log off instead of refresh. If we set it to delete on Friday afternoon and by Monday everyone would have the new image. This seemed like a great idea but sometimes we got caught with our pants down Monday morning. If the pool in question had errors, slowly all the desktops in the pool would be deleted and no one would be able to log in the morning. This effect did not make virtual desktops very popular.

To combat this issue I decided I would use PowerShell to conquer this beast. After installing the SQL PowerShell from the SQL 2008 Feature pack I started to play around with the cmdLets and realized I could do this all from the SQL server where the Events database was located.

After reading the VMware View Integration Guide, I was able to find out which fields that I needed to keep track of. It seemed like all the serious errors had the Event Type of BROKER so I wanted to make sure that I was alerted about these events if they were failing.

Step 1: Configure the Database Server to send email.
There was great blog on sqlauthority.com that can walk you through the steps.

Step 2: Create the SQL statement to return all the broker pool related events that have failed.
SQL Statement:
SELECT EventID, Time, EventType, Severity, ModuleAndEventText FROM view_events.dbo.evevent Where Severity Like ”AUDIT_FAIL” and EventType Like ”BROKER_P%” and Time > DATEADD(HOUR,-1,GETDATE())

view_events: is the name of database
evevents: is the table where I am checking for errors. Don’t use the historical events tables.
DATEADD(HOUR,-1,GETDATE()): This will check for errors from 1 hour after the command was ran. You can change HOUR to DAY based on your schedule.

All of the Code

 

 

 

 

 

 

 

Step 3: Step up the job in SQL

SQL Vmware View

    

 

 

 

 

 

 

 

 

 

Make sure to select your View Database on the database drop down. You can copy the SQL file to your SQL server and open it up through the Open dialog box. View Alert SQL statement . After you download the file, rename txt to sql.

 

 

 

VMware View Alert Schedule

You will want to match the schedule with what the SQL statement is using . If your going to run the job every two hours make sure to change -1 to -2 and that HOUR is still selected. Likewise if you only want to run this once a day change HOUR to DAY.

 

 

 

 

 

 

 

 

 

 

Comments

  1. This won’t work with View 4.0 correct?

  2. There is an event in the Windows application log when a pool is disabled due to provisioning errors. Our monitoring solution (Op Manager) allows us to send notifications based on these events.

Trackbacks

  1. […] the Horizon View EventsDB.   There is a great article by Dwayne Lessner on doing this using SQL (http://itbloodpressure.com/2011/02/27/no-desktops-big-problems/).  I decided to write something in vb.net that would allow this alerting […]

Speak Your Mind

*