Working with RBD snapshots
Ceph extends full support to snapshots, which are point-in-time, read-only copies of an RBD image. You can preserve the state of a Ceph RBD image by creating snapshots and restoring the snapshot to get the original data.
If you take a snapshot of an RBD image while I/O is in progress to the image the snapshot may be inconsistent. If this occurs you will be required to clone the snapshot to a new image for it to be mountable. When taking snapshots it is recommended to cease I/O from the application to the image before taking the snapshot. This can be done by customizing the application to issue a freeze before a snapshot or can manually be done using the fsfreeze
command (man page for fsfreeze
details this command further).
How to do it...
Let's see how a snapshot works with Ceph:
To test the snapshot functionality of Ceph, let's create a file on the block device that we created earlier:
# echo "Hello Ceph This is snapshot test"
> /mnt/ceph...