Add a snapshot schedule for a CephFS path that does not exist yet. You can create one or
more schedules for a single path. Schedules are considered different, if their repeat interval and
start times are different.
Before you begin
Before you begin, make sure that you have the following prerequisites in place:
- A running, and healthy IBM Storage Ceph cluster.
- Deployment of a Ceph File System.
- Root-level access to a Ceph Manager and Metadata Server (MDS) nodes.
- CephFS snapshots enabled on the file system.
About this task
A CephFS path can have only one retention policy, but a retention policy can have multiple
count-time period pairs.
Note: Once the scheduler module is enabled, running the ceph fs
snap-schedule command displays the available subcommands and their usage
format.
Procedure
- Log in to the
cephadm shell on a Ceph Manager node:For
example,
[root@host01 ~]# cephadm shell
- Enable the
snap_schedule module.For
example,
[ceph: root@host01 ~]# ceph mgr module enable snap_schedule
- Log in to the
cephadm shell on a Ceph Metadata Server node.For
example,
[root@host02 ~]# cephadm shell
- Add a schedule for a Ceph File System.
Note: START_TIME is represented in ISO 8601 format.
ceph fs snap-schedule add FILE_SYSTEM_VOLUME_PATH REPEAT_INTERVAL [START_TIME] --fs CEPH_FILE_SYSTEM_NAME
In the following example, a snapshot schedule is created for the CephFS
/cephfs volume, snapshotting every hour, and starts on 27 June 2022 9:50
PM.
[ceph: root@host02 ~]# ceph fs snap-schedule add /cephfs_kernelf739cwtus2/pmo9axbwsi 1h 2022-06-27T21:50:00 --fs cephfs01
- Add a retention policy for snapshots of a CephFS volume path.
ceph fs snap-schedule retention add FILE_SYSTEM_VOLUME_PATH [COUNT_TIME_PERIOD_PAIR] TIME_PERIOD COUNT
For example:
[ceph: root@host02 ~]# ceph fs snap-schedule retention add /cephfs h 14 (1)
[ceph: root@host02 ~]# ceph fs snap-schedule retention add /cephfs d 4 (2)
[ceph: root@host02 ~]# ceph fs snap-schedule retention add /cephfs 14h4w (3)
- (1) This example keeps 14 snapshots at least one hour apart.
- (2) This example keeps 4 snapshots at least one day apart.
- (3) This example keeps 14 hourly, and 4 weekly snapshots.
- List the snapshot schedules to verify that the new schedule is created.
ceph fs snap-schedule list FILE_SYSTEM_VOLUME_PATH [--format=plain|json] [--recursive=true]
The following example lists all schedules in the directory
tree.
[ceph: root@host02 ~]# ceph fs snap-schedule list /cephfs --recursive=true
- Check the status of a snapshot schedule.
ceph fs snap-schedule status FILE_SYSTEM_VOLUME_PATH [--format=plain|json]
The following example displays the status of the snapshot schedule for the CephFS
/cephfs path in JSON format. If not specified, the default format is plain
text.
[ceph: root@host02 ~]# ceph fs snap-schedule status /cephfs --format=json