VMware Cloud Community
SNEdwards
Contributor
Contributor

PowerCLI repeatedly looses connection to vCenter server

I've got some powerCLI scripts that I've been using for quite some time to pull performance metrics from my vCenters.  I don't believe the problems lie within my scripts because they worked for years before I started seeing issues.  Additionally, I'm only having this problem when pulling data from 1 vCenter.  I have more than a half dozen others that still respond as usual.  It looks like the vCenter is killing my powershell connection intermittently.  The error I'm getting says “The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.”  This happens every couple of minutes.  It re-connects and the script eventually completes, but it takes 10Xs as long as before to finish.   Any ideas where to start looking to narrow this down?

Thanks

Neal

Reply
0 Kudos
4 Replies
SNEdwards
Contributor
Contributor

Here's a screenshot........

Reply
0 Kudos
LucD
Leadership
Leadership

Do you have a network monitor available ?

It looks as if your vCenter is loosing network connectivity intermittently.

Is there anything in the vCenter logs (the vpx files) ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
SNEdwards
Contributor
Contributor

No, I don't have a network monitor readily available.  I have thought that may be a possibility though.  I've done constant pings while the script was running and I didn't see any spike in the ping times correlating with the disconnect times.  Almost all were less than 1ms.  Only a few were 3-4ms.  

I looked through the events in the vSphere client but not the entire log.

Wouldn't the vSphere client drop though, if the vCenter was losing network connectivity?  I've never had any problems with the vSphere client.

Reply
0 Kudos
LucD
Leadership
Leadership

Yes, loosing network connectivity might be one cause. Another could be duplicate IP addresses on your network.

I would have a look at the vCenter logs.

And perhaps also the event logs of the server on which you run vCenter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos