[SOLVED] Trim/discard With CEPH Rbd

paulohnk1

New Member
May 22, 2020
4
0
1
36
Hello

I realized that I'm deleting data from the vms but this space is not being released in Ceph. I found in the documentation that I should do a Fstrim in the RDB but I can't find its assembly text such as: fstrim /mnt/ myrbd.

Any idea?

Thank you
 
I realized that I'm deleting data from the vms but this space is not being released in Ceph. I found in the documentation that I should do a Fstrim in the RDB but I can't find its assembly text such as: fstrim /mnt/ myrbd.
man fstrim
And the VM needs to have VirtIO SCSI as its disk controller.
 

Attachments

  • image_1.png
    image_1.png
    20 KB · Views: 46
Last edited:
the vms already have the VirtIO SCSI driver and also fstrim was executed
Is the discard checkbox ticked on that disk?

fstrim is executed on the RBD itself and on Proxmox I can't see where the RDB is mounted.
It will not be and it doesn't need to be. Qemu uses librbd to talk with Ceph directly.
 
I will reproduce the steps that worked for me:

rbd feature disable reply_3/vm-112-disk-0 object-map fast-diff deep-flatten

rbd map reply_3/vm-112-disk-0

rbd showmapped: 0 reply_3 vm-115-disk-0 - /dev /rbd0

mount /dev/rbd0 /mnt

fstrim -v /mnt

Now I can see the space released in Cephs :)

Thanks
 
Hi

I've been searching aswell as we are playing with ceph with some test servers atm but found the same issue with an external source on rook-ceph which sais some options need to be enabled:

https://github.com/rook/rook/issues/6964

bdev_async_discard and bdev_enable_discard on the osds themselves

not sure if this could be it?
 
Last edited:

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!