This is what I did:
# rbd import /var/tmp/debian93-raw.img images/debian93
# rbd info images/debian93
rbd image 'debian93':
size 81920 MB in 20480 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.384b74b0dc51
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
flags:
create_timestamp: Wed May 9 09:31:24 2018
# rbd snap create images/debian93@snap
# rbd snap protect images/debian93@snap
# rbd clone images/debian93@snap vms/debian93.dsk
# rbd du vms/debian93.dsk
NAME PROVISIONED USED
debian93.dsk 81920M 336M
--- Inside the VM ---
# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 79G 10G 66G 14% /
# fstrim -v /
/: 36.6 GiB (39311650816 bytes) trimmed
--- then rbd du reports ---
# rbd du vms/debian93.dsk
NAME PROVISIONED USED
debian93.dsk 81920M 76028M
=== If I disable fast-diff feature from images/debian93: ===
# fstrim -v /
/: 41 GiB (44059172864 bytes) trimmed
# rbd du vms/debian93.dsk
warning: fast-diff map is not enabled for debian93.dsk. operation may be slow.
NAME PROVISIONED USED
debian93.dsk 81920M 8612M
=== or just flatten vms/debian93.dsk without disabling fast-diff ===
# rbd du vms/debian93.dsk
NAME PROVISIONED USED
debian93.dsk 81920M 11992M
# fstrim -v /
/: 68.7 GiB (73710755840 bytes) trimmed
# rbd du vms/debian93.dsk
NAME PROVISIONED USED
debian93.dsk 81920M 12000M
Testing environment:
Ceph: v12.2.5
OS: Ubuntu 18.04
QEMU: 2.11
libvirt: 4.0.0
Is this a known issue? or is the above behavior expected?
Thanks,
--Youzhong
_______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com