I tested the UPS shutdown in case of power failure on Windows Server 2016 + APC Smart UPS + NUT.
At one point, NUT sent the shutdown command to Windows. But instead of really shutting down, I watched the screen with "Prepare your server"or something like that, I do not remember exactly as if some updates were installed during shutdown, but the server was configured for annual updates, so I checked and installed some of our updates before.
The shutdown took 20-25 minutes. Fortunately, the UPS did not turn off the power (due to some configuration errors). In a real world situation, the UPS, if properly configured, would disconnect the server from the power grid within 3 minutes of the shutdown command.
Later, I examined logs and found that Component Based Servicing (CBS) started some Maitenanace tasks before shutting down. So Windows was waiting for graduation.
Shutdown command with 30 second delay (shutdown.exe / f / s / t 30)
15:37:25 Log off user
The shutdown is completed at 15:55
2019-05-08 15:34:59, Info CBS Maint: Start deep cleansing
2019-05-08 15:37:26, Info CBS Trusted Installer has signaled the shutdown and will be terminated.
2019-05-08 15:37:26, Info CBS System shutdown was initiated while idle cleaning was in progress
2019-05-08 15:37:26, Info CBS Shtd: Preparation for shutdown processing.
2019-05-08 15:37:26, Info CBS Plan: Package: Package_for_RollupFix ~ 31bf3856ad364e35 ~ amd64 ~~ 14393.2273.1.4, Update: 4103720-19196_neutral_PACKAGE, Currently: Absent, Pending: Default, Start: Absent, Applicable: Absent , Target: Absent, Limit: Absent, Selected: Default
2019-05-08 15:37:26, Info CBS SetProgressMessage: progressMessageStage: 0, ExecuteState: ExecuteStateNone, SubStage: 0
2019-05-08 15:37:26, Info CBS Shtd: PreshutdownTimeout: 3600000ms, BlockTimeIncrement: 900000ms
2019-05-08 15:37:26, Info CBS Shtd: Progress thread started
It seems to me a problem that any process can affect the Shudown. Especially if the server has to be shut down as soon as possible.
- Is this just a behavior of WinServer2016? What about WinServer2012R2?
- Is it possible to perform a forced but correct shutdown to override such busy processes?