Hi all.
I have got a JSON template for a VM with a DSC extension in it, which I'm trying to deploy in the Azure Resource Manager portal, using powershel cmd-lets. The problem I have is I can't properly configure Local Configuration Manager (LCM) to reboot my VM and continue configuration after it. I've got the section for configuring LCM in my DSC powershell script:
LocalConfigurationManager { RebootNodeIfNeeded = $true ActionAfterReboot = "ContinueConfiguration" }
But every time, extension will try to execute my configuration, it will set LCM setting to the defaults, as I suppose. Here is a part of the log:
VERBOSE: [2015-12-23T11:02:44] WMF 5 or newer, Injecting RebootNodeIfNeeded = False and ActionAfterReboot =
"StopConfiguration"
VERBOSE: [2015-12-23T11:02:44] Executing Set-DscLocalConfigurationManager...
VERBOSE: [2015-12-23T11:04:27] Get-DscLocalConfigurationManager:
ActionAfterReboot : StopConfiguration
AgentId : E122FC97-A964-11E5-80BE-000D3A22D7AF
AllowModuleOverWrite : False
CertificateID : DB56764E6067C9770CE2C2815D0AAA616AE3FACA
ConfigurationDownloadManagers : {}
ConfigurationID :
ConfigurationMode : ApplyAndMonitor
ConfigurationModeFrequencyMins : 15
Credential :
DebugMode : {NONE}
DownloadManagerCustomData :
DownloadManagerName :
LCMCompatibleVersions : {1.0, 2.0}
LCMState : Idle
LCMStateDetail :
LCMVersion : 2.0
StatusRetentionTimeInDays : 10
PartialConfigurations :
RebootNodeIfNeeded : False
RefreshFrequencyMins : 30
RefreshMode : PUSH
ReportManagers : {}
ResourceModuleManagers : {}
PSComputerName :
I thought, all I have to do when using DSC extension in a template, is to define LCM settings in a configuration block, as I do it with any other resource. But it seems for me now, that I have to pre-define LCMbefore my MOF file is created, because everything in the MOF file will be executed with pre-defineddefault LCM settings. And every time I will run my deployment template, when it will come to the DSC execution, everything will start from the beginning.
So, I'm really interested, is there a right way to tell LCM in JSON VM DSC extension (using it's options) or in a DSC configuration itself to use the correct settings? Or do I have to pre-define the LCM configuration somehow before applying DSC script using the extension?