I'm using DSC to provision virtual machines. The VMs are setup to pull a DSC configuration from a pull server. All is well with this. However, I noticed that I am frequently seeing:
Job {8B376B76-EDE7-11E6-80FC-3649808F2EC1} :
From LCM, message is
Completed processing test operation. The operation returned False.
In the event logs. Using a useful tip I found here https://powershell.org/forums/topic/lcm-event-log-entries-for-different-configurationmode-settings/, I can see that an Environment variable resource is failing - despite the fact that the environment variable was created:
VERBOSE: [TESTEZE-CDEUURA]: LCM: [ Start Resource ] [[Environment]EZELOGS]
VERBOSE: [TESTEZE-CDEUURA]: LCM: [ Start Test ] [[Environment]EZELOGS]
VERBOSE: [TESTEZE-CDEUURA]: [[Environment]EZELOGS] (NOT FOUND) Environment variable 'EZELOGS'
VERBOSE: [TESTEZE-CDEUURA]: LCM: [ End Test ] [[Environment]EZELOGS] False in 0.0190 seconds.
VERBOSE: [TESTEZE-CDEUURA]: LCM: [ End Resource ] [[Environment]EZELOGS]
(I know the environment variable was created because I can see it in the environment variables dialog).
If I manually reboot the machine, the consistency check then passes.
My LCM configuration is set to RebootIfNeeded=$true
and ActionAfterReboot = 'ContinueConfiguration'
.
The resource definition is this:
Environment EZELOGS {
Name = "EZELOGS"
Value = "C:\Logs"
Ensure = "Present"
}
The LCM is creating the variable, but it does not seem to be able to see the variable, and ends up cycling the configuration every 30mins. Any pointers?
Environment is Windows Server 2012 R2 (I know, I know...), with Powershell 5, WMF 5.0 (from KB3134758)