Monitor Azure Stack Patch & Update (PnU)

The first Azure Stack integrated systems have been installed last month and for sure also the next upcoming months more will follow. 1 important task that needs to be done directly after the installation is Patch and Update (PnU). The Patch and Update process is well described here. I have done some PnU’s lately and it is fully automated, and takes quiet amount of time before it is finished (8 – 9 hours) . Here is me doing a PnU while waiting till it was finished.

But I have to admit, it’s not as comfortable as it might look. What if for whatever reason the update is failed after 30  minutes?

In the GA build the Azure Stack Update PowerShell commandlets where not implemented, so you had to go to the Azure Stack Admin Portal to see the state of the Azure Stack update process. In the first PnU package(171020), the UpdateManagement PowerShell module was implemented and available through the privileged endpoint. These new commands gave me the opportunity to be even more confident leaving the office while PnU was running. I created a script that will go out to Azure Stack each 30 seconds to retrieve the state of the update process. Any other state then running would be texted to my cell immediately when something was not good, or all went good and had a completed update state.  So I could return to the office to finish the rest of the post configuration task. Here the successful PnU for November:

And the notification that I received that it finished successfully:

I have made this script available on my GitHub so others can benefit and working on their IT tan while running PnU. The setup is straight forward. Sign up for Twilio and create in Azure an function that will act as the webhook that will be invoked once PnU reaches an state any other than ‘Running’. Update the values in the Azure Function to match your Twilio settings and upload the function into your Azure subscription. If Azure Stack is in a disconnected state, the only requirement this script has is that the machine you are running it from can reach the Azure Function and the Azure Stack privileged endpoint. I am being a bit aggressive with the waiting time in the PowerShell module (30 seconds) but off course you can update this value to meet your own needs.

If you have any feedback or changes that everyone should receive, feel free to update the source and create a pull request. Happy updating!

 

Spread the word. Share this post!