Tagged: dsc lcm
- April 25, 2016 at 11:41 pm #38228
Today we observed a weird issue while deploying a DSC configuration, below are the details
Triggered a DSC deployment on our environment which failed because of incorrect configuration. After couple of hours we observed that for every 30mins LCM was trying to deploy the old(failed) configuration resulting in multiple failure events being logged in event viewer and this took the server down to an inconsistent state.
LCM is configured in Push mode, which ideally means deployment of a configuration happens only when a DSC configuration is deployed by someone explicitly. But in the above scenario the deployment is getting triggered automatically. Tried changing the configuration mode from ApplyAndMonitor to ApplyOnly but we still see LCM trying to deploy the configuration.
We deployed on the same environment with a different configuration(correct one) and it deployed successfully. Now we see LCM still checking the state of my server but as there is no change since the last successful deployment it doesn't perform any action.
Can someone please help us understand how we can stop LCM from doing regular checks, I just want my configuration to be applied when I explicitly deploy it.April 26, 2016 at 4:22 am #38231
The LCM has a setting called ConfigurationMode. To get the behavior you're describing, you need to set that to "ApplyOnly". If it's set to ApplyAndAutoCorrect or ApplyAndMonitor, then it will continue to check the system for drift. (This is generally considered to be a good thing, but you've got the option of disabling that if you want.)April 26, 2016 at 4:23 am #38232
For reference: https://msdn.microsoft.com/en-us/powershell/dsc/metaconfigApril 26, 2016 at 6:09 am #38238
Thanks for the info dave, we tried that. I tried that option and still i could see LCM applying the configuration for every refreshtime interval.
Sequence i tested it,
1. Deployed the wrong configuration –> changed the configuration mode to ApplyOnly(Same behavior). Tried restarting the server, still LCM applies the configuration.
2. Changed the configuration mode to ApplyOnly –> deployed the wrong configuration(still same thing happens).April 26, 2016 at 9:11 am #38258
ApplyOnly running consistency engine is weird. Which version of PowerShell are you using?
You can remove the failed configuration document from the node using:
Remove-DscConfigurationDocument -Stage Pending -Force -Verbose
After that LCM won't log any event.
You must be logged in to reply to this topic.