VM does not shut down after job

13 views
Skip to first unread message

john.peterson

unread,
Nov 15, 2017, 10:57:59 AM11/15/17
to Jenkins Users
This is a continuation of an earlier thread, but is unique going forward, so...

We are running Jenkins 2.87 controlling many VMware VM's hosted on an ESXi 5.5 server (soon to be 6.5) via vCenter / vSphere 5.5.  They are various versions of Windows.  (Using Java 1.44 since that is what was included with Jenkins 2.87)

We have several jobs that run after a software build.  They are configured to select a certain "set" of appropriate VM's and launch.  We had been using the Post Build Script plug-in (deprecated) to execute a shell command:   Shutdown  /s  /t 0 to force an absolute shutdown of the VM (occasionally, the next job would see the previous job complete, but the VM still open and launch on a dirty VM).

This worked well.  But used a problematic plug-in.  So, we are attempting to NOT use that plugin.  I removed that plug-in (and hence, the Shutdown command) and added the Single Run plug-in.  Now, the VM does not shut down when complete.  And, it MAY be an incorrect configuration from 2+ years ago when we first set it up.  So, here is what I think is the pertinent information.

The NODE:
Using vSphere Cloud (which is obviously working)
# of executors = 1
Usage - Only build jobs with label expressions matching this node
Force VM Launch = Enabled
Wait for VM Tools = Enabled
Delay after launch = 60
Secondary Launch = Launch via Java Web Start
Availability = Take this agent online when in demand, and offline when idle
     In demand delay = 0
     Idle delay = 10
Disconnect after limited builds = 0
What do do when slave is disconnected = Shutdown and revert

the JOB:
A postbuild Groovy that renames the job sequence number to the version under test number
Postbuild - Publish RFW results

Previously, but removed - Post Build Script (shell) of Shutdown /s /t 0


Viewing all this, I suspect I was not configured correctly in the first place?  Disconnect after 'x' builds should PROBABLY be 1?  And that would then trigger the next line to shutdown and revert?  And the Single Run plugin maybe isn't required?

I can't execute an RFW command to shutdown since that is still part of a job so if RFW forces a shutdown, I never get my published results.
Reply all
Reply to author
Forward
0 new messages