Generating Azure (VSALM) VMs from a specialized vhd file

January 3, 2018

From time to time I need to review how I run some of my Sparkles ALM workshops and make sure I can run a number of hands-on TFS exercises for the attendees. Doing demos is great to show what the possibilities are of an integrated ALM/DevOps platform, but nothing beats doing exercises yourself via the keyboard.

A long time ago I prepared exercises myself and this took quite a bit of effort, especially if you wanted to have some existing data in TFS to play with. When Brian Keller came up with a full-blown Visual Studio ALM virtual machine, I quickly realized I had to move into that direction. In the beginning (TFS 2010 timeframe) I paid for a big hosted server on the Internet where I could run a number of VMs via Hyper-V, but this was also very time-consuming and error-prone to have it up-and-running for my workshops.

Enter the cloud … Microsoft Azure! A perfect fit right? Upload vhd, create an image and ready for VM creation!

Well, I will save you all the details but in the past I managed to get it working after overcoming lots of different obstacles and it remained a very manual process … but it worked.

With the release of the new Visual Studio ALM VM for TFS 2018, I decided to have another go at it (what else to do during your Christmas holidays?) and script my way into having automated fresh VMs in Azure. First I failed a number of times creating a working VM image for TFS and providing a custom image for Azure Dev/Test Labs. The problem here might have been that creating the general image (sysprep instructions) kills the SQL connection for TFS. In the end I decided to abandon this approach and chose to upload a specialized vhd file to Azure and create VMs from that point. Many thanks to Sachin Hridayraj from Microsoft to provide me an already sanitized vhd file for upload to my Azure subscription. Sachin runs the ALM/DevOps Hands-On-Labs at https://almvm.azurewebsites.net/.

The Microsoft ALM/DevOps Hands-On-Labs is a set of self-paced labs based on Visual Studio Team Foundation Server and Visual Studio Team Services. Evaluating your next DevOps toolchain? Want to go deep and learn how you can implement modern DevOps practices with Visual Studio, Team Services and Azure? If you said yes to any of these questions, then this VM and Hands-on-labs are what you are looking for.

My PowerShell script to create VMs based on this uploaded vhd file can be consulted on GitHubGist. It will allow you to create a number of VMs based on the original VSALM vhd file provided at https://almvm.azurewebsites.net/. Be aware of some limitations (for example: number of cores) linked to your Azure subscriptions which might block you to generate extra VMs.

Hopefully in the (near) future I might move this one final step forward to create new VMs on the fly from Azure Dev/Test Labs.

Advertisements