Tuesday, December 02, 2014

Solve the 'Circular DependsOn exists' Error

The blog title is a suggestion posted on Connect for PowerShell:

Solve the 'Circular DependsOn exists' Error

The DependsOn parameter enables PowerShell Desired State Configuration (DSC) to resolve references in the configuration and order them properly.  This works quite well in my experience building a DSC configuration for FIM but there are a couple cases in FIM that break this functionality:

  • Set objects that refer to each other
  • Forest Configuration objects where the forests trust each other

In pre-DSC days I would just solve this by doing multiple passes to order them properly.  Seems like a simple enough ask but my guess is that the existing DSC resources don’t run into this problem yet because they don’t represent objects with circular dependencies (lucky me). 

My current workaround is just to exclude the properties that cause the problem, which for now results in a broken configuration.  My next step is to cheat by using a Script resource in my DSC configuration to fix up the items that required hacking.

At the end of the day I really can’t complain.  I’ve generated a 40,000 line DSC script using thousands of FIM objects, resulting in a 6MB MOF file.  At this scale I was expecting something to tip over but so far am pretty impressed.  Now, time to run that MOF file through the LCM, what could possibly go wrong?

No comments: