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.
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-disk1/snapshot_test_file
Create a snapshot for the Ceph block device:
Syntax:
rbd snap create <pool-name>/<image-name>@<snap-name>
# rbd snap create rbd/rbd1@snapshot1 --name client.rbd
To list the snapshots of an image, use the following:
Syntax:
rbd snap ls <pool-name>/<image-name>
# rbd snap ls rbd/rbd1 --name client.rbd
To test the snapshot restore functionality of Ceph RBD, let's delete files from the filesystem:
# rm -f /mnt/ceph-disk1/*
We will now restore the Ceph RBD snapshot to get back the...