PVE update storage from VM

aldTest

New Member
Dec 11, 2023
6
0
1
I'm looking for solution why PVE doesn't update usage local storage which I use into vm.

For example in VM I downloaded file (about 10 GB). In PVE -> local storage -> Summary I see information that total Size is increased about 10 GB but when I removed this file from VM. Summary in local storage still show the same Total Size.
 
What kind of storage are you using? Is it thin-provisioned? What if you run fstrim -av inside the guest?
 
I added disk. which works in raid1 via usb. I used fstrim -av but this solution didn't receive any solution.


1.jpg
2.jpg
 
Please post the output of cat /etc/pve/storage.cfg
 
dir: local
path /var/lib/vz
content backup,vztmpl,iso

lvmthin: local-lvm
thinpool data
vgname pve
content rootdir,images

dir: M
path /mnt/pve/M
content snippets,iso,vztmpl,backup,images,rootdir
is_mountpoint 1
nodes local
 
That's strange. If it's a dir type storage, the volume should have a suffix, e.g. .raw or .qcow2. Did you change the configuration recently? What is the output of pveversion -v? What was the output of fstrim -av and how much is the actual usage, i.e. qemu-img info /mnt/pve/M/101/vm-101-disk-0?
 
When I used fstrim -av the sorage shows the correct size. I previously usedfstrim -a but it didn't work. How to use this command in crontab?
 
When I used fstrim -av the sorage shows the correct size. I previously usedfstrim -a but it didn't work. How to use this command in crontab?
Just like you would any other crontab command.

Do you have ext4 and did you move the disk last time when it didn't work? From the docs
There is a caveat with ext4 on Linux, because it uses an in-memory optimization to avoid issuing duplicate TRIM requests. Since the guest doesn’t know about the change in the underlying storage, only the first guest-trim will run as expected. Subsequent ones, until the next reboot, will only considerparts of the filesystem that changed since then.
 
I think with the guest agent installed, you can use qm agent <ID> fstrim. There are other tools to issue discard from within Windows, just use your favorite search engine.
 

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!