Re: [ceph-users] Error when I compare hashes of export-diff / import-diff

2019-06-12 Thread Rafael Diaz Maurin

Le 12/06/2019 à 16:01, Jason Dillaman a écrit :

On Wed, Jun 12, 2019 at 9:50 AM Rafael Diaz Maurin
 wrote:

Hello Jason,

Le 11/06/2019 à 15:31, Jason Dillaman a écrit :

4- I export the snapshot from the source pool and I import the snapshot
towards the destination pool (in the pipe)
rbd export-diff --from-snap ${LAST-SNAP}
${POOL-SOURCE}/${KVM-IMAGE}@${TODAY-SNAP} - | rbd -c ${BACKUP-CLUSTER}
import-diff - ${POOL-DESTINATION}/${KVM-IMAGE}

What's the actual difference between the "rbd diff" outputs? There is
a known "issue" where object-map will flag an object as dirty if you
had run an fstrim/discard on the image, but it doesn't affect the
actual validity of the data.


The feature discard=on is activated, and qemu-guest-agent is running on
the guest.

Here are the only differences between the 2 outputs of the "rbd diff
--format plain" (image source and image destination) :
Offset  Length  Type
121c121
< 14103347200 2097152 data
---
  > 14103339008 2105344 data
153c153
< 14371782656 2097152 data
---
  > 14369685504 4194304 data
216c216
< 14640218112 2097152 data
---
  > 14638120960 4194304 data
444c444
< 15739125760 2097152 data
---
  > 15738519552 2703360 data

And the hashes of the exports are identical (between source and
destination) :
rbd -p ${POOL-SOURCE} export ${KVM-IMAGE}@${TODAY-SNAP} - | md5sum
=> ee7012e14870b36e7b9695e52c417c06

rbd -c ${BACKUP-CLUSTER} -p ${POOL-DESTINATION} export
${KVM-IMAGE}@${TODAY-SNAP} - | md5sum
=> ee7012e14870b36e7b9695e52c417c06


So do you think this can be caused by the fstrim/discard feature.

You said you weren't using fstrim/discard.


In fact, the daemon fstrim is not enabled in the guest, but... in 
proxmox I set the option discard=on and maybe I ran fstrim once by hard 
testing...



If you export both images
and compare those image extents where the diffs are different, is it
just filled w/ zeroes?


I can't find how to to compare if the diffs of the extends are filled by 
w/ zeros.


However I finally succeed getting identical the "rbd diff " hashes with 
the option "--whole-object" like this :


HASH source :
rbd diff --from-snap  /@ --format json 
--whole-object | md5sum | cut -d ' ' -f 1


Hash destination
rbd -c  diff --from-snap  
/@ --format json --whole-object | md5sum | cut -d ' 
' -f 1



Best regards,
Rafael



--
Rafael Diaz Maurin
DSI de l'Université de Rennes 1
Pôle Infrastructures, équipe Systèmes
02 23 23 71 57




smime.p7s
Description: Signature cryptographique S/MIME
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


Re: [ceph-users] Error when I compare hashes of export-diff / import-diff

2019-06-12 Thread Rafael Diaz Maurin

Hello Jason,

Le 11/06/2019 à 15:31, Jason Dillaman a écrit :

4- I export the snapshot from the source pool and I import the snapshot
towards the destination pool (in the pipe)
rbd export-diff --from-snap ${LAST-SNAP}
${POOL-SOURCE}/${KVM-IMAGE}@${TODAY-SNAP} - | rbd -c ${BACKUP-CLUSTER}
import-diff - ${POOL-DESTINATION}/${KVM-IMAGE}

What's the actual difference between the "rbd diff" outputs? There is
a known "issue" where object-map will flag an object as dirty if you
had run an fstrim/discard on the image, but it doesn't affect the
actual validity of the data.



The feature discard=on is activated, and qemu-guest-agent is running on 
the guest.


Here are the only differences between the 2 outputs of the "rbd diff  
--format plain" (image source and image destination) :

Offset              Length  Type
121c121
< 14103347200 2097152 data
---
> 14103339008 2105344 data
153c153
< 14371782656 2097152 data
---
> 14369685504 4194304 data
216c216
< 14640218112 2097152 data
---
> 14638120960 4194304 data
444c444
< 15739125760 2097152 data
---
> 15738519552 2703360 data

