ComputerManagementDsc icon indicating copy to clipboard operation
ComputerManagementDsc copied to clipboard

PendingReboot resource improvement

Open fullenw1 opened this issue 6 years ago • 5 comments

Description

The PendingReboot resource would be perfect if a maintenance windows could be added.

Proposed properties

MondayNumber: 1-5 MondayStartTime: Time MondayDuration: Timespan

TuesdayNumber: 1-5 TuesdayStartTime: Time TuesdayDuration: Timespan

WednesdayNumber: 1-5 WednesdayStartTime: Time WednesdayDuration: Timespan

ThursayNumber: 1-5 ThursdayStartTime: Time ThursdayDuration: Timespan

FridayNumber: 1-5 FridayStartTime: Time FridayDuration: Timespan

SaturdayNumber: 1-5 SaturdayStartTime: Time SaturdayDuration: Timespan

SundayNumber: 1-5 SundayStartTime: Time SundayDuration: Timespan

The number can be a collection. For example 1st and 3rd monday every month. Or also for exemple 1st ,2nd, 3rd, 4th and 5th Sunday of every month, which makes it weekly.

fullenw1 avatar Sep 23 '19 14:09 fullenw1

Sorry to bother again :)

Maintenance windows should not only apply to the reboot resource but to anything that is changing the system. I have implemented maintenance windows with a number of customers and documented this in this in the article Realizing maintenance windows with DSC. All this is part of the DscWorkshop.

raandree avatar Sep 23 '19 14:09 raandree

No worries Raimund :)

I had a look at your document. So far I understand, the LCM is only triggered during a maintenance window. Right?

However, my need is to have the LCM to be triggered as usual every 15 minutes (most of the modifications or drift corrections don't need a reboot) but only the computer restart to occur during the maintenance window.

Is it better to submit this request to the dsccommunity.org or is it better to improve the PendingReboot module?

fullenw1 avatar Sep 23 '19 15:09 fullenw1

The LCM default intervals do no longer apply and are replaced by the 'AutoCorrectInterval', 'MonitorInterval' and 'RefreshInterval' trigger.

Monitoring the environment works always, so if you have the 'MonitorInterval' set to 15 minutes, you will get a report every 15 minutes. I usually recommend a much higher interval as the database fills up pretty quickly if all nodes send a status report every 15 minutes.

The 'AutoCorrectInterval' and 'RefreshInterval' are only taken into account, if the node is in a maintenance window and only the DSC will do changes on the node.

If you only want to get the PendingReboot changed, you issue is in the right place.

raandree avatar Sep 23 '19 16:09 raandree

Ok, then I will keep my request here :-) Thanks for the explanation Raimund!

To summarize the need:

  1. For whatever reason, PendingReboot detects a pending restart (Windows update, application installation/removal, Windows feature changes, DSC changes, etc.), the computer restart must take place during a maintenance period.

  2. DSC must be triggered as usual all the time (every 15 minutes or as configured), during or outside maintenance windows, especially to fix immediately any configuration drift

fullenw1 avatar Sep 23 '19 19:09 fullenw1

Great discussion @fullenw1 and @raandree - I'll leave this as discussion for now, but looks like it could be turned into enhancement. I can see the benefit in doing so, but as @raandree points out, this isn't going to be quite the same as a maintenance window.

PlagueHO avatar Sep 24 '19 08:09 PlagueHO