The creation of a Virtual Machine in Azure is quick, surprisingly quick. However, using the DSC extension adds a lot of time. And this makes me sad. I want to see if I can make it faster.

The story so far…

Making use of ARM Templates is really great. It allows you to define in JSON the full configuration of your Azure environment. You can parametise everything and store it in source control. It gives you a lot of power. Pairing it with the ARM DSC extension is handy as hell. As it gives you the full power of Desired State Configuration when spinning up your Azure Virtual Machine to install any applications or setup anything on the virtual machine that you need.

The ARM DSC extension takes a long time to install, and it’s annoying. I believe a big part of the time taken is due to it needing to install the Windows Management Framework WMF

The Windows Management Framework installs a few things including Powershell, PowerShell DSC, WMI, WinRM. Basically it gives you the ability to install/configure stuff across all the Windows platforms.

Since I think the WMF installation is the big reason behind this slow down I thought I would test that theory against the different versions of WMF and accross both Windows 2012 and 2016. Since WMF version 4 comes installed with 2012, and version 5.1? (I think) with Windows 2016.

So essentially, those 2 configurations should be quicker than the rest.

The test

I’ve created an ARM template, which spins up the necessary components to get a Virtual Machine up. Once the VM is provisioned, it installs the DSC extension and runs the DSC Configuration I have give it. The DSC configuration just creates a folder on the C drive (just to keep it quick and to use as a bench marking example).

Testing the speed of different WMF Versions

Windows Server 2012 without DSC and WMF

Time taken: 00:06:27

Windows Server 2012 with WMF Version 4

Time taken: 10:48

Windows Server 2012 with WMF Version 5

Time taken: 16:29

Windows Server 2012 with WMF Version 5.1

Time taken: 18:02

Windows Server 2012 with WMF Version “latest”

Time taken: 16:50

Windows Server 2016 without DSC and WMF

Time taken: 10:33

Windows Server 2016 with WMF Version 5

Time taken: 20:08

Windows Server 2016 with WMF Version 5.1

Time taken: 19:26

Windows Server 2016 with WMF Version “latest”

Time taken: 24:24

Code on GitHub

I have uploaded my ARM Template and PowerShell scripts to GitHub, incase anyone wants to do similar. View the repository here

Conclusion

Installing WMF 4 on Windows 2012 R2 Server seems to be the faster way forward, it takes around 4 minutes to install the DSC extension over the top of the base without DSC and WMF.

I was hoping I would gain a significant time saving by using a different version of WMF if that version of WMF was already installed on that version of Windows. It saves a little bit of time, but nothing spectacular. Interestingly Windows Server 2016 performs a lot worse with installing WMF.

Next steps is to try to create a Virtual Machine image with the extension already installed. Hopefully once I sysprep the image it won’t remove any of the extension properies or information. We shall see.

Til next week!

Comments

About

Founded in 2009, Odity is a software consultancy based in the United Kingdom.

Social Links

Our Bunker

United Kingdom.