Azure Stack PoC Deployment Script Analysis

Microsoft recently announced the availability of Azure Stack Preview, and with it they published the deployment package to roll out Azure Stack as a Proof of Concept on your local hardware.  The download is hefty (10GB), and that's just a zip file with a bunch of bin files and an exe to put them together and extract the actual packages.  What's in all that and what does it do to set up Azure Stack?  Read below to find out.

When you first assemble the packages, the contents are underwhelming.

Four vhd/vhdx files, a PowerShell script, and a disclaimer.  Where is everything?  The bulk of the scripts and configuration are sitting in the MicrosoftAzureStackPOC.vhdx file.  Here's the folder structure once you crack it open.

In fact, looking at the DeployAzureStack.ps1 script, you'll notice that one of the first things it does is mount the vhdx file and import modules from it.  Here's the logical layout of that first script:

The first script is importing some psm1 files for helper functions, dot sourcing the functions in AzureStackDeploymentTelemetry.ps1 (which for reasons unknown is not a psm1 file?), and calling three functions, all of which are on the vhdx:

I don't want to dive too much into the first two scripts, as they really just do what they say.  The third script is where things get interesting.  Here's the layout for that one:

Once again, the script loads a bunch of modules and dot sources the telemetry script.  Then it starts the script Invoke-AzureStackDeployment.ps1 as a scheduled task.  That makes a lot of sense, since the full installation takes several hours to complete.

Invoke-AzureStackDeployment.ps1 in turn calls the RunAzureStackDeploymentTask.ps1 script.  Here's the logical layout for that one.

This script essentially loads the three main task groups: Fabric Installer, Services Installer, Post Validation.  It then initializes each task group and runs the Start-Task function exported for each module.

The first module prepares the fabric, which is a fancy way of saying that it preps the host machine, creates all the fabric VMs, and instantiates the basic infrastructure pieces.  The logical layout for the PoCFabricInstaller.psm1 is below.

This module has a PoCFabricSettings.xml file that has all the tasks needed to run in order to get the fabric prepared.  Each task references a script in AzureStackInstaller\PoCFabricInstaller folder.  Running through the XML file, you can get a clear picture of what tasks are performed to create the fabric, and the dependencies therein.  A closer look at some of those scripts will be a topic for another blog post.

The second module creates the Azure Stack services on top of the fabric.  The PoCAzureStackServicesInstaller.psm1 logical layout is below.

The central script for this module is the Microsoft.AzureStackInstaller.Master.ps1 script, which is in charge of importing the settings from the XML file PoCAzureStackInstallerSettings.xml.  Those settings are then used by the Invoke-AzureStackInstaller and Invoke-AzureStackInstallerComponentJob functions.  The second function calls each of the scripts in AzureStackInstaller\PoCAzureStackServicesInstaller by substituting their name as a variable from a hashtable, and it passes the settings from the XML file.  As with the fabric, the contents of those various scripts is the topic for another post.

At the conclusion of the first two task groups, the third task group connects to a ClientVM and runs a set of validation scripts to see if the deployment was successful.  That's more of a standalone script, and doesn't really call any other scripts to do its work.

Assuming all went well, the deployment should be complete and you'll have a working Azure Stack PoC!

Labels: , , ,