Minimum values for ConfigurationModeFrequencyMins and RefreshFrequencyMins

This topic contains 5 replies, has 3 voices, and was last updated by Profile photo of headgeek headgeek 1 year, 10 months ago.

  • Author
    Posts
  • #21778
    Profile photo of headgeek
    headgeek
    Participant

    Hello,

    I am new to DSC and am just working through the examples in the DSC book. Great resource and so far things are going well. I am through setting up the pull server and that works fine. I was branching out a bit and wanted to reconfigure the my target to ApplyAndAutocorrect but since this was test I wanted the intervals to be something less than 30min and 15min so I did the following

    1) Set the Configuration mode on my pull client to ApplyAndAutoCorrect
    2) Set the ConfigurationModeFrequencyMins to 10
    3) Set the RefreshFrequencyMins to 5 (I know that it needs to be a multiple)
    4) Rebuilt the MOF and reloaded it.

    I did it with Verbose and all looked like it worked. The Configuration mode was properly changed but the intervals are still at 30 and 15. I tried moving the Configuration mode interval to 60 minutes. That worked but it seems like there is a lower limit? I haven't found anything to that effect but that seems to be the way it is working. It would be nice to be able to set it lower for testing.

    Configuration SetPullMode
    {
    param([string]$guid)
    Node W2012R2DSC.headgeek.local
    {
    LocalConfigurationManager
    {

    ConfigurationMode = 'ApplyAndAutoCorrect'
    ConfigurationModeFrequencyMins = 10
    ConfigurationID = $guid
    RefreshMode = 'Pull'
    RefreshFrequencyMins = 5
    DownloadManagerName = 'WebDownloadManager'
    DownloadManagerCustomData = @{
    ServerUrl = 'http://W2012R2DSCPull.headgeek.local:8080/PSDSCPullServer.svc';
    AllowUnsecureConnection = 'true' }
    }
    }
    }

    $guid = "3a2e9626-3071-4d9d-b2b3-824216b53275"
    SetPullMode -guid $guid
    Set-DSCLocalConfigurationManager -Computer W2012R2DSC.headgeek.local -Path ./SetPullMode –Verbose

  • #21779
    Profile photo of Don Jones
    Don Jones
    Keymaster

    15 and 30 are hardcoded minimums. In the book, I use lower values to demonstrate (when I teach) that no matter what you do, you can't go below those values. I think the book mentions that. The documentation on the LCM configuration (on TechNet) definitely describes the minimums.

  • #21780
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    If I remember correctly, those rules change slightly in WMF 5.0. You can have the Configuration frequency be equal to or less than the Refresh frequency, if you like (though I think they still have to be multiples of each other.) They've also added some output to tell you that your values are being automatically adjusted to conform to the "multiples" rules, when the configuration is applied.

  • #21803
    Profile photo of headgeek
    headgeek
    Participant

    Thanks for the reply. Yes you are correct the book does give the minimums but it is in the back and I just missed it. As I was looking for it I saw the handy script on p. 18 that shows how to force a Configuration Evaluation. That works great for testing and now I don't have to wait for 30 minutes to see what happens. So everything works as in the book on the pull example but I have one thing I still don't understand.

    1) It pulls the configuration and installs Windows Server Backup.
    2) I run Get-DSCGetConfiguration and it shows Ensure: Present
    3) I run Remove-WindowsFeature -name Windows-Server-Backup
    4) I run Get-DSCGetConfiguration and it shows Ensure: Absent. This is what I don't understand. I know it is Absent but I thought this was the "Desired State" not the "Current State". At this point if I run evaluation script it puts everything back the way it should be and Ensure is back to Present so I think I am just having trouble understanding the definition of Ensure.

    Thanks

  • #21804
    Profile photo of Don Jones
    Don Jones
    Keymaster

    GetConfiguraton returns the current, not the desired state. Unless the LCM is set to ApplyAndAutoCorrect, it won't re-install to maintain the desired state.

    "Ensure" in a configuration script is what you WANT. What GetConfiguation returns is what IS, not what's desired. It actually makes a bit more sense in v5, where you can do a comparison and get a detailed report of what's not "as desired."

  • #21865
    Profile photo of headgeek
    headgeek
    Participant

    OK. Thanks. It sort of makes sense but isn't the way that I would think of it.

    Just for fun I set up a W2008R2 Server and am trying to get it to pull the same configuration that installs the Backup feature. When I run the script to set the Pull mode it works and when I do a Get-DscLocalConfigurationManager on the W2008R2 server it shows that it is in Pull mode and looks correct but I have 2 problems

    1) After waiting over 60 minutes, Backup is still not installed and there is no DSC Configuration. When I run get-DscConfiguration on the server it says there is no Current Configuration
    2) The script to force evaluation doesn't work. The script works fine when I run it on a W2012 server. The error looks as follows:

    Invoke-CimMethod : The SendConfigurationApply function did not succeed.
    At C:\Users\roger\Desktop\ForceEval.ps1:10 char:1
    + Invoke-CimMethod @params
    + ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [Invoke-CimMethod], CimExceptio
    n
    + FullyQualifiedErrorId : MI RESULT 1,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand

    Any thoughts on where to start to look for the problem? Thanks

You must be logged in to reply to this topic.