Octopus project to Orchestrate OS Updates of Windows Servers (with reboots)

Hello,
TL;DR
How to implement an Octopus project that keeps runinng after Windows servers have done a reboot?

I’m with the assignment of deploy a routine that will Update Windows Servers until there are not updates available and pending reboot condition is false.

I’ve done all the heavy lifting of the logic that will be executed in every host in powershell (windows services and dependencies pre-checks, store the values in persistent varibles to leave everything when the process is finished, as it was at the beginning, Log all the actions and results of each server, etc…). Thats ok.

My current issue and the reason I’m seeking advice here is how to orchestrate the process to meet a coupe of mandatory requirements:

  1. To be able to control the order in which the updates logic is executed in each server. eg: first the Domain controllers with odd numbers in the name, then some other server role, then another role wich cannot start the process until the previous one is finished so both are not going to be rebooting at the same time, etc…
  2. To keep track of the whole process (the order of the servers in the update process, and the process itself in each server) in a centralized manner, in the same way I do with other Octopus projects (critically these other projects desn’t required X reboots along the way…)

So Octopus is my first choice to accomplish it; and so my question:
Is it any recommend way by using Octopus to handle this kind of project?

I could deploy from Octopus the Updates routine script as a Scheduled task in all the servers to be updated, launch the process in a pre-defined order series of steps (eg. first this group of servers, second this other group, third that servers group, etc…, and create a call back from the servers being updated to Octopus (is this possible? how?) so the next group of servers, in their own (the next one) Octopus step, doesn’t start until the proper signal is received.

That way I can have the control over the secuence of execution in each type of server, at the same time it is implemented as steps in an Octopus project, so I have a view of all the process in a sinlge place.

But not really sure if posisble or how to do it.

I’ve looking around here in the forum and found a realted treat (Run script task on tentacle from within Deployment task - #4 by Pawel_Pabich) but not sure to go that way…

Open to any suggestion or advice to accomplish it, even if it is somethign completly diferent from the initial thoughts.

Thank you veery much

Hi @jscvictormanuel,

Thank you for reaching out to us with your questions.

From the sounds of what you are trying to achieve, I would consider using Runbooks to help with your operational tasks such OS Updates. Depending on your Octopus version, Runbooks were added as part of the 2019.11 release and has helped users with operational tasks that fall outside of the standard deployments.

In particular we also have an example for Updating Windows (granted it is not as sophisticated as your scripts may be). This can also be scheduled too, using a trigger.

Here is an example from our Samples

You would also have a few options here to control how you want to stagger your updates.

To help put your deployment targets into groups, an option here could be to to use roles to tag your deployment targets for example:

  • windows-update-group-1
  • windows-update-group-2
  • windows-update-group-3
  • etc…

Here is a mock example for what it could look like within your Runbook:

You can then add in your deployment targets to a specific role so you can group these together.

You could look to build out your Runbook process by using Child Steps and adding in restarts.

.

You could then look to add a health check per group to ensure your deployment targets have come back online after they restart:

Above is an example of an approach, I hope this helps give you a bit more guidance. If it is possible for you, I would recommend looking to use Runbooks to help you with this.

If you would like any further advice with this, please do let me know.

All the best
Doug

Hi Doug,
Thank you very much for your quick response.
I’ve never user Octopus runbooks before but I will check them carefully since it certainly looks it could fit my needs.
Cheers

Hi @jscvictormanuel,

No problem at all.

If you need any further guidance, please do reach out.

Good luck,
Doug