Hi Ilya,
That explains it. Thank you for clarification!
Tony
________________________________________
From: Ilya Dryomov <idryomov(a)gmail.com>
Sent: December 4, 2023 09:40 AM
To: Tony Liu
Cc: ceph-users(a)ceph.io; dev(a)ceph.io
Subject: Re: [ceph-users] the image used size becomes 0 after export/import with snapshot
On Tue, Nov 28, 2023 at 8:18 AM Tony Liu <tonyliu0592(a)hotmail.com> wrote:
Hi,
I have an image with a snapshot and some changes after snapshot.
```
$ rbd du backup/f0408e1e-06b6-437b-a2b5-70e3751d0a26
NAME
PROVISIONED USED
f0408e1e-06b6-437b-a2b5-70e3751d0a26@snapshot-eb085877-7557-4620-9c01-c5587b857029
10 GiB 2.4 GiB
f0408e1e-06b6-437b-a2b5-70e3751d0a26
10 GiB 2.4 GiB
<TOTAL>
10 GiB 4.8 GiB
```
If there is no changes after snapshot, the image line will show 0 used.
I did export and import.
```
$ rbd export --export-format 2 backup/f0408e1e-06b6-437b-a2b5-70e3751d0a26 - | rbd import
--export-format 2 - backup/test
Exporting image: 100% complete...done.
Importing image: 100% complete...done.
```
When check the imported image, the image line shows 0 used.
```
$ rbd du backup/test
NAME PROVISIONED USED
test@snapshot-eb085877-7557-4620-9c01-c5587b857029 10 GiB 2.4 GiB
test 10 GiB 0 B
<TOTAL> 10 GiB 2.4 GiB
```
Any clues how that happened? I'd expect the same du as the source.
Hi Tony,
"rbd import" command does zero detection at 4k granularity by default.
If the "after snapshot" changes just zeroed everything in the snapshot,
such a discrepancy in "rbd du" USED column is expected.
Thanks,
Ilya