August 17, 2017

Install Azure Stack in Azure

So, you want to play with Azure Stack but don't have eleventy seven meeelion dollars to get one yourself? Look no further than the uber meta, completely unsupported, installer of love for getting Azure Stack up and going on Azure itself!

This instruction guide will get you a BASE Azure Stack up and going in Azure. In future posts, I'll go through installing the Resource Providers so it will do something more than just VMs. First a few needs to know:

  1. This installation takes about 8 hours to complete. SOME of it is automated. Some requires you take take specific steps at EXACT moments in time, so, clear your calendar.
  2. This installation is EXPENSIVE. Of course, not nearly as expensive as an actual Azure Stack scale unit, but if you think you can do this on your monthly $50 MSDN credit, think again.
  3. This installation is NOT NOT NOT NOOOOOOOOT supported. When it breaks, and it will break, you will get love from the message boards, but not support from 1800IScrewedUpPleaseHelp. By the way, the program managers for Azure Stack actually are on those message boards and are very gracious in helping out. It can be found here*.
  4. This installation uses our glorious, new, amazing NESTED VIRTUALIZATION capabilities in Azure. From a single Azure VM (a big one), we will create a VM to host Azure Stack, which itself will create many additional VMs. Here are their names so you don't get confused:
    a. Host - This is the VM that runs right on top of Azure. It is our Level 1 VM.
    b. AzureDeploy - This is the VM that runs inside of Host and will do the deployment of Azure Stack. It is our Level 2 VM.
    c. Az-* - These VMs will be created by the AzureDeploy VM and are Level 3 VMs.
  5. There are other patterns that MIGHT work that don't require this many layers. I've tried several and this is the best path for me. Besides, we're already pretty meta running Azure Stack in Azure, what's a bit more.

Now, let's get started. First, you are going to need a Subscription (duh), and Azure AD tenant (duh), and Azure AD user that is NOT a Microsoft Account (, etc) but IS a tenant and subscription admin and IS NOT Multi-Factor Authentication enabled.

Next, you are going to need a Resource Group in Azure, in West US 2. Why there? Cause the VM class we are needing is available there and not many other place.

Now, in that Resource Group, create yourself a HAUS of a VM, specifically an EV2s v3:

Look at that glorious VM! 32 CPUs and 256 GB of RAM...nom nom. Yeah. Next, you are gonna open up the Azure CLI and create TEN 1TB PREMIUM Managed Disks. Oh yeah, 10 of them.
az vm disk attach --new -z 1024 -g VM --vm-name VMinVM --caching ReadWrite --disk SSD1 (and repeat up to SSD10)**.

When you are done:

Note - I also created disk 13 (SlowData) but that's for a later post, so ignore that for now.

Why 10 TB of really fast expensive disks? A) Cause we're gonna need about 3 TB to get up and going and B) Because we're going to put them all together to get a REALLY fast (50K iops) disk. Otherwise, it won't work. For iops calcs and help, see here.

Now it is time to log in to the VM and get to work. First, once you log in, patch it, and install Hyper-V. Both of those steps are going to require a reboot, so get that out of the way. Once you've done that, I created a simple test VM just to make sure things were working right with Nested Virtualization. You can delete this after you test.

On Host, open up Server Manager and we're now going to create a Storage Pool that contains the 10 1TB Premium Disks so I can get to my 50K iops and the install not crater due to disk throughput.

This image shows the primoridial capacity, click New Storage Pool:

Give it some details to keep up:

Select which physical disks you plan to use. Note that I leave out my 4TB slow disk.

Yeah, success - note the checkbox at the bottom, Create a Virtual Disk when the wizard closes, yes please:

Select the Storage Pool we just created:

Give it a name to keep track of:

Choose Simple Layout. Now, you may ask, why not Mirror or Parity. Cause you don't need it, these are Azure Disks, they don't fail. Plus, it is a POC. Plus I need every ounce of iops I can get...seriously.

Make sure the volume is Fixed. Don't even THINK about creating this as thin.

Max size:

Yippy! A disk...Note the checkbox at the bottom: Create a volume...yes please.

Create a Volume of max size within the disk and select ReFS and 4096 as the allocation unit size. This much "stuff" and you REALLY want ReFS. If you choose NTFS, you will add literally HOURS to this process and likely end up with corrupted goop if you BSOD for whatever reason.

Boom - big...freaking...disk (H drive).

The next step is pretty fast but I assume you know what you are doing so I skip some graphics. First, turn off IE enhanced security mode. Then open up IE and download a VERY important file to that H drive...CloudBuilder.vhdx. This self extracting file can be gotten from here.

Note, it is 25GB in size so even on a super fast Azure internet backbone, it will take a bit to download and extract, but you'll be able to see some wicked cool iops if you wanna watch haha.

Now, the next step is a bit hard to understand but I'll do my best. One of the most important things for Azure Stack is a good, reliable network that it can talk on. It also needs to be able to connect to the Internet to register itself with Azure AD, download the Marketplace, report commerce, etc. etc. In my next post, I'll talk about getting networking up and going and we'll also get the basics up and running.

Stay tuned!

*Are you like me and wish MSFT would ditch the crummy crufty message boards for something a bit more modern like Discourse? Yeah me too...agh so painful.

** Still learning CLI so I haven't yet learned for loops.