dsccommunity / SharePointDsc

The SharePointDsc PowerShell module provides DSC resources that can be used to deploy and manage a SharePoint farm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SharePointDSC 5.0 - DSC gets stuck in endless reboot loop (version 5.0)

breivald opened this issue · comments

ISSUE DESCRIPTION (this template):
Hi, we are trying out the ver 5.0 DSC to install a SharePoint SE Farm. However we get stuck during this step 

```powershell
SPInstall SharePointBinariesInstalled
{
        IsSingleInstance    = "Yes"
        Ensure              = "Present"
        BinaryDir           = "C:\Install\SP\SE\SharePoint"
        ProductKey          = $env:SP_PRODUCT_KEY
        DependsOn           = "[SPInstallPrereqs]SPPrereqsInstalled"
}
 After SharePoint is installed the LCM on every server gets stuck in an endless reboot loop causing the following step (installing 
 language packs) to never execute. I noticed that the downloadable module found in 
 https://github.com/dsccommunity/SharePointDsc/wiki/SharePointDsc_v5.0_SPSE-PublicPreview.zip
 does not correspond the latest commit so maybe this issue is about to be resolved ? 
 
 The output we get when stuck in this loop is looking something like this and we then don't get any info of what it is trying to do. 
 12/09/2020 15:12:00 SWAZSERVER01.c0nt0s00.local PendingReboot
12/09/2020 15:12:28 server1.c0nt0s00.local Busy
12/09/2020 15:12:53 server1.c0nt0s00.local Busy
12/09/2020 15:13:15 server1.c0nt0s00.local Busy
12/09/2020 15:13:36 server1.c0nt0s00.local Busy
 
PLEASE KEEP THE HEADERS.

-->
#### Details of the scenario you tried and the problem that is occurring
I've tried to change ActionAfterReboot = "StopConfiguration" to set the LCMState on the servers to PendingConfiguration. After that I run Start-DSCConfiguration -computername server1 -wait -useexisting -verbose to see what is the last thing it's trying to do and gets the following 
#### Verbose logs showing the problem
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] Checking status now
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] File not blocked,
continuing.
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] Checking if Path is an UNC
path
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] Writing install config
file
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] Beginning installation of
SharePoint
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] Calling the SharePoint
installer
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] Args for SharePoint
installer are: /config "C:\Windows\TEMP\SPInstallConfig.xml" /IAcceptTheLicenseTerms
VERBOSE: [server1]:                            [[SPInstall]SharePointBinariesInstalled] SharePoint binary
installation complete
VERBOSE: [server1]: LCM:  [ End    Set      ]  [[SPInstall]SharePointBinariesInstalled]  in 168.6540 seconds.
VERBOSE: [server1]: LCM:  [ End    Resource ]  [[SPInstall]SharePointBinariesInstalled]
VERBOSE: [server1]:                            [] A reboot is scheduled to progress further. Configuration will be
continued after the reboot.
WARNING: [server1]:                            [] A reboot is scheduled to progress further. Configuration will be
continued after the reboot.
VERBOSE: [server1]:                            [] Consistency check completed.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 180.211 seconds
#### Suggested solution to the issue
After that it's starts with the endless reboot again. 
Have you seen this before ? 
#### The DSC configuration that is used to reproduce the issue (as detailed as possible)
```powershell
$scriptFileName ="sp-se-servers-install.ps1";

