Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnect vsphere #26

Merged
merged 4 commits into from
Feb 26, 2015
Merged

Conversation

ParagDoke
Copy link
Contributor

Our vCenter admins observed that there were simply too many open / idle sessions on vCenter using the login provided to Jenkins vSphere cloud plugin. This set of changes attempts to disconnect from the vCenter after whatever work was needed to be done.

After launching a VM or finishing a build step, disconnect from the
vSphere server so that the number of active/idle connections does not
keep growing.
In the earlier state, the plugin connected to vSphere without checking
if the slaveComputer was online and then looked at the power state of
the VM. If offline, it simply came out and forgot to disconnect (leaving
a session behind).

Wrapping the connection inside an if construct (checking if the slave
computer is online). Note that there might be a difference between a
slave computer state being anything but online and the VM still powered
on. This is a temporary solution to avoid huge number of requests
getting to the vSphere server.
If the disconnect method is not called, there will be 1 idle session
left on the vSphere server.
This check is causing the VM to stay powered on.
jswager added a commit that referenced this pull request Feb 26, 2015
@jswager jswager merged commit 87f451f into jenkinsci:master Feb 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants