I have 2 different DSC configurations I want to apply to one server. One is for SQL, the second is to install Docker. I’ve run both scripts successfully individually and have run test-dscconfiguration against both configurations successfully. The problem is getting “reporting” from the server on both configurations in one test-configuration, as test-configuration only reports on the last .mof file applied. I was hoping to enable reporting on everything applied by DSC by using Partial Configurations. I would combine multiple DSC configurations from multiple scripts in one, then run a test-dscconfiguration against the merged .mof, as follows:
$nodelist = get-content 'dscconfig_verify_sql-docker_sqlnodelist.txt'
[DSCLocalConfigurationManager()]
configuration PartialConfigDemo
{
Node localhost #$node #localhost
{
PartialConfiguration ConfigDSC_SQLNodes_Serial
{
Description = "Configuration to install SQL Server."
RefreshMode = 'Push'
}
PartialConfiguration DSC_Install_Docker
{
Description = "Configuration to install Docker"
RefreshMode = 'Push'
}
}
}
PartialConfigDemo
pause
foreach ($node in $nodelist)
{
$AdminCredential = Get-Credential -username mydomain\myuserid -message "Enter an Admin ID for $node"
#$cimsession = ''
$cimsession = new-cimsession -credential $AdminCredential -computername $Node
Get-DscLocalConfigurationManager -cimsession $cimsession
pause # this next line is necessary to tell the LCM on the receiving node that you're sending it a new metaconfig.mof related to partial configurations.
#Set-DscLocalConfigurationManager -Path "c:\program files\windowspowershell\dscservice\configuration\partialconfigdemo" -cimsession $cimsession -verbose
Publish-DscConfiguration -computername $node -Credential $AdminCredential -path "c:\program files\windowspowershell\dscservice\configuration\ConfigDSC_SQLNodes_Serial" -force -Verbose
write-output "Just pushed SQL Configuration MOF to \\$node\c$\windows\system32\configuration\partialconfigurations"
pause
Publish-DscConfiguration -computername $node -credential $AdminCredential -path "c:\program files\windowspowershell\dscservice\configuration\DSC_Install_Docker" -Force -Verbose
write-output "Just pushed Docker Configuration MOF to \\$node\c$\windows\system32\configuration\partialconfigurations"
pause
#Start-DSCConfiguration -UseExisting -computername $node -credential $admincredential -Wait -Force -Verbose
pause
Get-DscConfigurationstatus -CimSession $cimsession | select pscomputername,startdate,type,status,mode,numberofresources | format-table
(test-dscconfiguration -detailed -cimsession $cimsession).resourcesindesiredstate | select pscomputername,ResourceID,InDesiredState | format-table -autosize
(test-dscconfiguration -detailed -cimsession $cimsession).resourcesnotindesiredstate | select pscomputername,ResourceID,InDesiredState | format-table -autosize
}
# for reference: remove-dscconfigurationdocument -stage (pending, previous, current) -CimSession $cimsession -force
================================================================================================================
I have the destination node's c:\windows\system32\configuration directory open in another window to watch what happens. The .mofs are created, the partialconfigurations directory contents changes/is updated, but I get this error:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ApplyConfiguration,'className' =
MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer SE131346 with user sid S-1-5-21-4278529026-3823030349-3524473939-155576.
VERBOSE: [SE132476]: [] Starting consistency engine.
The resources ('[WindowsFeature]DSCService' and '[WindowsFeature]DSCService') have conflicting values of the following properties: 'ModuleVersion'. Ensure that their values match. Merging of partial configurations failed. LCM failed to start desired
state configuration manually.
+ CategoryInfo : ResourceExists: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 11
+ PSComputerName : se132476
In both of my separate DSC scripts (sql and docker), I have
WindowsFeature DSCService
{
Name = "DSC-Service"
Ensure = "Present"
}
I was under the impression from research, that including identically configured resources would work, but even after commenting out that feature, I get the same error.
Does anyone have any advice on what this error means, or on implementing partial configurations to resolve this issue?