$timestampFile = ".\TimeStamps.txt";
$startTime = Get-Date;
$timestampMsg = $startTime.ToString('yyyy-MM-dd HH:mm:ss') + " Started script `"$scriptFileName`"";
Write-Host $timestampMsg;
$timestampMsg >> $timestampFile;

$configName = "SPBinaries"
Write-Host "$(Get-Date) Defining DSC"
Configuration $configName
{
 param(
     [Parameter(Mandatory=$true)]
     [ValidateNotNullorEmpty()]
     [PSCredential]
     $MediaShareCredential,
     [Parameter(Mandatory=$true)]
     [ValidateNotNullorEmpty()]
     [string]
     $srcPath
 )

 Import-DscResource -ModuleName PSDesiredStateConfiguration
 #Import-DscResource -ModuleName PackageManagementProviderResource -ModuleVersion 1.0.3
 Import-DscResource -ModuleName xWebAdministration -ModuleVersion 3.1.1 #Needed for xIISLogging
 Import-DSCResource -ModuleName SharePointDSC -ModuleVersion 5.0.0
 #Import-DscResource -ModuleName xPSDesiredStateConfiguration -Name xRemoteFile -ModuleVersion 8.4.0.0
 Import-DscResource -ModuleName xCredSSP -ModuleVersion 1.3.0.0

 Node $AllNodes.NodeName
 {

     LocalConfigurationManager
     {
         RebootNodeIfNeeded = $true;
         ActionAfterReboot = "ContinueConfiguration"


     }

     Registry LoopBackRegistry
     {
         Ensure      = "Present"
         Key         = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa"
         ValueName   = "DisableLoopbackCheck"
         ValueType   = "DWORD"
         ValueData   = "1"
     }

     File SPLocalMediaEnsure {
         Ensure = "Present"
         SourcePath = $srcPath
         DestinationPath = "C:\Install\SP"
         Recurse = $true
         Type = "Directory"
         Credential = $MediaShareCredential
     }

     SPInstallPrereqs SPPrereqsInstalled
     {
         IsSingleInstance    = "Yes"
         InstallerPath       = "C:\Install\SP\SE\SharePoint\PrerequisiteInstaller.exe"
         OnlineMode          = $true
         DependsOn           = "[File]SPLocalMediaEnsure"
     }

     $iisLogFolder = "$env:SP_LOG_DRIVE`:\IISLogs";

     File IISLogDirectory
     {
         Ensure = "Present"
         Type            = "Directory"
         DestinationPath = $iisLogFolder
     }

     ## Setting logfile settings for all websites in IIS
     xIISLogging RootWebAppIISLogging
     {
         LogPath     = $iisLogFolder
         DependsOn   = "[SPInstallPrereqs]SPPrereqsInstalled", "[File]IISLogDirectory"
     }

     $ULSLogFolder = "$env:SP_LOG_DRIVE`:\SPLogs\ULS";

     File ULSLogDirectory
     {
         Ensure          = "Present"
         Type            = "Directory"
         DestinationPath = $ULSLogFolder
     }
     
     

     $usageLogFolder = "$env:SP_LOG_DRIVE`:\SPLogs\Usage";

     File UsageLogDirectory
     {
         Ensure          = "Present"
         Type            = "Directory"
         DestinationPath = $usageLogFolder
     }
     
     

     SPInstall SharePointBinariesInstalled
     {
         IsSingleInstance    = "Yes"
         Ensure              = "Present"
         BinaryDir           = "C:\Install\SP\SE\SharePoint"
         ProductKey          = $env:SP_PRODUCT_KEY
         DependsOn           = "[SPInstallPrereqs]SPPrereqsInstalled"
     }

     SPInstallLanguagePack InstallLPBinaries
     {
         BinaryDir   = "C:\Install\SP\SE\LanguagePacks\sv-se"
         Ensure      = "Present"
         DependsOn   = "[SPInstall]SharePointBinariesInstalled"
     }
     
     xCredSSP CredSSPServer
     {
         Ensure  = "Present"
         Role    = "Server"
     }

 }
}
$securedPassword = ConvertTo-SecureString $env:SP_INSTALL_PASSWORD -AsPlainText -Force
$MediaShareCredential = New-Object System.Management.Automation.PSCredential( $env:SP_INSTALL_USERNAME, $securedPassword );
$env:MANAGED_NODES_SP.Split( "," ) | % {
 $machineName = $_;
 $configurationData = @{ AllNodes = @(
     @{ NodeName = $machineName; PSDscAllowPlainTextPassword = $true; PsDscAllowDomainUser = $true }
 ) }
 Write-Host "$(Get-Date) Compiling DSC"
 &$configName `
     -ConfigurationData $configurationData `
     -MediaShareCredential $MediaShareCredential `
     -srcPath $($env:BASE_MEDIA_UNC + "\" + "SLIPSTREAMED\SP");
}

Set-DscLocalConfigurationManager $configName -Verbose -Force;
Start-DscConfiguration $configName -Verbose -Wait -Force;
do {
 $allNodesAreIdle = $true;
 $configurationData.AllNodes | % {
     $nodeResponse = Invoke-Command $_.NodeName { Get-DscLocalConfigurationManager | Select LCMState }
     if ( !$nodeResponse -or !$nodeResponse.LCMState -or $nodeResponse.LCMState -ne "Idle" ) {
         Write-Host "$(Get-Date) $($_.NodeName) $($nodeResponse.LCMState)";
         $allNodesAreIdle = $false;
     }
 }
 if ( !$allNodesAreIdle ) {
     Sleep 20;
 }
}
until ( $allNodesAreIdle )
Test-DscConfiguration $configName -Verbose;
Remove-Item $configName -Recurse;

$doneTime = Get-Date;
$timestampMsg = $doneTime.ToString('yyyy-MM-dd HH:mm:ss') + " Finished script `"$scriptFileName`", elapsed in format HH:mm:ss " + ($doneTime - $startTime).ToString("T").Split('.')[0];
Write-Host $timestampMsg;
$timestampMsg >> $timestampFile;

The operating system the target node is running

OsName : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsVersion : 1809
WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.17763.2268
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.2268
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used

SharePointDsc 5.0.0 C:\Program Files\WindowsPowerShell\Modules\SharePointDsc\5.0.0\SharePointDsc.psd1

Hi @breivald, are you using the version that was published a few months back with the release of the Public Preview? If so, that will not work with the RTM release of SPSE, because the code was specifically checking for the "Subscription Edition Preview" name. This has been changed in the version in the v5.0 branch. Please download that branch and run .\build.ps1 -Tasks Build. That will download all prereqs for the script and build the module.

It will create a new output folder in which a SharePointDsc\<version> folder is created. NOTE: The version number probably won't be 5.0.0. The script relies on gitversion to determine the correct version name. If that does not exist on your machine, it generates version 0.0.1. This will work just as fine though 😉

Great point, will update the wiki!

Closing this issue now!