Convert Page Blob to Block Blob

I'm somewhat new to Azure coming from an AWS background.

In Amazon, EC2 virtual machines use EBS (similar to page blobs) for running disks.  However, when a snapshot of the machine is taken, the snapshot is stored in lower cost S3 storage.

I am trying to achieve the same scenario in Azure.  When I take a snapshot of an Azure VM using "Save-AzureVMImage" the disks are saved to page blob storage.  I am unlikely to need these snapshots as they will only be used for recovering from catastrophic configuration errors.  I would like to save these disk images as block blobs as I believe the storage costs are approximately one quarter of page blob storage costs in Australia.

How do I do this?  Is there a better best practice?  What about backing up to Amazon S3 storage?

THANKS
Peter

BTW  Is this question better asked here or in the "Azure Virtual Machines" forum?

February 8th, 2015 4:58am

Hi,

I don't familiar with Amazon, but in azure, once a blob is created/uploaded we can't change the blob type. Refer to https://msdn.microsoft.com/en-us/library/azure/ee691964.aspx for more details.

Best Regards,

Jambor

Free Windows Admin Tool Kit Click here and download it now
February 8th, 2015 6:37am

Thanks Jambor.

Can I create a block blob from the page blob then delete the page blob?

If I'm paying a quarter of the storage costs is this worthwhile or would the costs of the copy and delete outweigh the savings?

On Amazon I can afford to keep multiple snapshots around relatively cheaply.  Looks like on Azure I'll have to limit my snapshots to keep costs reasonable?

February 8th, 2015 6:51am

It turns out I was under impression that block blobs and page blobs are priced the same. So BIG thank you for this (you learn something new everyday :))!

Coming back to your question about how much storage you're actually using, there's a way. Since in page blobs you store data in 512 byte page ranges, what you can do is get occupied page ranges which will give you an array of start/end byte ranges. You can take difference of the start and end byte ranges for each array element and add them up to calculate the actual bytes occupied. You can find more information about this operation here: https://msdn.microsoft.com/en-us/library/azure/ee691973.aspx.

I have included this functionality in the tool I am building - Cloud Portam (apologies for shameless product plug :)). Basically there, you can right click on a page blob and then click on "Page Blob Properties" and then click on "Calculate Occupied Bytes" and it will tell you how much bytes is occupied in that blob. It makes use of the same "Get Page Range" operation I described above.

Free Windows Admin Tool Kit Click here and download it now
February 8th, 2015 7:01am

I would like to save these disk images as block blobs as I believe the storage costs are approximately one quarter of page blob storage costs in Australia.

I'm not sure if it is a correct statement (can you share a link which talks about this?). Given that in page blob you only pay for occupied bytes, it will always be cheaper than block blob where you pay by blob size. So assuming you have a 100 GB blob and only 30 GB is occupied. If it is page blob, you will only pay for 30 GB storage however if it is block blob you will pay for 100 GB storage.

As @Jambor mentioned in his answer, you can't change the blob type once it is created. Your only option would be to download the blob and the reupload it with new blob type.

Given that you're not saving any costs and there's no straight forward way of changing blob types, my recommendation would be to leave them as is.

February 8th, 2015 8:33am

The Azure pricing page has $AU 0.0267 per GB for block blobs in Australia East
and $AU 0.0808 per GB for page blobs

I was aware that you only paid for storage used for page blobs but didn't realise the same didn't hold for block blobs.

You could theoretically compress the volume removing free space and tar it into a single file for block storage but now it's hardly worth the effort.

I've only been using Azure for the last month and was surprised by how much I spent on blob storage compared with CPU hours.  Early on I had many more snapshots so perhaps it will balance out if I keep these more limited.

Is there any way to find out how much storage you are actually paying for out of say a 128 GB disk?

Thanks for you input.

Free Windows Admin Tool Kit Click here and download it now
February 8th, 2015 8:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics