Click here to Skip to main content
15,881,757 members
Articles / Hosted Services / Azure

Articles: Azure ARM DSC Extension LCM Settings rebootnodeifneeded Not Working

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
9 Feb 2020CPOL1 min read 905  
Fix for persistent issue with "reboot node if needed"
The PowerShell DSC extension for Azure Virtual Machines offers seamless configuration application, yet encountered a persistent issue with the "reboot node if needed" setting, resolved in version 2.15, highlighting the importance of version compatibility.

The PowerShell DSC extension for Azure Virtual Machines is an immensely useful feature. It allows you to apply DSC configurations against your Azure Virtual Machine.

Unfortunately, the “reboot node if needed” setting just wasn’t working for me.

The Way the DSC Extension Works

You add the DSC extension to your Virtual Machine, and then point it at a DSC configuration file, and any parameters that you need to pass to it. And it should apply all the configurations that you have specified in the DSC configuration file.

There is a setting that you can configure at the top of your configuration file called LocalConfigurationManager (LCM). One of the settings allows DSC to reboot if one of the steps in the configuration requires a reboot. Otherwise, it will just sit there waiting for you to reboot it yourself, hardly automated.

Example DSC Configuration with LCM

PowerShell
configuration MyServerConfig
{
    param(
		[Parameter(Mandatory)] 
        [string]$serverName
    )

    Import-DscResource xComputerManagement

    Node $serverName 
    {
       LocalConfigurationManager 
       {
           RebootNodeIfNeeded = $True
       }   
    }
}

The Issue

Everytime I ran the deployment, the RebootNodeIfNeeded setting kept getting set to $false. Unfortunately also, the deployments took hours, so tracking down the issue and getting feedback was an immensely slow process.

This really stumped me for some time. After digging into the logs and checking things out, I stumbled accross this page on powershell.org.

Versioning… I was using version 2.9 trying out version 2.15 as they discovered, fixes this issue. Now trying with the latest version (2.26) and everything seems fine also.

Conclusion

Making sure you’re upto date obviously should be the first thing to check. And stupidity kept me from checking this. But it took a hell of a lot of Googling to find the answer to this. Hopefully, this post will save somebody some time and some hair.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United Kingdom United Kingdom
I have been working in software development for over 16 years, during that time I have worn many hats.

I have worked as a Software Engineer, Architect, Agile Coach and Trainer. I’ve created teams, I’ve lead teams, but my main goal is to help teams build great software and enjoy the process.

I help a whole range of businesses – from startups with just an idea who want to build a team to take that idea into reality and FTSE 100 businesses who need to optimise existing teams – I train, mentor and coach them to success.

If you happen to know of anybody who could benefit from results like this, then please go to my contact page and get in touch.

Owen Davies

Comments and Discussions

 
-- There are no messages in this forum --