2

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)

Matthew Wetmore
  • 1,633
  • 12
  • 21
Peter McEvoy
  • 146
  • 5
  • I haven't looked at the code, but odds are it's setting the environment variable in a way that requires a process restart for the LCM to see it. You're using a built-in resource? – Matthew Wetmore Mar 01 '17 at 05:00
  • Sure, and a reboot clears it. I am using the OOTB "Environment" resource and it would appear to be buggy in that it neither updates the processes runtime environment, nor does it request a reboot to pick up the change... – Peter McEvoy Mar 01 '17 at 18:03

0 Answers0