And the hashes of the exports are identical (between source and 
destination) :

rbd -p ${POOL-SOURCE} export ${KVM-IMAGE}@${TODAY-SNAP} - | md5sum
=> ee7012e14870b36e7b9695e52c417c06

rbd -c ${BACKUP-CLUSTER} -p ${POOL-DESTINATION} export 
${KVM-IMAGE}@${TODAY-SNAP} - | md5sum

=> ee7012e14870b36e7b9695e52c417c06


So do you think this can be caused by the fstrim/discard feature.

In fact, when fstrim/discard activated it, the only way to validate the 
export-diff is to compare full exports hashes ?



Thank you.


Best regards,
Rafael

--
Rafael Diaz Maurin
DSI de l'Université de Rennes 1
Pôle Infrastructures, équipe Systèmes
02 23 23 71 57




smime.p7s
Description: Signature cryptographique S/MIME
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


[ceph-users] Error when I compare hashes of export-diff / import-diff

2019-06-11 Thread Rafael Diaz Maurin

Hello,

I have a problem when I want to validate (using md5 hashes) rbd 
export/import diff from a rbd source-pool (the production pool) towards 
another rbd destination-pool (the backup pool).


Here is the algorythm :
1- First of all, I validate that the two hashes from lasts snapshots 
source and destination are the same :

rbd -p ${POOL-SOURCE} export ${KVM-IMAGE}@${LAST-SNAP} - | md5sum
=> 3f54626da234730eefc27ef2a3b6ca83
rbd -c ${BACKUP-CLUSTER} -p ${POOL-DESTINATION} export 
${KVM-IMAGE}@${LAST-SNAP} - | md5sum

=> 3f54626da234730eefc27ef2a3b6ca83


2- If not exists, I create an empty image in the destination pool
rbd -c ${BACKUP-CLUSTER} create ${POOL-DESTINATION}/${KVM-IMAGE} -s 1

3- I create a snapshot inside the source pool
rbd snap create ${POOL-SOURCE}/${KVM-IMAGE}@${TODAY-SNAP}

4- I export the snapshot from the source pool and I import the snapshot 
towards the destination pool (in the pipe)
rbd export-diff --from-snap ${LAST-SNAP} 
${POOL-SOURCE}/${KVM-IMAGE}@${TODAY-SNAP} - | rbd -c ${BACKUP-CLUSTER} 
import-diff - ${POOL-DESTINATION}/${KVM-IMAGE}


The problem occurs when I want to validate only the diff between the 2 
snapshots (in order to be more efficient). I note that those hashes are 
differents.


Here is how I calcultate the hashes :
Source-hash : rbd diff --from-snap ${LAST-SNAP} 
${POOL-SOURCE}/${KVM-IMAGE}@${TODAY-SNAP} --format json | md5sum | cut 
-d ' ' -f 1

=> bc56663b8ff01ec388598037a20861cf
Destination-hash : rbd -c ${BACKUP-CLUSTER} diff --from-snap 
${LAST-SNAP} ${POOL-DESTINATION}/${KVM-IMAGE}@${TODAY-SNAP} --format 
json | md5sum | cut -d ' ' -f 1

=> 3aa35362471419abe0a41f222c113096

In an other hand, if I compare the hashes of the export (between source 
and destination), they are the same :


rbd -p ${POOL-SOURCE} export ${KVM-IMAGE}@${TODAY-SNAP} - | md5sum
=> 2c4962870fdd67ca758c154760d9df83
rbd -c ${BACKUP-CLUSTER} -p ${POOL-DESTINATION} export 
${KVM-IMAGE}@${TODAY-SNAP} - | md5sum

=> 2c4962870fdd67ca758c154760d9df83


Can someone has an idea of what's happenning ?

Can someone has a way to succeed in comparing the export-diff /import-diff ?




Thank you,
Rafael

--
Rafael Diaz Maurin
DSI de l'Université de Rennes 1
Pôle Infrastructures, équipe Systèmes
02 23 23 71 57




smime.p7s
Description: Signature cryptographique S/MIME
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com