Wait Random?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9323
    netman86
    Participant

    Hello!

    I’m currently using saved job queues to manage patching on a windows server farm.

    Note that I can’t use the regular windows update features since we have custom code running on these boxes that requires me to remove a server from production (and wait for it to finish what it’s doing) before rebooting. I’ve managed to automate that bit, though!

    When I go to patch a group of, say, 100 servers, I have a catch. That catch is that I can’t let anymore than 10% of those machines go offline (or out of production) at a time to avoid processing problems.

    right now, I’m just patching ten at a time… but in the spirit of automation I’d like to be able to tell them to all go at once and figure it out on their own.

    The first thought I had here was to have a sleep command set up in my script in which the servers all sleep for X seconds- and then have that X be randomized between 1 and 10,000 seconds. The chances of more than a few boxes patching at the same time would be fairly slim this way.

    I cannot, however, figure out how to implement my idea.

    In a batch file I can run something like

    SET /a _rand=(%RANDOM%*3000/32768)+1

    sleep sleep %_rand%

    and generally seem to get what I want.

    Any clever ideas on how I could use this with batchpatch, or perhaps there’s another feature built in that I’m not utilizing?

    A feature to batch run a command on 100 servers and have them only run one at a time would yield a similar result for me.

    #11509
    doug
    Moderator

    You have a couple/few options. I think number 1 is probably your best option, followed by 2, then by 3.

    1. Use the ‘Advanced Multi-Row Queue Sequence’ This feature would give you the highest degree of control. You could run multiple hosts simultaneously, and then when that first set of hosts is done, the next set would be triggered to run, followed by the next set, and so on. The entire process could be kicked off with one click, and then it would run through to completion on its own.

    2. Use the ‘Basic Multi-Row Queue Sequence’ This feature would enable you to run one host at a time, sequentially.

    3. Use the ‘Row Execution Interval’ (Tools > Row Execution Interval). This feature would let you control how many seconds pass in between the execution of each selected row. So if you select 10 rows with a row execution interval of 60 seconds, then row 1 will execute. After 60 seconds, row 2 will execute. After another 60 seconds row 3 will execute. And so on.

    -Doug

    #11511
    netman86
    Participant

    This is way better than what I had in mind.

    Starting out with #2, I should be able to patch the whole farm taking only one host out of production at a time- but without having to babysit the thing all day.

    Thank you!

    #11512
    doug
    Moderator

    Excellent. Glad that works for you.

    -Doug

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