I wanted to share some new thoughts and a new solution for a known issue when using PVS 5.6 and XenDesktop 5 deployed via vSphere 4.1.

By now we've all experienced the issue wherein any templates containing a network adapter configured to used a vNetwork Distributed Switch will cause the XenDesktop Wizard to crash when attempting to query available templates. The real kicker to this issue is that if any storage in the chosen DesktopController host configuration contains a template with a Distributed Switch then the behavior will appear. It does not matter if those templates are part of another vSphere installation, only that they are sharing the same storage.

Continue reading for more details and a PowerCLI based solution.

<!--more-->Here is the error received:

<a href="http://egroup-us.levelwing.com/wp-content/uploads/2011/07/PVSError2.jpg"><img class="alignnone size-full wp-image-4481" src="http://egroup-us.levelwing.com/wp-content/uploads/2011/07/PVSError2.jpg" alt="" width="420" height="194" /></a>

The supported solution from Citrix is to choose a template that has a Standard Switch configured (as should ALL templates located on the shared storage), begin the PVS XenDesktop Wizard and immediately before clicking finish to begin machine creation - convert the template back to a VM, change the adapter network to the desired distributed switch, and then convert back to a template. The problem is that I have personally seen this work approximately 25% of the time. It is a clunky solution to a known problem.

My solution was to craft a PowerCLI script to check each VM (based on a particular name format) in a vCenter instance for a particular standard switch (created and named for this particular issue), and change the Network Adapter network to the desired Distributed Switch.

Here is the script:

<a href="http://egroup-us.levelwing.com/wp-content/uploads/2011/07/PSCode_VDS2.jpg"><img class="alignnone size-full wp-image-4478" src="http://egroup-us.levelwing.com/wp-content/uploads/2011/07/PSCode_VDS2.jpg" alt="" width="672" height="151" /></a>
<p style="text-align: left">This will print out each VirtualMachine name that it discovers based on the search pattern. If the Network is changed it will also print out all of the relevant information after the change.</p>
<p style="text-align: left">Word is this issue will be fixed as of PVS 6 which is due out in August or September - this issue has been around far too long to be waiting for a major release for a fix. It is critical functionality and while not more than an inconvenience when creating 5 machines, it is a huge pain when creating 500.</p>