Hello
I’m struggling with fstrim: does not reclaim disk space
I have a OpenNebula 5.12.0.1 installation on CentOS 8.
Here’s my KVM VM template:
DISK = [
ALLOW_ORPHANS = "NO",
CACHE = "none",
CLONE = "YES",
CLONE_TARGET = "SYSTEM",
CLUSTER_ID = "0,100,101,102",
DATASTORE = "default",
DATASTORE_ID = "1",
DEV_PREFIX = "sd",
DISCARD = "unmap",
DISK_ID = "0",
DISK_SNAPSHOT_TOTAL_SIZE = "0",
DISK_TYPE = "FILE",
DRIVER = "qcow2",
IMAGE = "Centos 8 clean",
IMAGE_ID = "1",
IMAGE_STATE = "2",
IO = "native",
LN_TARGET = "SYSTEM",
ORIGINAL_SIZE = "4096",
READONLY = "NO",
SAVE = "NO",
SIZE = "4096",
SOURCE = "/var/lib/one//datastores/1/70e28680532aed554240192b8a1c56ea",
TARGET = "sda",
TM_MAD = "ssh",
TYPE = "FILE" ]
I have created a file with random data in it.
I saw the disk.0 size increase from 480Mb to 1.4Gb
I deleted the generated file. The disk space in the guest VM decreased.
Then i run fstrim:
[root@VM-208 ~]# fstrim -av
/: 3.2 GiB (3390345216 bytes) trimmed
the size of disk.0 in the host always 1.4Gb
-rw-r--r-- 1 oneadmin oneadmin 1,4G 20 ago 11.45 disk.0
I have tried both “SCSI/SATA” and “VIRTIO” bus type – apart a change in the disk device from sda to vda, the result is the same.
What am I missing?