How to enable periodic trimming in Openshift Data Foundations versions below 4.10?
Issue
-
In persistent RBD volumes provided by ODF, users might find discrepancies in between the used space in the file system mounted by an application pod, and the used value in the output of
rbd du
command in Ceph, for the matching image. This is normally the case after a massive file deletion. Sample outputs:Application pod:
/dev/rbd0 20G 92M 20G 1% /var/lib/pgsql/data
Ceph:
sh-4.4$ rbd -p ocs-storagecluster-cephblockpool du csi-vol-b80abc67-8344-11ec-86ee-0a580a83004b NAME PROVISIONED USED csi-vol-b80abc67-8344-11ec-86ee-0a580a83004b 20 GiB 5.0 GiB
-
This discrepancy is normally corrected after running an
fstrim
command on the file system. For further information about fstrim, please refer to RHEL documentation. However, manually running this command is time consuming. -
Is there any way to automate this task?
Environment
Openshift Data Foundation 4.9 and below.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.