Member-only story
Ceph: Moving Virtual Machine Image (Part II)
For rbd images with snapshots
In the previous article, we covered how to move rbd images from one Ceph cluster to another Ceph cluster in the context where the rbd images are used for VM storage volumes.
In this article we address the problem of moving rbd images with their snapshots. The previous method does not move snapshots.
First, we will see how to export snapshots of an image, not the image. The following command will export a snapshot.
rbd export --pool [pool] --image [image]@[snap] [path]
To move an image with all the snapshots, we will export the first snapshot and import it to another cluster and then create a snapshot with the same name. Please note that rbd commands in this article work on two different Ceph clusters depending contexts.
rbd import --dest-pool [pool] --dest [image] [path]
rbd snap create [pool]/[image]@[snap]
This figure shows the whole process. The above procedures are in the step 1, step 2 and setp 3. The snapshot name in step 3 should be the same as the first snapshot that was exported.
Now, we move the other snapshots one by one with export-diff/import-diff commands.
rbd export-diff --pool [pool] --from-snap…