Interesting Proxmox Disk Usage

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

JDM

Member
Jun 25, 2016
44
22
8
33
So I recently stood up a Promox 5.1 hypervisor with ZFS mirror Intel 900p Optane disks for VM local disk storage, and some 2.5" spinning drives using raidz2. Pools are fine and healthy, and Proxmox is seeing them and using them with no issue. However when I run my df -h on the hypervisor as I allocate virtual disks on there, instead of the used amount increasing and the free space decreasing, the "total size" of the device is shrinking, with it shows no "Used" space even though there's over 500GB of vm images on the spinning disks and over 50GB on the Optane. Has anyone ever seen this before? or know how to make df show amounts correctly? I want to track usage, but collectd won't pick up on anything being used the way it is now. Also when I explore the mount points from the command line, nothing can be seen in side these ZFS pools when doing an ls (or even an ls -la) which also seems really weird to me. Any suggestions?
 

PigLover

Moderator
Jan 26, 2011
3,186
1,545
113
When Proxmox allocates VM storage on ZFS it uses zvol allocation, which basically means it carves off a logical partition from the drive and allocates it for the VM.

The reason why you see the apparent size of the existing disk go down is because its logical volume got smaller when space was allocated to your VM.

The reason you dont see the space for the VM when you use 'df' is because the new zvol is not mounted by the proxmox host OS.

To see what is happening with your disk use 'zfs list' instead of 'df'. This should paint the whole picture for you.

Sent from my VS996 using Tapatalk
 

JDM

Member
Jun 25, 2016
44
22
8
33
Ahh, thanks I see it now, thanks! I've used Proxmox and ZFS for a while now (separately), but had only previously used Proxmox with NFS or Gluster mounted storage. Is there a way to change this behavior for ZFS storage? Long shot as I'm guessing this is just the way Proxmox does things. I don't want to have to write a custom exec script for collectd to tabulate something as simple as disk usage, but may have to as I really need to be able to track the usage on those zpools.
 

PigLover

Moderator
Jan 26, 2011
3,186
1,545
113
You can always define a 'filesyatem' storage group in Proxmox - even if it is stored on a ads-based filesystem. That would do what you ask.

But I'm not sure why you would. There are a lot of advantages to using zvols. Most useful are snapshots.

Sent from my VS996 using Tapatalk