CephNotes

Some notes about Ceph
Laurent Barbe @SIB

Convert RBD to format v2

Simple Import / Export

Don't forget to stop IO before sync and unmap rbd before rename.

$ rbd export rbd/myrbd - | rbd import --image-format 2 - rbd/myrbd_v2
$ rbd mv rbd/myrbd rbd/myrbd_old
$ rbd mv rbd/myrbd_v2 rbd/myrbd

Check :

$ rbd info rbd/myrbd
$ rbd image 'myrbd':
    size 102400 KB in 25 objects
    order 22 (4096 KB objects)
    block_name_prefix: rbd_data.24f72ae8944a
    format: 2
    features: layering

Using DIFF

For the first sync, you don't need to stop IO on device. Make snap, and sync until this snapshot.

$ rbd snap create rbd/myrbd@snap1
$ rbd export rbd/myrbd@snap1 - | rbd import --image-format 2 - rbd/myrbd_v2
$ rbd snap create rbd/myrbd_v2@snap1

Check snapshot :

$ rbd snap ls rbd/myrbd_v2

Sync diff : Stop IO before last sync

$ rbd snap create rbd/myrbd@snap2
$ rbd export-diff --from-snap snap1 rbd/myrbd@snap2 - | rbd import-diff - rbd/myrbd_v2

RBD RBD

Comments