Automation

 View Only
  • 1.  PowerCLI repeatedly looses connection to vCenter server

    Posted Dec 14, 2011 04:06 PM

    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



  • 2.  RE: PowerCLI repeatedly looses connection to vCenter server

    Posted Dec 14, 2011 04:17 PM

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



  • 3.  RE: PowerCLI repeatedly looses connection to vCenter server

    Posted Dec 14, 2011 05:12 PM

    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) ?



  • 4.  RE: PowerCLI repeatedly looses connection to vCenter server

    Posted Dec 14, 2011 06:04 PM

    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.



  • 5.  RE: PowerCLI repeatedly looses connection to vCenter server

    Posted Dec 14, 2011 06:58 PM

    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.