I’m wondering if there would be a way to check if machines are idle and if so issue a reboot, say every Sunday night at midnight? I’m not sure if this would be doable with a Deadline script or some other built in function, but it’d be very useful to me.
I could do the reboot through a scheduled task in Windows, but ideally I’d want to make sure no Deadline jobs are running first. Any ideas, or is there a good resource for learning how to write Deadline scripts?
Thanks!
Hey Techadrian,
I recommend checking out the company’s public GitHub https://github.com/ThinkboxSoftware/Deadline for example scripts. You can also check out any of the scripts that have shipped with Deadline for inspiration.
Be sure to always have the scripting docs from https://docs.thinkboxsoftware.com close at hand. The Docs named “Scripting Reference” refer to the API available when the script is run by deadlinecommand (like Event Plugins or Monitor Scripts). The docs named “Python Reference” refer to the standalone API, which uses Pulse to communicate with the farm.
As for your particular problem, I recommend calling deadlinecommand.exe (which has its own slightly different API, reference available with -help) from a script run weekly like you do now. Grab a list of all the slave names with GetSlaves and call “RemoteControl machinenamelist OnTaskComplete RestartMachine” and that should get all your slaves to reboot when they are done with their current task.
Now - that’s all stuff I pulled out of my ear with a little bit of searching so I can’t speak to it’s reliability. You might run into issues with your slaves being named differently than your machines if you’ve got multiple slaves per machine.
I hope that’s somewhat illuminating, let me know if you’ve got more questions.
-Justin
Thanks, that’s perfect!
I just tested a scheduled task that runs deadlinecommand.exe with the argument RemoteControl RENDERNODEXYZ OnLastTaskComplete RestartMachine and it worked perfectly.
I’ve always found the “Machine Restart” function under “Power Management” does a great job at handling this as it importantly, doesn’t execute the restart if a slave is in the middle of rendering a task, which you won’t know about from an external scheduled restart command:
docs.thinkboxsoftware.com/produc … ne-restart
Also, making regular restarts of a large number of machines at exactly the same time is a bad idea, so using the above feature, naturally introduces variance here.