DSC deploying continuously in every 30mins in PUSH mode

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by Profile photo of Nitin Gupta Nitin Gupta 7 months, 1 week ago.

  • Author
    Posts
  • #38228
    Profile photo of sandeep manthri
    sandeep manthri
    Participant

    Today we observed a weird issue while deploying a DSC configuration, below are the details

    Problem description:
    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.

    Observation:
    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.

  • #38231
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    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.)

  • #38232
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator
  • #38238
    Profile photo of sandeep manthri
    sandeep manthri
    Participant

    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).

  • #38258
    Profile photo of Nitin Gupta
    Nitin Gupta
    Participant

    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.