0

Using PowerShell DSC, we're attempting to install DotNet Core among other application prerequisites onto a remote machine. We've set and applied LCM to Reboot and Continue. When executing the DSC the resources before and DotNetCore itself is installed correctly, the server reboots correctly, but then the DSC immediately is terminated and does not resume the remaining resources.

DotNetCore is merely used as an example, a couple other Package resources trigger the same issue.

We've been using this code for numerous years without issue (install all resources, reboots interspersed, and finished in a single DSC execution) but recently migrated the target nodes from 2012 to Windows Server 2019 where this issue has started happening.

Other threads I've found online are about triggering or managing DSC reboots, but not specifically the early remote DSC execution termination after a reboot of a node is requested from a DSC resource.

If anyone has any experience or insights into what might be causing this issue? Is there any fix to allow a single DSC execution to work beginning to end?

Log output (truncated) (no "errors" are thrown):

LCM:  [ Start  Set      ]
LCM:  [ Start  Resource ]  [[Package]DotNetCore3125]
[[Package]DotNetCore3125] Ensure is Present
[[Package]DotNetCore3125] product installation cannot be determined
[[Package]DotNetCore3125] The package .NET Core Runtime 3.1.25 is not installed
[[Package]DotNetCore3125] Starting ...\DotNetCore\dotnet-hosting-3.1.25-win.exe with /quiet /norestart
[[Package]DotNetCore3125] The machine requires a reboot
[[Package]DotNetCore3125] Package has been installed
[[Package]DotNetCore3125] Package configuration finished
[[Package]DotNetCore3125] [] A reboot is scheduled to progress further.
Configuration will be continued after the reboot.
LCM:  [ End    Set      ]
LCM:  [ End    Set      ]    in  139.2530 seconds.

LCM Code:

Configuration LCMConfig {
    Node $Nodename {
          LocalConfigurationManager
          {
            ActionAfterReboot = "ContinueConfiguration"
            RebootNodeIfNeeded = $true
          }
    }
}

LCMConfig -OutputPath $dscOutPath
Set-DscLocalConfigurationManager -Path $dscOutPath -Verbose

Configuration DSC Code:

$configData = @{
    AllNodes = @(
        @{
            NodeName = $Nodename
            RebootNodeIfNeeded = $true
        }
    )
}

Configuration ServerConfig {
    Node $Nodename {
        ... Other [Package] resources ...
        Package DotNetCore3125
        {
            Ensure = "Present"
            Name = ".NET Core Runtime 3.1.25"
            Path = "$softwarePath\DotNetCore\dotnet-hosting-3.1.25-win.exe"
            ProductId = '59EFE7CE-0394-4DF0-B657-E07ED56245F5'
            Arguments = '/quiet /norestart'
            Credential = $PackageCred
        }
        ... Other [Package] resources ...
}

ServerConfig -ConfigurationData $ConfigData -OutputPath $dscOutPath
Start-DscConfiguration -Path $dscOutPath -Verbose -Wait -Force

Local machine: PSVersion 5.1.14393.5127, Windows Server 2016 Standard
Node machine: PSVersion 5.1.17763.2931, Windows Server 2019 Standard

NibblesMK
  • 21
  • 3

0 Answers0