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:
- Create an Azure VM
- Add a big disk to that Azure VM (To have space for the download and extraction)
- Download the ALM VM RAR Files
- Extract the RAR Files
- Transfer the .VHD to a new blob storage
- Create a new VM from the VHD
- Create a point to site VPN to avoid exposing the VM directly to the internet
- Connect to the VPN
- Enjoy!
So let’s go through the steps:
Create an Azure VM Link to heading
Go to the portal, New –> Compute –> Marketplace
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
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.
When the VM is ready, add a new disk to it.
Add a big disk to the VM Link to heading
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.
RDP to the machine to attach the disk
Open Computer Management and accept the suggestion
Right click the newly created disk, choose New Simple Volume and follow the Wizard to format the disk
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 Link to heading
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:
Install FDM
Copy the URLs from Brian’s page to the clipboard
Open FDM and set the download folder to the new disk
choose import from clipboard
Let it do its thing
When the download finishes, and in my case it took something like 5 minutes, run the .exe that extracts the VHD
Extract VHD Link to heading
Meanwhile, install PowerShell, it will be needed to upload the VHD,
http://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/
Launch PowerShell
Connect to the subscription
If as me you have more that one subscription, make sure to select the one you intend to use
Transfer the VHD Link to heading
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
The command:
Add-AzureVhd -Destination "<BlobStorageURL>/<YourImagesFolder>/<VHDName>.vhd" -LocalFilePath <PathToVHDFile>
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 Link to heading
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
Create the Virtual Machine Link to heading
Using the just created image, create a new virtual machine. The screenshots are with the old portal, I also did it with PowerShell
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.
Create a point to site VPN Link to heading
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
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:
Connect to the VPN Link to heading
Wait for the creation of the gateway, that usually takes a long time, and then download the client, install and connect:
Connect to the VM Link to heading
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…