Conditions after "Reboot if required"

BatchPatch Forums Home Forums BatchPatch Support Forum Conditions after "Reboot if required"

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12155
    dcri1
    Participant

    Hi,

    I’m planning to have an unattended update installation queue run every night or every second night on a range of servers, so wanted to reboot only when required. Currently I have:
    Get pending rebot status + reboot if required (force)
    Wait 10 minutes
    Wait for host to be detected online
    Download and install updates + reboot if required
    Wait 10 minutes
    Wait for host to be detected online
    Start stopped automatic services
    Check for available updates

    (The last step is just there so I can look at the update messages column to see if there are any missing updates due to failures or updates becoming available after installation of the last)

    The problem I have (mainly when installing cumulative updates on Server 2016) is they’ll be “online” while shutting down to install updates, and 10 minutes isn’t always long enough for this to complete, so the online detection is passed, then after that the reboot happens so next steps fail as the server’s then offline.

    The “logic” statements I see are those like “Terminate queue if previous action fails/errors”. I’d probably get all the benefit I’m after from what I expect would be easy enough to implement:
    “If reboot required, force reboot then wait for host to go offline and online”
    Maybe there’s a more flexible option adding something like “skip next queue step if <condition>” or “only run next queue step if <condition>”, though I expect that’d be a pretty complicated implementation 🙂

    Cheers

    #12157
    doug
    Moderator

    I get what you’re saying. We are considering more conditional functionality. In the meantime I think you have at least a couple of options:

    1. You could use a wait period of 20 minutes or 30 minutes instead of 10 minutes so that you always wait for long enough to give the machine enough time to completely reboot.

    2. You could use ‘wait for host to go offline and come back online’ knowing that in cases where reboot is not actually required, the wait for host go offline will never be satisfied. It will wait until the global timeout for host/offline online detection is reached. At that point you can have the queue continue, if desired, or you can terminate the queue. The large majority of updates do require a reboot. But if no reboot is required then you can probably just terminate the queue because a subsequent check for updates at that point is not likely to reveal any new updates to be installed. Normally if one update would only become “available” after a different update is installed first, the update that is installed first will require a reboot. Furthermore, if you are going to be running this nightly or every other night, then I think you can probably simplify your queue to something more like:

    queue option 1:
    Download and install updates + reboot if required
    Wait 30 minutes
    Wait for host to be detected online
    Start stopped automatic services
    Check for available updates

    or

    queue option 2:
    Download and install updates + reboot if required
    Wait for host to go offline and come back online
    Start stopped automatic services
    Check for available updates

    In this case for queue option 2 you could then set the global timeout for host offline/online detection to continue the queue after the timeout is reached. This way if reboot is NOT required after the download/install, then BP will wait for the timeout to be reached, and then at that point the next step in the queue will be executed.

    Also, since you are planning to run the queue nightly or every other night, and since you have a “reboot if required” after the installation operation, I don’t see a reason to be checking the pending reboot status every time since you will have always rebooted if required the previous night. So realistically you can probably just eliminate that check pending reboot status. On the flip side, why would you run this nightly or every other night in the first place when updates are released monthly? Seems like overkill to me, but that’s just my opinion. Of course it’s your choice.

    -Doug

    #12158
    dcri1
    Participant

    Thanks for the comments Doug.

    I’d put the “Reboot if required” step in first in case there was anything still pending from a previous update, either initiated manually or a failed automatic install. Reason behind running update checks so frequently was so any out of band security fixes would be applied in a timely fashion.

    I’ll tweak the steps a bit and see how I go, but certainly would like to see some advanced conditional actions in a future release.

    Cheers

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.