0
votes

I have a Jenkins Slave configured to start and stop an Azure Ubuntu node. Launch method: Start and stop this node on demand. With a "Start script" and "Stop script" and using "Launch agent agents via SSH".

The VM is started and stop with custom scripts that run az vm start commands. The scripts work. And Jenkins gets connected and can make a build.

I have "Availibility" set to "Take this agent online when in demand, and offline when idle".
In demand delay: 1 Idle delay: 120

However, after my build is done, the VM gets shutdown by Jenkins shortly after, in the range of a minute or two, not the 120 minutes specified.

1
Do Jenkins logs show that the agent is disconnected for some other reason before the stop script shuts down the VM ?ben5556

1 Answers

0
votes

If you are setting up an on demand Jenkins linux slave using SSH, you might need to disable the sshd timeouts: https://www.simplified.guide/ssh/disable-timeout.

Otherwise it appears when the SSH connection is killed, Jenkins stops the VM.