Running the alm virtual machine in azure apRIL 2015 edition

Last month I found myself doing ALM training and demos for a couple of customers, of course using the great ALM Virtual Machine by Brian Keller. With laptops having less and less RAM I choose to set it up in the cloud and found a few web pages with the steps to do it, however with Azure evolving every day I felt the need to put out this blog post with the guidance for Azure in April 2015

Additional to my RAM constrains I also have very limited internet access; some folks suggest to first download the virtual machine locally and then upload to azure. For me that will take at least 3 days watching a download / upload progress bar, so what I did was to do the download in Azure, and then transfer the bits to Azure itself, something like this:

  1. Create an Azure VM
  2. Add a big disk to that Azure VM (To have space for the download and extraction)
  3. Download the ALM VM RAR Files
  4. Extract the RAR Files
  5. Transfer the .VHD to a new blob storage
  6. Create a new VM from the VHD
  7. Create a point to site VPN to avoid exposing the VM directly to the internet
  8. Connect to the VPN
  9. Enjoy!

So let’s go through the steps:

Create an Azure VM

Go to the portal, New –> Compute –> Marketplace

image

For this any Windows Virtual Machine should work and I can have just picked the Windows Server 2012R2 image, however I pick the Marketplace to choose the lightest and easiest machine Azure offers me

image 

Then click Create, pick options and Create. In my case I make sure to pick the right subscription, pick my closest datacenter and a very fast tier.

image

When the VM is ready, add a new disk to it.

Add a big disk to the VM

From the portal click on the VM or browse for it and pick all settings, disks, attach new and choose the same storage account and container as the one for the VM. Adjust the size and cache and click Ok.

image

RDP to the machine to attach the disk

image

Open Computer Management and accept the suggestion

image

Right click the newly created disk, choose New Simple Volume and follow the Wizard to format the disk

image

Now we have a VM with enough space to fit the downloaded RAR files and then extract them, so lets do it

Download the ALM VM RAR Files

In this step I really hate to use Free Download Manager and I spent (wasted) half a day setting up a powershell script to do the same. In the end, FDM does the job and do it very well despite the horrible user interface and installer, so for this step just follow Brian’s guide:

http://aka.ms/ALMVMs

Install FDM

image

Copy the URLs from Brian’s page to the clipboard

image

Open FDM and set the download folder to the new disk

image

choose import from clipboard

image

Let it do its thing

image

When the download finishes, and in my case it took something like 5 minutes, run the .exe that extracts the VHD

Extract VHD

image

Meanwhile, install PowerShell, it will be needed to upload the VHD,

http://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

Launch PowerShell

image

Connect to the subscription

image

If as me you have more that one subscription, make sure to select the one you intend to use

image

Transfer the VHD

Make sure that the extraction finished and issue the command to start the upload. For the blob storage URL I used the same container as the one for this VM. The URL can be found on the portal

image

The command:

Add-AzureVhd -Destination "<BlobStorageURL>/<YourImagesFolder>/<VHDName>.vhd" -LocalFilePath <PathToVHDFile>

image

In the screenshot I show the blob storage account as the same of my VM. Later I have to re-do this using another storage account in the standard tier since I created this one on the premium tier and I had a lot of trouble later creating the actual VM.

Convert to OS Image

After the VHD is uploaded it should be added as an operating system image. In the screenshot is done via PowerShell, it can also be done via the legacy portal

image

Create the Virtual Machine

Using the just created image, create a new virtual machine. The screenshots are with the old portal, I also did it with PowerShell

image

image

image

In the next step it is important to set the machine in a virtual network and remove the public endpoints, why?, because this image has well known usernames and passwords and exposing it to the internet just like that is a bad idea. The recommended way to do it is to leave it on a Virtual Network and then connect via VPN. In this case I used the virtual network from the first virtual machine. That one was created using the preview portal which by default creates an internal network.

image

Create a point to site VPN

While the VM get setup, let’s create the VPN. Look for the same network where the VM was located and use the wizard to create a Point to site dynamic VPN. When I took the screenshot Site-To-Site was selected, make sure to select POINT-TO-SITE

image

To get the VPN working you need a self signed certificate. If you have visual studio installed it’s easy with the makecert.exe utility. The procedure is available at https://msdn.microsoft.com/library/azure/dn133792.aspx/ and looks like this:

image

image

Connect to the VPN

Wait for the creation of the gateway, that usually takes a long time, and then download the client, install and connect:

image

Connect to the VM

image

image

At this point the first Virtual Machine can be deleted. I will however keep the disk with the original VHD as a mean to rollback since here in Azure I don’t have the snapshotting facility provided by HyperV.

Now let’s do some ALM…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: