Azure DSC Extension error - A previous attempt to install Win8.1AndW2K12R2-KB3066437-x64.msu failed
Sometimes you make stupid mistakes that cost you a lot of time and today was a day like this.
The context
We wanted to use a fixed version of the Microsoft.Powershell.DSC VM extension for our Windows virtual machines in our ARM template. We were using version 2.8 of the extension and had enabled the autoUpgradeMinorVersion.
We had an error that started to occur only recently with our DSC configuration and we wanted to use a static version of the DSC extension to help us troubleshoot. We decided to go back a couple of versions and selected 2.6 as it was not that far behind 2.8.
This is where we started to receive the errors when the VM was installing the DSC extension agent.
A previous attempt to install Win8.1AndW2K12R2-KB3066437-x64.msu failed; please check the logs on the VM (C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.6.0.0)
We uninstalled the DSC extension from the VM, increased the version to 2.7, same thing...
A previous attempt to install Win8.1AndW2K12R2-KB3066437-x64.msu failed; please check the logs on the VM (C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.7.0.0)
We came back to the version that was in our template, 2.8, same error again...
A previous attempt to install Win8.1AndW2K12R2-KB3066437-x64.msu failed; please check the logs on the VM (C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.8.0.0)
Damn...
The Solution
Probably due to a lack of sleep last night and the fact that we were having another error before but we overlooked what was the current version of the handler out there. At the time of writing this article, the current version is 2.17.
We removed the DSC extension from our VMs, updated the type handler version to the latest version available and it started to work again. We still encountered the first error but at least we were running on a fixed version of the extension and form here we will be able to go back a couple of version back.
Conlusion
What is to retain of all that? First sleep well and the other thing, be cautious if you want to disable the autoUpgradeMinorVersion option, it might bite you back after a few weeks or months because the VM image you are using contains updates that are incompatible with the DSC extension you are referring.