TeamCity Agents and WakeOnLan
I just had a (hopefully) brilliant idea.
Can TeamCity be modified to turn off agent machines when they aren't needed?
I have quite a few blades that are idle about 40-99% of the time (depending on the blade and day). I'd love to turn these off when I don't need them.
In order to do this I need to
1. Turn them 'off' when I've finished using them (put them into Sleep mode)
2. Have TeamCity remember it still has those Agents available rather than have them appear as 'disconnected' (perhaps a new status of 'sleeping' is needed?)
3. Issue a WakeOnLan packet to the Agent when we want to run a build on them
I could handle steps 1 and 3 myself with some extra plugin code in TeamCity, but step 2 would be a modification of how TeamCity decides if an agent is connected/available so I don't know if that can be a plugin?
Any comments on this?
Please sign in to leave a comment.
I take nothing happened with this brilliant idea over the last almost seven years?
One of my build agents is a Mac-Studio which gets very hot even when sitting idle.
This would be a great feature! Actually, I thought it was already built-in, as I set it to sleep yesterday and the overnight TeamCity builds appeared to have worked, so I assumed it woke up the Mac.
But this morning, another build hasn't woken it up, so now I'm not sure.
Perhaps next time someone posts here, in another 7 years, we will get this feature :D
Hello,
No, currently TeamCity does not have this logic. Please consider submitting a feature request on our tracker - this way it would be visible to our development team and you would be able to track its status.
You could also implement this logic on your own as a custom cloud profile plugin - please see this article for the details. This way, you could register the agent machines as images in your profile, and have the
startNewInstancemethod wake them (andterminateInstancemethod could put them to sleep again).