Friday 21 April 2017

Azure - Pricing

Azure - Pricing


This post is a quick one on Azure Pricing. There's an Azure Pricing Calculator that helps you estimate the bill for a new VM. One element that was confusing me was the disk size included in the VM. What the heck was this? Free storage? The OS Disk, Data disk, what?!! See the 382GB below!


I ordered a few VMs sizes which came with different sized disks and from what I can figure out it related to the size of the TEMP disk is all. The huge VM above has a 384GB temp disk!! Haha. See below from the RDP session I checked it with:
So, while it's nice, it's not good for anything. The disk sizes don't even correlate to RAM:
Beats me why Microsoft are giving away temp disk storage?! The temp disk is wiped on a reboot if you don't know! Or if the Host fails. Or if you resize the VM. Or if you shutdown the VM......you get the idea?!!
Now this is for Windows. It's slightly different for Linux. But in any case, if you're working out pricing for a customer, this might help explain things that don't make sense to you!!
The price is included with the OS disk in the base VM price, so you add on any additional Data Disks after that....

Hope this helps someone who is similarly confused!!




Friday 14 April 2017

Azure: Create Managed Disk from a Snapshot

Azure: Create Managed Disk from a Snapshot


So, today I was looking at Managed Disks and using one to store SQL backups from inside a VM. Then I looked at backups but I'd prefer not to backup the whole VM just to capture the SQL bak file. I could set a weekly backup job to capture the OS and Application, but how to get a daily backup of the SQL BAK files?

I'm using Managed Disks and while you can create a snapshot through the web interface, you can't do anything with the snapshots currently, except list them!

So, I read over and over how it was possible to create a Managed Disk using a snapshot. Great I thought, but how?!! So I got this to work with the new CLI 2.0 as follows:

Uninstall any old Python versions on windows. Grab the latest 64 bit version from the python website.
https://www.python.org/downloads/windows/
Install and choose to add it to your path. After I did this I ran into an issue installing azure-cli. This is when I found an old version of pip & python - unintalled this and the new Phython and reinstalled the latest 64 bit one and the azure-cli installed fine
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
Now it wouldn't invoke the command "az". I'd to add the following to my path in windows 10:
"C:\Users\<username>\AppData\Roaming\Python\Python36\Scripts"
Now I could invoke az and log into Azure using "az login"
After that I created a managed disk from one of the snapshots I'd previously created:
https://azure.microsoft.com/en-us/blog/azure-cli-managed-disks/

az disk create -n myDisk -g MYPRICINGRG --source /subscriptions/<------------>/resourceGroups/MYPRICINGRG/providers/Microsoft.Compute/snapshots/140417

You can get the source by copying the RESOURCE ID from the screen below.
You can add snapshots to your Azure service bar on the left for handy retrieval.

Now you can attach this new managed disk to your SQL or other VM as an additional disk and away you go!


Looks like CLI 2.0 is becoming the defacto standard for Azure?