Thursday, April 10, 2014

XenDesktop Studio : Add resources - The supplied connection address is invalid

Solution

Turns out, in my case, XenDesktop did not update the connection information correctly when I removed a server from the pool. So the "Connection address is invalid" is not having a problem looking up the servers, but rather the lookup is returning too many addresses. 

The way I found to do this is to uncheck the server in the high availability configuration (it's the only other place the removed server seems to show up). Open Studio and go to configuration > hosting. Click the connection that is having the problem, then right click and select edit connection. Click the edit HA servers button. Uncheck the box next to the server address that matches the one removed from the pool, then click ok.

You should now be able to correctly configure the connection trough the "add connections and resources" menu.

Full Details

I originally did not set up my XenDesktop 7 environment for machine creation services (MCS). I had tried it in 5.6 and found it didn't perform as well as manually doing full clone machines. But I wanted to set up a small environment to give it another shot, so I needed to add the storage and networking that it was going to use (Studio > Configuration > [hosting right-click]add connections and resources). However when I tried to reconfigure my connection I go the following error (the actual error is a bit longer, but this is the important part). 
Update-HypHypervisorConnection : The supplied connection address is invalid. Ch
eck that it exists and is part of the same pool as the connection.
At line:1 char:31
+ Update-HypHypervisorConnection <<<<  -LiteralPath 'xdhyp:\connections\myconnection'
    + CategoryInfo          : InvalidOperation: (:) [Update-HypHypervisorConne
   ction], InvalidOperationException
    + FullyQualifiedErrorId : Citrix.XDPowerShell.HostStatus.ConnectionAddress
   Invalid,Citrix.HostingUnitService.Sdk.Commands.UpdateHypHypervisorConnecti
  onCommand
 For some reason XenDesktop is having trouble managing the pool; thinks it has a bad address. First thing I did was test the connection (Studio > configuration > hosting > [right click connection] test connection). This ran and came back with no errors.

So then I ran this command (which I found via citrix docs as a "related-to" the command that is failing).

PS C:\temp> Get-HypXenServerAddress -LiteralPath 'xdhyp:\connections\myconnection'
http://192.168.0.10
http://192.168.0.11
http://192.168.0.12
This is 100% correct, so the connection object has the correct address (and is returning them correctly). So why the lookup failure. Well... Here I failed a bit in documenting. I ran a command somewhere that showed an error that reported that it was trying to connect to four different server addresses, rather than the correct three; I forgot to write down exactly what command it was - sorry. You should be able to tell by going to "configure HA servers" in the edit connection menu and see what servers are showing up there.

The fourth address that was showing up in the lookup came from a server that I had removed from the pool. Apparently that information did not get updated automatically - or at least not consistently, throughout xendesktop.