Does LVM-Thin support thin provisioning images, or not?

Bonus0611

New Member
Jan 20, 2024
2
0
0
Hi!

I'm finding some conflicting information online, and was hoping to get a solid answer haha.

I did a pretty default install of Proxmox, which left me with a local-lvm where my VM disk images are. This local-lvm is LVM-Thin. One the LVM-Thin wiki page (https://pve.proxmox.com/wiki/Storage:_LVM_Thin), it discusses thin provisioning, etc. As well, the main storage wiki page (https://pve.proxmox.com/wiki/Storage) states:

"All storage types which have the “Snapshots” feature also support thinprovisioning."

And shows LVM-Thin as having snapshot support.

BUT, I can only create VMs with raw disk format (the dropdown itself is greyed out), and this post here (https://forum.proxmox.com/threads/raw-greyed-out-on-lvmthin-when-image-is-enabled.93960/) states that's because LVM-Thin only supports raw.

Soooo 2 questions:

1. Does RAW support thin provisioning? If so, how do I see it's current actual "thin" size (both via CLI and GUI)? On the "VM Disks" tab, even on a clean install of a minimal debian install, I see the entire disk size listed there in the column
2. If RAW doesn't support thin provisioning, can someone help me understand the discrepency the documentation seems to have?

Thanks in advanced!
 
I've found the lvs command which seems to do what I'm looking for in terms of answering #1, and helps me understand a bit more overall the answer that RAW does support thin provisioning, and just where I'm looking at in the GUI doesn't reflect that

Code:
root@proxmox:~# lvs
  LV              VG  Attr       LSize   Pool Origin          Data%  Meta%  Move Log Cpy%Sync Convert
  base-100-disk-0 pve Vri-a-tz-k   5.00g data                 58.74                                
  data            pve twi-aotz-- <54.34g                      38.49  2.50                          
  root            pve -wi-ao---- <39.70g                                                            
  swap            pve -wi-ao----  <7.45g                                                            
  vm-101-disk-0   pve Vwi-aotz--   5.00g data base-100-disk-0 80.43                                
  vm-102-disk-0   pve Vwi-aotz--   5.00g data base-100-disk-0 80.66                                
  vm-103-disk-0   pve Vwi-aotz--   5.00g data base-100-disk-0 79.09                                
  vm-104-disk-0   pve Vwi-aotz--  32.00g data                 10.52                                
  vm-105-disk-0   pve Vwi-a-tz--   8.00g data                 0.00                                  
  vm-106-disk-0   pve Vwi-aotz--   5.00g data base-100-disk-0 79.91                                
  vm-107-disk-0   pve Vwi-aotz--   5.00g data base-100-disk-0 76.89                                
  vm-108-disk-0   pve Vwi-aotz--   5.00g data base-100-disk-0 78.88

Is there a way to see this disk size % via GUI?
 
Does RAW support thin provisioning?
That depends on the underlying backend storage device. Thin-LVM, ZFS, Ceph and ZFS-over-iSCSI support this.

Is there a way to see this disk size % via GUI?
No and that is normal for all storage types. The hypervisor cannot tell correctly how much space is actually used inside of the VM. It only sees what is allocated, which is always the lower bound. The same is true for RAM allocation, the guest view also differs from the hypervisor view.

thin-LVM has the problem of the smallest allocation unit, so that even if you only write 1 byte, you'll end up allocating the smallest allocation unit which is often 2 MB. This does not matter so much for bigger VMs, but smaller ones can be significantly bigger than they need to. You may then need defragmentation in order to the get allocated extends to a minimum and more importantly trimming. You ALSO need to take care of the free space inside of your guest by enabling discard on the disk of the VM in PVE and running fstrim regularly inside of it. This is crucial for running an overprovisioned setup.
 
BUT, I can only create VMs with raw disk format (the dropdown itself is greyed out), and this post here (https://forum.proxmox.com/threads/raw-greyed-out-on-lvmthin-when-image-is-enabled.93960/) states that's because LVM-Thin only supports raw.

Soooo 2 questions:

1. Does RAW support thin provisioning? If so, how do I see it's current actual "thin" size (both via CLI and GUI)? On the "VM Disks" tab, even on a clean install of a minimal debian install, I see the entire disk size listed there in the column
2. If RAW doesn't support thin provisioning, can someone help me understand the discrepency the documentation seems to have?
What you are missing is that RAW has two definitions.
1 If your underlying storage is FILE based (NFS, CIFS, Directory, etc) then there can be a file in RAW format. This format does not support snapshots or thin provisioning, or any advanced features.
2) If you are using BLOCK storage, of which LVM is a variation, there data is written directly to disk and is raw. I.e. there is no file structure to it. In LVM case there is a layer (LVM) that sits between your VM and the physical disk. This layer in its Thin variation provides snapshots and thin provisioning. In its thick variation it provides neither.
So essentially the "raw" can mean two related but different things in the context of Proxmox.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

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!