Composite Resource DependsOn bug

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 3 years ago.

  • Author
    Posts
  • #14784
    Profile photo of GLibA
    GLibA
    Participant

    There is a bug when using a composite resource which doesn't allow you to specify the DependsOn attribute. I posted this on the MSDN Powershell blog here

    http://blogs.msdn.com/b/powershell/archive/2014/02/25/reusing-existing-configuration-scripts-in-powershell-desired-state-configuration.aspx

    For a workaround if I structure my configuration in different node blocks will they run sequentially instead of parallel?

    For example

    configuration ServerConfigurations 
    {
           Import-DscResource -ModuleName CompositeResources -Name RoleConfiguration,
    
    node $Allnodes.NodeName
       { 
          File TestFolder
            {
                Ensure          = "Present"
                Type            = "Directory"
                DestinationPath = "C:\Test"
            }
       }
    
    node $Allnodes.NodeName
       {    
             RoleConfiguration ServerRoles
               {
               Roles = $Node.Role
               }
       }
    }
    
  • #14785
    Profile photo of Don Jones
    Don Jones
    Keymaster

    If it's a bug, you should log it in Connect.Microsoft.com – that's where the team looks for bugs, more so than a blog.

    You'd have to test your theory to see if it worked.

  • #14791
    Profile photo of Don Jones
    Don Jones
    Keymaster

    It should. What would be better is to use the DSC Diagnostics module from Microsoft to start a trace, run Start-, and then examine the trace log. That's much more detailed.

    I think the problem with having multiple node blocks is that each node block produces a MOF, and you can only have one MOF per machine. Aside from DependsOn, there isn't much control over order-of-execution when DSC is evaluating the MOF. Obviously, the bug makes that not work... but I don't think there's a real workaround for that.

  • #14786
    Profile photo of GLibA
    GLibA
    Participant

    Thanks for the link, i added it as a comment to Steve Murawski's bug https://connect.microsoft.com/PowerShell/feedback/details/812943/dsc-cannot-set-dependson-to-a-nested-configuration since it seems to be related.

    Would looking at the verbose logging that outputs on the Start-DscConfiguration cmdlet verify what is being done sequentially?

You must be logged in to reply to this topic.