[ceph-users] import-diff requires snapshot exists?

2015-03-03 Thread Steve Anthony
Hello,

I've been playing with backing up images from my production site
(running 0.87) to my backup site (running 0.87.1) using export/import
and export-diff/import-diff. After initially exporting and importing the
image (rbd/small to backup/small) I took a snapshot (called test1) on
the production cluster, ran export-diff from that snapshot, and then
attempted to import-diff the diff file on the backup cluster.

# rbd import-diff ./foo.diff backup/small
start snapshot 'test1' does not exist in the image, aborting
Importing image diff: 0% complete...failed.
rbd: import-diff failed: (22) Invalid argument

This works fine if I create a test1 snapshot on the backup cluster
before running import-diff. However, it appears that the changes get
written into backup/small not backup/small@test1. So unless I'm not
understanding something, it seems like the content of the snapshot on
the backup cluster is of no importance, which makes me wonder why it
must exist at all.

Any thoughts? Thanks!

-Steve

-- 
Steve Anthony
LTS HPC Support Specialist
Lehigh University
sma...@lehigh.edu




signature.asc
Description: OpenPGP digital signature
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


Re: [ceph-users] import-diff requires snapshot exists?

2015-03-03 Thread Steve Anthony
Jason,

Ah, ok that makes sense. I was forgetting snapshots are read-only. Thanks!

My plan was to do something like this. First, create a sync snapshot and
seed the backup:

rbd snap create rbd/small@sync
rbd export rbd/small@sync ./foo

rbd import ./foo backup/small
rbd snap create backup/small@sync

Then each day, create a daily snap on the backup cluster:

rbd snap create backup/small@2015-02-03

Then send that day's changes:

rbd export-diff --from-snap sync rbd/small ./foo.diff
rbd import-diff ./foo.diff rbd/small

Then remove and recreate the daily snap marker to prepare for the next sync.

rbd snap rm rbd/small@sync
rbd snap rm backup/small@sync

rbd snap create rbd/small@sync
rbd snap create backup/small@sync

Finally remove any dated snapshots on the remote cluster outside the
retention window.

-Steve

On 03/03/2015 04:37 PM, Jason Dillaman wrote:
 Snapshots are read-only, so all changes to the image can only be applied to 
 the HEAD revision.

 In general, you should take a snapshot prior to export / export-diff to 
 ensure consistent images:

   rbd snap create rbd/small@snap1
   rbd export rbd/small@snap1 ./foo

   rbd import ./foo backup/small
   rbd snap create backup/small@snap1

   ** rbd/small and backup/small are now consistent through snap1 -- rbd/small 
 might have been modified post snapshot

   rbd snap create rbd/small@snap2
   rbd export-diff --from-snap snap1 rbd/small@snap2 ./foo.diff
   rbd import-diff ./foo.diff backup/small

   ** rbd/small and backup/small are now consistent through snap2.  
 import-diff automatically created backup/small@snap2 after importing all 
 changes. 

 -- Jason Dillaman Red Hat dilla...@redhat.com http://www.redhat.com
 - Original Message - From: Steve Anthony sma...@lehigh.edu
 To: ceph-users@lists.ceph.com Sent: Tuesday, March 3, 2015 2:06:44 PM
 Subject: [ceph-users] import-diff requires snapshot exists? Hello,
 I've been playing with backing up images from my production site
 (running 0.87) to my backup site (running 0.87.1) using export/import
 and export-diff/import-diff. After initially exporting and importing
 the image (rbd/small to backup/small) I took a snapshot (called test1)
 on the production cluster, ran export-diff from that snapshot, and
 then attempted to import-diff the diff file on the backup cluster. #
 rbd import-diff ./foo.diff backup/small start snapshot 'test1' does
 not exist in the image, aborting Importing image diff: 0%
 complete...failed. rbd: import-diff failed: (22) Invalid argument This
 works fine if I create a test1 snapshot on the backup cluster before
 running import-diff. However, it appears that the changes get written
 into backup/small not backup/small@test1. So unless I'm not
 understanding something, it seems like the content of the snapshot on
 the backup cluster is of no importance, which makes me wonder why it
 must exist at all. Any thoughts? Thanks! -Steve
 -- Steve Anthony LTS HPC Support Specialist Lehigh University
 sma...@lehigh.edu ___
 ceph-users mailing list ceph-users@lists.ceph.com
 http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

-- 
Steve Anthony
LTS HPC Support Specialist
Lehigh University
sma...@lehigh.edu




signature.asc
Description: OpenPGP digital signature
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com