RAM and Disk Usage Calculation

Breymja

Well-Known Member
Aug 14, 2017
58
1
48
33
I got two Questions:
1. Is ProxMox not able to show the real RAM usage on Windows VMs? The VM tells me it's using 8 GB, ProxMox tells me it's using the complete allocated 32 GB.
2. How is the Disk-Usage calculated on ZFS with RAID1 on two 465 GB disks?
On the overview screen i see: Storage 141.91 GiB von 740.05 GiB
On the node screen i see: HD space(root) 2.38% (7.31 GiB von 306.38 GiB)
On the local storage i see: 2.39% (7.31 GiB von 306.38 GiB)
On the local-zfs storage i see: 31.04% (134.60 GiB von 433.67 GiB)

This drives me insane. None of these value seem to give any sense. None add up to 465 GB storage, nor to the doubled of this. I'm even no longer sure if it is really raid and how many storage i can really use, as local + local-zfs is MORE than my SSD in RAID should be able to handle and WAY less than what my two SSDs without RAID could handle. Also i frequently see the LATTER of the two values becoming smaller or bigger instead of the first. It is flexible, e.g. the 433,67 GiB above may become only 400 or 450 instead of the 134.60 GiB getting bigger / smaller. How does this work? oO

And where can i see the real disk usage for a single VM? Only the allocated size is shown there :(
 
Last edited:
if you want to see the usage inside a Windows VM, install the ballooning driver

regarding your storage questions:
  • if you define multiple storages using the same underlying disks, you will see more available storage then you actually have
  • the ZFS storage plugin calculates total space by adding used and available, and available can change independently of used if more than one storage uses the underlying pool
  • the directory plugin calculates the space information using df
in your case, both local and local-zfs use the same disks/zpool. local-zfs uses the rpool/data dataset by default, and local is a directory storage using /var/lib/vz , which is stored in rpool/ROOT/pve-1 . if you now add an image (or something else) on the local storage, you will decrease the available storage on both local and local-zfs ;) if this bothers you, you can set quotas on the datasets.

the 740.05 GiB is simple a combination of both your storages (306.38+433.67).
 
Hey,
thanks for your fast response. That makes the thing more clear. How can i resize those pools? I will never need so much space for my local storage. Also, is the rest, missing from local-zfs to my 465 GB my proxmox installation? That would finally make sense!
 
Hey,
the VirtIO Balloon Drive is installed (and already was before!), but ProxMox still does show full ram usage - but only in the view of the VM. The node overview shows correct ram usage - what could be the problem?
 
Hey,
thanks for your fast response. That makes the thing more clear. How can i resize those pools? I will never need so much space for my local storage. Also, is the rest, missing from local-zfs to my 465 GB my proxmox installation? That would finally make sense!

there is no need to resize anything. you can set quotas on each dataset, see 'man zfs'.

the 'missing' space is due to the calculation of total space - we don't care how big the underlying disk is, we just care what ZFS says about the dataset for which the storage is defined. so you get total = used in this dataset + available to this dataset , and what is missing is all the other datasets in the pool which also take up space, and quotas can further limit the available space as well.
 
Getting back to this one:
root@pve:~# zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
rpool 952G 902M 951G - - 0% 0% 1.00x ONLINE -

root@pve:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 901M 921G 104K /rpool
rpool/ROOT 899M 921G 96K /rpool/ROOT
rpool/ROOT/pve-1 899M 921G 899M /
rpool/data 220K 921G 96K /rpool/data
rpool/data/vm-100-disk-0 56K 921G 56K -
rpool/data/vm-100-disk-1 68K 921G 68K -

Why does zpool list show 952 GB size (which is correct, though i expected it to show double the size due to raid) with 1 GB allocated (which is also correct), but zfs list shows 921 GB avail with 1 GB allocated.

I feel like 30 GB are missing somehow and don't know why. I have a testing ZFS system on a home pc without proxmox and there in zfs list USED + AVAIL equals zpool size without any missing space?

Deduplication is not enabled and compression stuff shouldn't take 30 GB? It's a RAID 1.
 
Last edited:
Mh, do i assume correctly that is spa_slop_shift? Could work out. Seems my local system has that disabled.
 
the difference between 'zpool list' and 'zfs list' can have many reasons:
- spa_slop_shift, like you mentioned
- raidz/parity data
- reservations
- quotas
- ..

for example, based on your output:
Code:
# zpool create testpool mirror /tmp/vdev1.img /tmp/vdev2.img
# zpool list testpool
NAME       SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
testpool  7.94G   108K  7.94G         -     0%     0%  1.00x  ONLINE  -
# zfs list testpool                                                                                                     
NAME       USED  AVAIL  REFER  MOUNTPOINT
testpool  85.5K  7.69G    24K  /testpool

the difference is roughly the 3.2% for the default reserved space via spa_slop_shift. your ~30GB are as well roughly 3.2% of 952GB total space. in practicate, only the 'zfs list' output matters for monitoring free space, as that is what is actually available.
 

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!