VM disks real size

vosatka.milan

New Member
Aug 29, 2022
7
1
1
Hi, is there a way to easily get list of VM disk with Virtual and Real size? To get know instantly which VMs are running low on disk space and need resize?
1662700033274.png

This is how Im used to manage disks in virtual box.

2022-09-09_07-08.png
This is how I see it in Proxmox right now.

2022-09-09_07-08.png
Thats what do I long for.

Did I miss a place where I can check VMs disks real size? I know Proxmox has such an information, in disk summary there is actually occupied storage. Thanks
 

Attachments

  • 1662700033274.png
    1662700033274.png
    135.1 KB · Views: 30
Last edited:
With RAW, you already have the real size = actual size, that's why it's called RAW. If you want only the used (or once written) size, you need to use QCOW2, LVM-Thin or ZFS, which are thin provisioned (like the vdi files in VirtualBox).
 
Well from what I can see, the raw doesnt mean "real size = actual size".
Untitled.jpg

The raw format does not occupy the size of the disk. So why I cant see the real space taken in VM Disks?
 
This is what im talking about. Proxmox can get this kind of information, which would be super useful, but its not using them (or I dont know how to get to them). Is there a better way then writing a custom script to go through all VM folders and running du -h / du -h --apparent-size ?
1662725891117.png
1662726429234.png
 
  • Like
Reactions: yusisushi
Well from what I can see, the raw doesnt mean "real size = actual size".
Oh, you wan't shared that it's on LVM-thin. The actual disk storage is now a mulitple of your extend size, e.g. multiples of 2MB.

Neither your theory with qcow2 seems to be right
It's just way more complicated that I wrote. Disk usage cannot be correctly stated from the outside, you will only see the maximum of the allocated space over time. It all depends on the type of storage.

Imagine you have a 100G disk, whose apparent size is 20G, you now write a 10G file that you delete directly afterwards. How much apparent disk is used? Normally 30G, because deleting will not zero out or decomission your used space. Depending on the underlying storage type (LVM, LVM-thin, RAW, QCOW2, ZFS) you can trim the storage (tell the underlying storage system that you really freed the space) and it can reclaim it. ZFS does this automatically, QCOW2 needs compacting (like vdi in VirtualBox), RAW file cannot reclaim, LVM-Thin can reclaim if you really cleaned an extend. The actual space is even more complicated with a snaphottable system like LVM-Thin (also to some extend LVM), ZFS and COW2.

So, a lot of things are working at once and therefore there cannot be one way to calculate everything correctly. This is BTW the same problem on any hypervisor and not just PVE.

This also plays a big role in backuping (e.g. PBS), because deleted but not trimmed/zeroed data will also get backed up. There is no file-based backup, but block-based and if the block is not-zero, it'll be backed up. Best to keep your system always trimmed in order to optimize backup space. Also disabling e.g. compression of logfiles will help to reduce the amount of rewritten files in order to minimize backup times and space.
 
  • Like
Reactions: yusisushi

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!