When connecting VC or to an ESX host with PowerCLI I get the following error right after entering the credentials (AD for the VC, root for the ESX host). This server used to work fine, but now consistently fails with this error.
Connect-VIServer : 4/22/2011 1:22:51 PM Connect-VIServer The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:17
+ connect-viserver <<<< -server CTCVH2100.accenture.com
+ CategoryInfo : NotSpecified: (:) [Connect-VIServer], ViError
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_WebEx
Here's what I've tried so far:
> Upgrade PowerCLI to 4.1 U1 build 332441
> Reinstall PowerCLI
Here's the information on the environment:
> PowerCLI 4.1 U1 build 332441
> Windows 2003 x86 SP2
> vCenter Server 4.1.0 build 258902
> .NET Framework 2.0 SP2
> .NET Framework 3.0 SP2
> .NET Framework 3.5 SP1
The vSphere Client on this machine works fine. Here's the kicker - there is another server with the same versions, connecting to the same VC, but it works! I suspect a reboot may be the only option but if anyone has suggestions on other things to check before that, I'll gladly give it a try and post the results.
Update - strangely, the connection to vCenter works now, although no reboot was performed and no changes were done. The only vMWare related service restarted on the server was the VMware VirtualCenter Management Webservices (Tomcat). I didn't expect that PowerCLI would depend on the Tomcat web server running, but perhaps there is a connection?
I suspect you always run through the WebServices on the vCenter.
Perhaps the 443 socket between your PC and the vCenter Server was hanging/blocked and a restart of the WebServices reset it.
Next time you experience a similar problem I would do a 'netstat -an', both on the vCenter and your PC.
Perhaps that could shed some light.
It also worth looking at the vCenter logs (vpdx logs) on the vCenter.