How To Backup And Restore CEPH Data In Automation Suite?

How to backup the ceph information?

Issue Description:

CEPH is a distributed storage system used in Automation Suite. It is important to backup CEPH data regularly to avoid data loss. This KB provides the steps to backup and restore CEPH data.

Resolution:

  1. Download and load the image
    1. Download the CEPH backup and restore image from https://download.uipath.com/automation-suite/sf-k8-utils-rhel_0_7.tar.gz
    2. Copy the downloaded image to the machine using scp
    3. Uncompress the image using the command 'gzip -dk -c sf-k8-utils-rhel_0_7.tar.gz > sf-k8-utils-rhel_0_7.tar'
    4. Load the image into podman using the command 'podman load -i sf-k8-utils-rhel_0_7.tar'.
    5. Push the image to the registry using the command 'podman push --tls-verify=false localhost:30071/sf-k8-utils-rhel:0.7'
    6. If the command fails with an 'unauthorized: authentication required' error, login into the registry using the command 'podman login localhost:30071 --username "${docker_registry_username}" --password"${docker_registry_password}" --tls-verify=false' and retry
    7. Re-run this script.

Note: Step 1 is only for airgapped instances. Also, different image versions can be used in newer version as k8-utils-rhel_0_9.tar.gz

  1. Check the space required for backup
    • Use the command to check the space required for backup.
ceph_object_size=$(kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph status --format json | jq -r '.pgmap.data_bytes')
  • The command will output the required storage space in human-readable format.

  1. Download script (script attached in onedrive url)

  1. Backup CEPH data with the following command:
CEPH_BACKUP_PATH=/ceph/backup/path CEPH_OPERATION=backup ./ondemand-ceph-backup-restore.sh

The script should output below line after successful backup:

  • job.batch/ceph-objectstore-ondemand-backup-job created
  • job.batch/ceph-objectstore-ondemand-backup-job condition met

  1. Restore CEPH data
CEPH_BACKUP_PATH=/ceph/backup/path CEPH_OPERATION=restore ./ondemand-ceph-backup-restore.sh

The script should output the below line after successful restore:

  • job.batch/ceph-objectstore-ondemand-restore-job created
  • job.batch/ceph-objectstore-ondemand-restore-job condition met