2

The default Ubuntu 14.04 came with 29GB on the OS volume, I want a smaller one, e.g. 8GB, how to resize this?

Should I need to make my own VHD?

We have 13 Linux Ubuntu VMs with disk usage similar to this: (all of the VM have only a few GB usage in /dev/sda1)

Filesystem      Size Used Avail Use% Mounted on
/dev/sda1        29G 1.9G   26G   7% /
udev            328M 8.0K  328M   1% /dev
tmpfs            68M 256K   67M   1% /run
none            5.0M    0  5.0M   0% /run/lock
none            337M    0  337M   0% /run/shm
/dev/sdb1        20G  96M   20G   1% /mnt

But in the billing I am getting 14.21 GB in Page/Blob section (daily), which is corresponding to around 420GB per month usage, which does not make sense if you say Azure only count how much space you are using.

enter image description here

4 Answers 4

1

Thanks for getting back with that info. So, with AWS, you have some control. They are very much so far more "linux-centric" than Azure. With Azure, they give you what you get, and I believe that's it. We had looked into Azure ourselves and found some of the limitations therein.

Linux In The Cloud: Windows Azure vs. Amazon Web Services

That link above is about a year old, but I believe it still rings true. I have to say, I don't think you are alone with wanting to shrink the footprint of your Linux instances. 30GB is a joke for *NIX for sure.

So, if I'm not mistaken, I think AZURE Provisions as follows

*  /BOOT
*  /   (Temp Local Disk = SWAP + DATA)

Now, the caveat is that like most all IaaS platforms, thin provisioning is king. So that's where they will be getting you the savings I believe. While the full 30GB is provisioned, your BOOT volume is measured, and then whatever extra space you actually use, excluding PAGE BLOBS, or SWAP in the LINUX world. They call this "TEMPORARY LOCAL DISK" I think you should confirm with Azure, but you should be okay according to Azure from below:

Here's the official from Azure:

Do I need to purchase local disk storage with Virtual Machines separately?

All virtual machines in Azure are configured with at least two disks when you create the virtual machine – one is an operating system disk and the other is a temporary local disk, sometimes called a resource disk. Temporary Local disk storage is provided with Virtual Machines and is not charged separately. The operating system disk is charged at the regular rate for Disks. To explore virtual machines configurations visit here.

REFERENCE: Azure Linux VM Pricing & FAQ

1
  • Thanks, I've updated my proof also for the billing stats.
    – Howard
    Jun 5, 2014 at 4:19
0

It should not matter that you have a larger disk than you are using. Azure bills standard disks for only the space (page blobs) that you consume. So if your disk is mostly empty, you would not be paying for the unused space.

You can always create a new VHD for yourself and copy the files onto it and create a new VM off it.

7
  • This is not true, Azure has no way to know which part of my disk space is used or not, e.g. if I am using full disk encryption
    – Howard
    May 29, 2014 at 10:08
  • 1
    Hi Howard, is the reason for doing this based upon the question of billing? Or is this more about good Admin housekeeping? I will go from here if you don't mind answering this. Jun 1, 2014 at 17:37
  • @JimCJulsonJr, we only need a very basic Linux VM, e.g. less than 3~4GB root volume, but Azure gave me 29GB root for default Ubuntu 12.04 VHD. We want to save some money since we use quite a lot of these small VMs. I see others comments talking about page blobs does not count un-used space which does it make sense for me (as a Linux guy, I don't know the case of Windows VM though), Azure has no way to know which space is still being used after I've deleted the file, for example.
    – Howard
    Jun 2, 2014 at 4:22
  • 1
    @Howard do you have no clue how overprivioning works? Never worked with ZFS on Linux? Unused space is empty and as such takes no space on the storage backend. Same as ZFS overprivioning does... on linux. Ups.
    – TomTom
    Jun 2, 2014 at 15:07
  • Empty page blobs not using quota means simply this: Suppose your page blobs for a 30GB disk are numbered 1-30 of size 1GB each. Assume that you use only blob 1, 3 and 4 for your files and the rest of the blobs contain no data at all. In this case you will be billed for only 3GB worth of data. Now of course, your disk usage could be fragmented enough so that you are using a couple of bytes from every one of the 30 pages. In that case you will be charged for all 30GB worth of storage. As mentioned before, you could always download your VHD and resize it and create a new VM off it.
    – proteus
    Jun 5, 2014 at 0:45
0

You only get charged for what you use. Unlike AWS, on Azure the filesystem is backed by Azure Blob Storage (analogous to Amazon S3) and only what you store is written to it. Here is a very detailed blog post that actually proves it: How memory mapped files, filesystems and cloud storage works

The general best practice is actually to overprovision for storage to avoid disk resizing later when necessary. Here is another stackoverflow post about the same question: How are VHDs in Azure Storage charged?

Having said that, here is a link from an MSDN blog that has a PDF attached to it: Azure VMs – Managing, Resizing & Interacting with VHDs!

It describes how to expand a VHD but you can use similar techniques to shrink it. In a nutshell, what you are looking to do is not necessary but can be done if required.

2
0

Recently Azure implemented two types of OS disk Managed disk and Unmanaged disk(Page blob).

Unmanaged disks

Standard unmanaged disks (HDD) are priced only according to the data stored in these disks which means that if you have an OS disk of 127GB and have data worth of only 20GB stored in it then you will be charged only for the 20GB of data storage and not for the entire provisioned capacity which is 127GB

On the other hand for a unmanaged premium disk (SSD) if you have an OS disk of 127GB and have data worth of only 20GB stored in it then you will be charged for the entire provisioned capacity which is 127GB irrespective of the disk space consumed by you in the premium disk.

Managed disks

For a Standard managed disk (HDD) if you have an OS disk of 127GB and have data worth of only 20GB stored in it then you will be charged for the entire provisioned capacity which is 127GB irrespective of the disk space consumed by you in the standard managed disk.

On the other hand for a premium managed disk (SSD) if you have an OS disk of 127GB and have data worth of only 20GB stored in it then you will be charged for the entire provisioned capacity which is 127GB irrespective of the disk space consumed by you in the premium disk.

Please refer to the below articles: Unmanaged disk pricing: https://azure.microsoft.com/en-in/pricing/details/storage/page-blobs/

Managed disk pricing: https://azure.microsoft.com/en-in/pricing/details/managed-disks/

For your reference, please check the below article that shows types of disks available in azure. https://docs.microsoft.com/en-in/azure/virtual-machines/windows/disks-types

Note : Check this reference why it is 30 GB and if you can resize it or not ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .