Scheduling Windows Updates on build agents

Is there a recommended way of scheduling Windows Updates so it doesn't interfere with running builds?

Is it possible to schedule an idle time where Windows can do its thing without terminating a running build? Or should i create a build configuration which runs windows update from a script, so it can be scheduled like a regular build?

1
3 comments

Hi Ben,

I'm afraid TeamCity cannot control Windows Update. Usually the best suggestion would be to ensure that you configure it in a way where you are certain it's not going to disrupt operations. If you expect builds to happen even through the night, then you might want to consider shifting updates to manual, so that you have control over when they happen.

Another option might be to program the agent services to stop at certain times, and allow the updates to run through those times as well.

0
Avatar
Permanently deleted user

Thanks Denis

I can't schedule the agent services to stop, unless I can be sure that no builds will be running, otherwise I'll have random build failures. So unless I've missed something this leaves me with the original problem of ensuring no builds are running!

So it seems I have to do this all by hand, or automate it all myself in powershell (including interactions with the teamcity API to disable, wait for and then reenable builds).

Is this on the Teamcity roadmap anywhere, or does nobody else use Teamcity through the night?

0

Hi Ben,

Disabling agents makes them unavailable to receive new builds, but will finish the ones they have assigned (Note disabling is not the same as stopping). A possibility would be to schedule disabling one or a few agents, give it enough time to finish any build it might run, then schedule the update for right after that. This could be done in batches to keep some agents working every day while updates run only some days. This can be done with scripts, powershell, or by scheduling a build, all of them can run a REST request (https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-Agents)

Some typical scenarios in environments with nightly builds are manual updates, update scheduled during the day so that agents can be disabled with enough time beforehand, disabling some agents (be it manually or automatically) at the end of the day that are scheduled for updates that night, or, increasingly, using cloud agent solutions, where images are fixed and can be updated and replaced at will.

0

Please sign in to leave a comment.