Linux – Azure Linux VM: How to resize primary OS disk

azuredisk-space-utilizationlinux

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

Best Answer

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