I've been fighting with this 2 days:
I know that unmap is supported, at least when I provision data store, create some eager zeroed vmdk, then delete it
and then run
esxcli storage vmfs unmap -l DataStoreName
I can see space being reclaimed on the EMC Lun.
Now I'm trying to do the same with RDM (physical).
Per RedHat starting from RedHat 6.0(3) they support discard on ext4
What is "Thin Provisioning" (of storage) and how does it relate to RHEL6? - Red Hat Customer Portal
So I've tried with just a block device
mkfs.ext4 -E discard /dev/sdb
mount -o discard /dev/sdb /mnt
And also tried putting fs on top of lvm
vgcreate TestVG /dev/sdb
lvcreate -l 100%FREE -n TestLV TestVG
mkfs.ext4 - E discard /dev/TestVG/TestLV
mount -o discard /dev/mapper/TestVG/TestLV /mnt
In both cases it doesn't look like discard is actually working.
Reading RedHat docs it looks like it's supposed to use UNMAP when mounted with -o discard.
And since I provisioned it in VMWare as RDM - it's supposed to pass all the SCSI commands to the underlying LUN.
However I'm not seeing this happening.
When I copy some 4GB iso to this file system, then create several copies of it and then delete it - I see absolutely no change on the LUN in terms of reclaiming space.
It only grows in size.
I'm really lost now.
My next steps would be installing RedHat 6.5 on the bare metal and checking if this issue is still there.
Could it be that HBA driver is blocking some commands en route to EMC?
Anyway, I'm going to try on the bare metal:
Will report back results.