dsccommunity / xPendingReboot

MIT License
31 stars 10 forks source link

xPendingReboot: post 'Invalid namespace' warning and doesn't reboot #26

Open FallenGameR opened 5 years ago

FallenGameR commented 5 years ago

Details of the scenario you tried and the problem that is occurring

I'm using xPendingReboot at the and of my configuration, but the logs suggest that: 1) xPendingReboot couldn't query CCM_ClientUtilities because it failed to find some needed namespace 2) Reboot is required anyway and it was not done.

Verbose logs showing the problem

VERBOSE: [ukwest000000]: LCM:  [ Start  Resource ]  [[xPendingReboot]AfterVmSetup]
VERBOSE: [ukwest000000]: LCM:  [ Start  Test     ]  [[xPendingReboot]AfterVmSetup]
WARNING: [ukwest000000]:                            [[xPendingReboot]AfterVmSetup] Unable to query CCM_ClientUtilities: Invalid namespace
VERBOSE: [ukwest000000]:                            [[xPendingReboot]AfterVmSetup] Pending file rename found.
VERBOSE: [ukwest000000]: LCM:  [ End    Test     ]  [[xPendingReboot]AfterVmSetup]  in 0.0470 seconds.
VERBOSE: [ukwest000000]: LCM:  [ Start  Set      ]  [[xPendingReboot]AfterVmSetup]
VERBOSE: [ukwest000000]: LCM:  [ End    Set      ]  [[xPendingReboot]AfterVmSetup]  in 0.0000 seconds.
VERBOSE: [ukwest000000]: LCM:  [ End    Resource ]  [[xPendingReboot]AfterVmSetup]
VERBOSE: [ukwest000000]:                            [] A reboot is required to progress further. Please reboot the system.
WARNING: [ukwest000000]:                            [] A reboot is required to progress further. Please reboot the system.
VERBOSE: [ukwest000000]: LCM:  [ End    Set      ]
VERBOSE: [ukwest000000]: LCM:  [ End    Set      ]    in  7.6100 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 8.157 seconds

Suggested solution to the issue

Fix it please =) Or provide a workaround.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

        # Check if a reboot is needed after we setup the VM
        xPendingReboot AfterVmSetup
        {
            Name = 'AfterVmSetup'
        }

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.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

ModuleName                     Version
----------                     -------
xPendingReboot                 0.4.0.0
brinkers commented 5 years ago

xPendingReboot is fickle :-)

CCM_ClientUtilities: Invalid namespace can be avoided by specifying SkipCcmClientSDK = $True. that's just the check to see if SCCM thinks a reboot is needed; and the class isn't available if you don't have the SCCM client.

As for the no actual reboot, ensure the LCM is allowed to reboot the node (Get-DscLocalConfigurationManager).RebootNodeIfNeeded must be $true; if not set if before hand with set-DscLocalConfigurationManager

nehrua commented 5 years ago

Thanks @brinkers

b3nt0 commented 5 years ago

@brinkers

So, by default it doesn't check to see if the SCCM client is installed and just fails if it isn't? Why not default to not searching for the SCCM client and having SCCM admins opt-in since they know that its there?

PlagueHO commented 5 years ago

This is related to #13. I will be addressing this when I move the resource to ComputerManagementDsc. @b3nt0 - your suggestion is correct and will be addressed during the migration.

There is an issue where regardless of the SCCM state of the client a reboot will never be triggered. This is because there is no check for the status in the Test-TargetResource. I'll be addressing this during the migration.

PlagueHO commented 5 years ago

This has been fixed over in the new PendingReboot in ComputerManagementDsc. @gaelcolas - can you close this one?