Module 4: IBM Fusion Backup and Restore

You can protect your container workloads and virtual machines by using the IBM Fusion Backup & Restore service.

In the event of data loss or corruption, such as accidental deletion or malicious ransomware attacks, a backup and restore system is needed to ensure data integrity and availability. By taking periodic backups of applications and storing them safely, you can restore your workloads during disasters, thereby minimizing downtime and data loss. Whenever disaster occurs, you can restore the workloads in place or to an alternate cluster.

Backup & Restore service protects both containerized and virtual machine (VM) workloads, going beyond data protection to include the application’s state and essential etcd resources. This capability is not only for stateful applications but also for stateless ones, ensuring complete restoration of functionality and configuration.

Backup and restore works by first choosing a secure backup location and then defining backup polices tailored to your application needs with frequency and retention parameters. You can then associate the workloads with defined backup policies to automate and simply the backup process. Finally, you can recover the backed up workloads either in their original location or to an alternate cluster based on the requirements.

For more complex scenarios or whenever you need to run tailored and repeatable workflows, you can make use of the advanced recipes provided by Backup & Restore service.

Backup & Restore supports both single-cluster mode and hub and spoke model. In a single cluster mode, all backup and restore operations are managed within a single cluster. In case of hub and spoke model, the hub acts as a central management point and spokes are individual clusters that run backup and restore tasks locally. You can choose this mode to manage backups across multiple clusters, and it is useful for large-scale environments where multiple clusters need to be managed with resilience in case of failures.

The IBM Fusion Backup & Restore service protection involves the backup of the Backup & Restore data management service itself to a S3 bucket.

In this module, you will explore how to protect virtual machines with the IBM Fusion Backup and Restore Service.

Learning objectives

By the end of this module, you will be able to:

  • Configure and use the backup and restore functions of IBM Fusion

    • Learn how to define and configure backup locations and policies.

    • Learn how to assign backup policies to applications.

    • Learn how to restore an application.

    • Learn how to monitor the status of backups and jobs.

    • Learn how to create a recipe and assign the recipe to applications for application-consistent backups.

    • Learn how to configure protection of the backup and restore service.

Pre-steps

To complete the activities included in this lab, the IBM Fusion operator and IBM Fusion backup & restore service need to be installed. You will have had to complete Module 1, exercise 3 to proceed with this section.

Exercise 1: Create Backup Locations and Policies

Applications have different requirements for backup frequency and retention. IBM Fusion uses Backup Policies to define and automate backup operations.

To configure backup and restore activities, go to the Backup & Restore section on the left-hand side navigation pane. To access the Overview page for Backup & Restore, click on the Backup & Restore (A) menu item shown in the left-hand side navigation pane and select the Overview (B) sub-item.

Protect your application from data corruption and loss
Figure 1. Backup and Restore Overview

S3 Backup Bucket

Data Foundation must be installed and setup. In the OpenShift Console, navigate to “Data Foundation” → “object storage” and select the tab “Object Bucket Claims”

Data Foundation
Figure 2. Data Foundation

Change to the ibm-backup-restore Project.

IBM Storage Project
Figure 3. IBM Storage Project

Click create ObjectBucketClaim

Data Foundation Object Bucket Claim
Figure 4. Object Bucket Claim

Once the bucket claim is created, scroll down and reveal values

Data Foundation Object Bucket Claim values
Figure 5. Object Bucket Claim Values

We will use the Bucket Name, Access Key and Secret Key.

Next we need to get the external endpoint Navigate to networkingroutes and choose all projects and search for S3

Data Foundation S3 Routes values
Figure 6. Object Bucket S3 Routes

There you will find the correct route to use.

Backup Location

In the Fusion GUI, navigate to the Locations screen by clicking on the Backup & restore (A) menu item shown in the left-hand side navigation pane and selecting the Locations (B) sub-item. When the Locations screen is shown, click the Add location + © button and use the wizard to provide the appropriate S3 endpoint information and credentials.

Back and Restore Locations
Figure 7. Back and Restore Locations

Enter "Location1" (or any name of your choosing) in the Location name text entry field and click the MCG/NooBass (B) tile. Then, click "Next" to enter the connection details.

Enter the S3 endpoint and connection information collected in the previous steps

Back and Restore Location Details
Figure 8. Back and Restore Location Details

The newly added backup location should appear in a new tile and be connected after a few seconds.

Back and Restore Location Details Added
Figure 9. Back and Restore Location Details Added

Backup Policies

A backup policy is a set of rules and schedules that define how and when data is backed up. It outlines the frequency of backups, the type of data to be backed up, the retention period, and the storage location. The Backup & Restore service allows you to create and manage backup policies to ensure your data is protected according to your specific needs.

The Policies page lists all policies. You can search for policy records based on the backup location or other keywords, configure the table display, and perform actions like viewing, editing, or deleting policies from the ellipsis overflow menu.

In the Fusion GUI, navigate to the Policies screen by clicking on the Backup & restore (A) menu item shown in the left-hand side navigation pane and selecting the Policies (B) sub-item. When the Policies screen is shown, click the Add policy + © button to configure a backup policy.

Back and Restore Policies
Figure 10. Back and Restore Policies

Enter daily-snapshot (A) in the Policy Name text entry field, set Frequency to Daily and specify a Time window for the backup to occur. Then, select the In place snapshot (B) Backup location tile. Finally, click the Next © button to create the new daily-snapshot backup policy.

Back and Restore Policy Create
Figure 11. Back and Restore Policy Create

The daily-snapshot policy will now appear in the list of backup policies. Next, we will create a weekly-backup policy using object storage as the backup location. Click the Add policy + (A) button to begin.

Back and Restore Policy New
Figure 12. Back and Restore Policy New

(A) Enter weekly-backup in the Policy name text entry field, set Frequency to weekly (B), select Sunday © for Schedule, and specify a Time window for the backup to occur. Select the Object Storage (D) Backup location tile to pick the backup location object1 (E). Click the Create policy (F) button to complete creation of the weekly-backup backup policy.

Back and Restore Policy New Weekly
Figure 13. Back and Restore Policy Weekly

The Policies summary screen shows where backups are stored, the schedule for each policy, and the application that uses the policy.

Back and Restore Policy New summary
Figure 14. Back and Restore Policy Summary

Verify

Confirm the following in the IBM Fusion Backup & Restore console:

  • The backup location shows as Connected

  • Both the daily-snapshot and weekly-backup policies are listed in the Policies summary

Exercise 2: Backup and Restore an Application

In this section, you’ll learn how to create a basic application to demonstrate core functionality and prepare for backup and restore operations.

Create a simple application

In the OpenShift GUI, navigate to the Projects screen by clicking on the Home (A) menu item in the left-hand side navigation pane and selecting the Projects (B) sub-item. When the Projects screen is shown, click the Create Project © button.

Create New Project
Figure 15. Create New Project

(A) Enter the value filebrowser in the Name text entry field and click the Create (B) button.

Create New Project
Figure 16. Create New Project

Verify that the project listed is set to the newly created filebrowser namespace. Click the Import YAML (A) (the icon that looks like a + sign) button on the OpenShift GUI masthead.

Varify New Project
Figure 17. Varify New Project

Use the following yaml file to create the filebrowser application:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  labels:
    app: filebrowser
    app.kubernetes.io/component: filebrowser
    app.kubernetes.io/instance: filebrowser
    app.kubernetes.io/name: filebrowser
    app.kubernetes.io/part-of: filebrowser-app
  name: files
spec:
  storageClassName: ocs-storagecluster-ceph-rbd
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  labels:
    app: filebrowser
    app.kubernetes.io/component: filebrowser
    app.kubernetes.io/instance: filebrowser
    app.kubernetes.io/name: filebrowser
    app.kubernetes.io/part-of: filebrowser-app
  name: filebrowser-config
spec:
  storageClassName: ocs-storagecluster-ceph-rbd
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

---

kind: ConfigMap
apiVersion: v1
metadata:
  name: my-filebrowser-config
  labels:
    app: filebrowser
    app.kubernetes.io/component: filebrowser
    app.kubernetes.io/instance: filebrowser
    app.kubernetes.io/name: filebrowser
    app.kubernetes.io/part-of: filebrowser-app
data:
  .filebrowser.json: |
    {
      "port": 8080,
      "baseURL": "",
      "address": "",
      "log": "stdout",
      "database": "/config/database.db",
      "root": "/files"
    }

---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: filebrowser
  labels:
        app: filebrowser
        deployment: filebrowser
spec:
  replicas: 1
  selector:
    matchLabels:
        app: filebrowser
  template:
    metadata:
      labels:
        app: filebrowser
        app.kubernetes.io/component: filebrowser
        app.kubernetes.io/instance: filebrowser
        app.kubernetes.io/name: filebrowser
        app.kubernetes.io/part-of: filebrowser-app
    spec:
      restartPolicy: Always
      serviceAccountName: default
      schedulerName: default-scheduler
      enableServiceLinks: true
      terminationGracePeriodSeconds: 30
      securityContext: {}
      containers:
        - resources:
            requests:
              cpu: "100m"
              memory: "128Mi"
            limits:
              cpu: "500m"
              memory: "512Mi"
          readinessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 2
            timeoutSeconds: 2
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          name: filebrowser
          livenessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 10
            timeoutSeconds: 2
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          startupProbe:
            httpGet:
              path: /health
              port: 8080
            failureThreshold: 30
            periodSeconds: 10
          env:
            - name: TZ
              value: UTC
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
          imagePullPolicy: IfNotPresent
          securityContext:
            runAsNonRoot: true
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
          volumeMounts:
            - name: config
              mountPath: /config
            - name: filebrowser-config
              mountPath: /.filebrowser.json
              subPath: .filebrowser.json
            - name: data
              mountPath: /files
          image: 'filebrowser/filebrowser:v2.18.0'
      automountServiceAccountToken: true
      serviceAccount: default
      volumes:
        - name: config
          persistentVolumeClaim:
            claimName: filebrowser-config
        - name: filebrowser-config
          configMap:
            name: my-filebrowser-config
            defaultMode: 420
        - name: data
          persistentVolumeClaim:
            claimName: files
      dnsPolicy: ClusterFirst
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  revisionHistoryLimit: 3
  progressDeadlineSeconds: 600

---

kind: Service
apiVersion: v1
metadata:
  name: filebrowser
  labels:
    app: filebrowser
    app.kubernetes.io/component: filebrowser
    app.kubernetes.io/instance: filebrowser
    app.kubernetes.io/name: filebrowser
    app.kubernetes.io/part-of: filebrowser-app
spec:
  ports:
    - name: 8080-tcp
      protocol: TCP
      port: 8080
      targetPort: 8080
  type: ClusterIP
  selector:
    app: filebrowser

---
kind: Route
apiVersion: route.openshift.io/v1
metadata:
  name: filebrowser
  labels:
    app: filebrowser
    app.kubernetes.io/component: filebrowser
    app.kubernetes.io/instance: filebrowser
    app.kubernetes.io/name: filebrowser
    app.kubernetes.io/part-of: filebrowser-app
  annotations:
    openshift.io/host.generated: 'true'
spec:
  to:
    kind: Service
    name: filebrowser
    weight: 100
  port:
    targetPort: 8080-tcp
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Redirect
  wildcardPolicy: None

The OpenShift GUI and use Ctrl-V (windows), CMD-V (Mac) or browser Edit → Paste button to paste the contents of the clipboard into the editor (A) text entry field. Click the Create (B) button to create the filebrowser resources.

Paste YAML
Figure 18. Paste YAML

The following information will be displayed listing all resources that were created and Creation status.

YAML Status
Figure 19. YAML status

Navigate to the Route screen by clicking on the Network (A) menu item shown in the left-hand side navigation pane and selecting the Routes (B) sub-item. When the Routes screen is shown, click the URL Location © for the filebrowser route to open a new tab/window to the filebrowser application

It may take a minute or two for the filebrowser application to become fully online and accessible from the route screen
Routes
Figure 20. Routes

Login to the filebrowser application with Username (A): admin and Password (B): admin. Click the Login © button.

filebrowser login
Figure 21. filebrowser login

No files will be listed in the filebrowser application.

filebrowser files
Figure 22. filebrowser files

Use New folder (A) and Upload file (B) to create some directories and upload a couple files. In the example shown, 2 directories were created, and 3 files were uploaded.

Filebrowser Files New
Figure 23. Filebrowser Files New

Assign Policy to application

The OpenShift Cluster can host many application workloads; IBM Fusion provides a simple graphical user interface (GUI) to assign backup policies to applications and automate their protection.

There are two (2) methods for interacting with applications in the Fusion GUI. The Applications menu item on the left-hand side navigation pane shows only the applications local to the cluster. The Backed up applications sub-item under the Backup & restore menu allows for assigning policies to local and remote clusters. For this lab either option can be used.

Assign policy using applications menu item

This sub-section describes the process for managing backups of applications deployed in the local cluster using the Applications page.

Navigate to the Application pane by clicking on the Applications (A) menu item on the left-hand side navigation pane.

Applications Page
Figure 24. Applications Page

Select the filebrowser application checkbox (A) and click the Assign backup policy (B) button.

Applications Assign Policy
Figure 25. Applications Assign Policy

Select both the daily-snapshot checkbox (A) and weekly-backup checkbox (B). Leave the Back up now toggle set to enabled (displayed with a green checkmark). Click the Save © button.

Applications Assign Policy
Figure 26. Applications Assign Policy

A confirmation window will appear in the upper-right corner notifying that the policies have been assigned and the filebrowser application will appear in the list of Backed up applications.

Assign policy using Backed up applications menu item

This sub-section describes the process for managing backups of applications deployed across both hub and spoke clusters using the Backup up applications page.

Navigate to the Backed up applications pane in the IBM Fusion UI by clicking Backup & Restore (A) menu item shown in the left-hand side navigation pane and selecting the Backed up applications (B) sub-item. You should now see a page listing the applications that have been backed up, together with application details and assigned backup policies. Each line represents an OpenShift namespace which can contain a different application/workload.

If you want to find a specific namespace, you can use the search toolbar present on the page.

You can assign a backup policy to a namespace by clicking Protect apps + © on the right side. This will launch the Protect applications wizard.

Applications Assign Policy
Figure 27. Applications Assign Policy

The Protect applications wizard can be used to backup applications locally and in hub and spoke configurations. Select the local cluster (A) from the drop-down list, and a list of unprotected applications will populate in the list below. Next select, filebrowser (B) from the unprotected applications list. Finally click on the Next © button.

Protect Wizard
Figure 28. Protect Wizard

On the Assign policies, you can select one or more policies to attach to the application and if backup should start right after applying the policies. Select both the daily-snapshot (A) and weekly-backup (B) policies. Leave the Back up now toggle set to enabled (displayed with a green checkmark). Click the Assign © button.

Protect Wizard
Figure 29. Protect Wizard

A confirmation window will appear in the right-hand upper corner notifying that the policies have been assigned and the filebrowser application will appear in the list of Backed up applications.

Protect Wizard Confirm
Figure 30. Protect Wizard Confirm

Monitor backup status

Depending on the method used to Assign a backup policy, the Pending and In progress screens will be slightly different. Selecting the application name will display a page with the same information.

After a short period of time the Backup status will change from Pending to an In progress status, until it is Completed.

Backup Status
Figure 31. Backup Status

Status of each policy can be checked by going into the application pane and clicking the Backups (A) tab. In the example shown below, the daily-snapshot policy has Completed and the weekly-backup is Snapshot in progress.

Backup Complete
Figure 32. Backup Complete

Application restore

This section describes the steps required to restore an application from a previously created backup.

From the Applications or Backed up applications page, click the application name to open its Overview page

Backed Up Applications
Figure 33. Backedup Applications

The Backups tab shows all the backups created for this application and lets you choose the backup you want to restore from.

Backed Up Applications
Figure 34. Backedup Applications

A restore action can also be started by using buttons at top of the page. Click on the Restore (A) button located at the top of the pane.

Restoring Applications
Figure 35. Restoring Applications

The wizard presents the choice to restore to the same cluster or to a different cluster, if you have a hub-spoke setup. Open the drop-down list associated with the “Target cluster” field and select the This cluster (A) item from the list.

Restoring Application Wizard
Figure 36. Restoring Application Wizard

The restore wizard also provides a choice to restore over the same project, an existing project, or to a new project. Select Create a new project (A) and (B) enter filebrowser2 in the Project name text entry field. Then, click on the Next © button to select the backup to restore.

Restoring Application Project
Figure 37. Restoring Application Project

Choose the Backup time (A) you want to restore from, from the list of backups provided – note that if you want multiple backups to choose from, you must first create them. Then click on the Next (B) button.

Restoring Application Time
Figure 38. Restoring Application Time

Keep all the default settings shown and click on the Restore (A) button. A Summary (B) is displayed on the right pane with details on what the Before restore and After restore states will be.

Restoring Application Settings
Figure 39. Restoring Application Settings

Confirm the restore by clicking on the Restore (A) button in the final dialog box.

Restoring Application Confirm
Figure 40. Restoring Application Confirm

Watch the restore progress. Item (A) is the Restore job that has been scheduled; Item (B) will update as the restore operation progresses. The Restore process can also be tracked on the Jobs page. The Jobs page can be accessed by clicking on the Backup & restore menu item shown in the left-hand side navigation pane and selecting the Jobs sub-item. On the Jobs page, click the Restore tab to track progress.

Restoring Application Progress
Figure 41. Restoring Application Progress

In the OpenShift Console, navigate to the Pods page by clicking on the Workloads (A) menu item shown in the left-hand side navigation pane and selecting the click Pods (B) sub-item. Then click the project selector © and choose filebrowser2 (D) from the projects drop down menu. Refer to section OpenShift project selector on how to use the project selector.

Restoring Application Project
Figure 42. Restoring Application Project

Watch the application being restored and the new pods created for the restored application.

Restoring Application Watch
Figure 43. Restoring Application Watch

Navigate to the PersistenVolumesClaims screen by selecting the Storage (A) menu item shown in the left-hand side navigation pane and selecting the PersistentVolumeClaims (B) sub-item. The newly restored PVCs are shown.

Restoring Application PVC
Figure 44. Restoring Application PVC

Navigate to the Routes screen by clicking on the Networking (A) menu item shown in the left-hand side navigation pane and selecting the Routes (B) sub-item. When the Routes screen is shown

Restoring Application Routes
Figure 45. Restoring Application Routes

Login to the filebrowser application with the Username (A): admin and Password (B): admin. Click Login ©. Review that the files added earlier have been restored to a new application project

Restoring Application
Figure 46. Restoring Application

Verify

  • The restored filebrowser application in the filebrowser2 project is accessible via its route

  • The files and directories you uploaded earlier are present in the restored application

Exercise 3: Backup and Restore Virtual Machines

Backup a Virtual Machine

In the Administrative View, create a new project called "vmbackup"

Create a new Virtual Machine from the Catalog using the Red Hat Enterprise Linux 9 VM template. Use the name rhel9-backup.

Launch the Fusion User Interface by clicking the Application menu icon (looks like 9 squares) and then click IBM Storage Fusion. If prompted, enter kubeadmin and your kubeadmin password from the reservation.

Navigate to the Applications screen by clicking on the Applications (A) menu item on the left-hand side navigation pane. Select the check box (B) next to vmbackup application and click on the Assign backup policy © button to open the Assign backup policy page.

VM Back up Policy
Figure 47. VM Backup Policy

Select the check box (A) next to weekly-backup and leave the Back up now toggle set to enabled (green with a checkmark for enabled). Click on the Save (B) button to enable the weekly-backup policy for the vmbackup application and start a new backup job.

VM Set backup policy
Figure 48. VM Set backup policy

Wait for backup to show as Completed under Backup status.

VM Backup Complete
Figure 49. VM Backup Complete

Navigate to the Jobs screen by clicking on the Backup & restore (A) menu item on the left-hand side navigation pane and selecting the Jobs (B) menu sub-item. Click on the vmbackup-weekly-backup-<OCP cluster name> © button to open the backup summary page.

VM Backup Jobs
Figure 50. VM Backup Jobs

Review the information on this page. Some relevant information to the backup has been highlighted for informational purposes.

VM Backup Summary
Figure 51. VM Backup Summary

Restore Virtual Machine

Navigate to the Backed up applications screen by clicking on the Backup & restore (A) menu item on the left-hand side navigation pane and selecting the Backed up applications (B) menu sub-item. Click on the vmbackup © application name to open the vmbackup backup details page.

VM Backed up Applications
Figure 52. VM Backed up Applications

Click on the Restore (A) button to begin the restore process.

VM Restore
Figure 53. VM Restore

The wizard presents the choice to restore to the same cluster or to a different cluster, if you have a hub-spoke setup. Open the drop-down list associated with the “Target cluster” field and select the This cluster (A) item from the list.

VM Select Destination
Figure 54. VM Restore select destination

Click on the Create a new project (A) combo box to change the Project destination. Enter vmrestore in the Project name (B) text entry field and click the Next © button to continue the restore process.

VM Restore Project
Figure 55. VM Restore Project

Click on the latest backup time (A) combo box (which should be the backup that was run in the previous section). Click the Next (B) button to continue to the final step of the restore process.

VM Restore Select
Figure 56. VM Restore Select

Review the Summary (A) details for OpenShift Project and Restore point for accuracy. Click the Restore (B) button.

VM Restore Button
Figure 57. VM Restore Button

Click the Restore (A) button again to confirm the start of the restore process.

VM Confirm Restore
Figure 58. VM Comfirm Restore

Click on the View job details (A) button to open the vmbackup restore details page.

VM Job Details
Figure 59. VM Job Details

Wait for the restore backup job to show Completed.

VM Restore Complete
Figure 60. VM Restore Complete

Return to the OpenShift GUI. Navigate to the VirtualMachines screen by clicking on the Virtualization (A) menu item on the left-hand side navigation pane and selecting the VirtualMachines (B) sub-item. Use the Project selector to change to the vmrestore © project. Notice that the VirtualMachine has been restored to a new namespace and is in a Running Status.

List Restored VM
Figure 61. List Restored VM

Verify

  • The virtual machine rhel9-backup is in Running status in the vmrestore project

  • The VM was restored to a new namespace successfully

Exercise 4: Backup and Restore an Application with a recipe

Create an application with Fusion recipe

When you protect an application with Backup & Restore service, a default backup and restore workflow is used to protect an application. But while the backup and restore workflow is sufficient for some applications, there are some instances where you need to create a custom workflow for the backup and restore process to produce an application consistent backup. Recipes are used to create a custom workflow for the backup and restore process.

Types of consistency:

No consistency: Snapshots are not consistent. If an application uses 4 persistent volumes (PV), it rolls through these temporally. At point in time A, a snapshot is taken of one of the PVs. Then a snapshot is taken of the second, and then the third, and so on. Even with scripts, the PVs will not be backed up at the same time. Therefore, they will not be consistent with one another.

Consistency breaks if the application is doing active input/output (IO) to the persistent volumes. If the application is writing to the volumes in the middle of a snapshot and another snapshot of another volume was taken when the write was finished, it ends up being inconsistent. Crash consistent: IBM Fusion supports crash consistency. This ensures that all the snapshots of the PVs are taken at the exact same time so that they are consistent, even after a disaster. Crash consistency means that if, for example, a rack was to be unplugged and all the servers were to lose power at the same time, then all those PVs are consistent with one another because the writes to them stopped at the exact same time.

Application consistent: If a client has an application that has many, many persistent volumes, and that application is busy reading and writing to its PVs, there needs to be a way to instruct the application to stop writing or to pause. The application can complete any tasks in process but then stop briefly to allow a snapshot of the PVs to be taken. Then, the application can be instructed to resume. This is like quiescing a database.

With application consistency, it’s possible to restore an application to another cluster without having data stuck in an I/O buffer, thus ensuring the application is back running in the exact state it was in at the time of the backup. Application consistency also means that there needs to be a workflow to back up those applications in a certain order, and Fusion provides this with recipes.

Application consistent backups are important because they ensure that important files and data are saved in a way that keeps them safe and undamaged. This means that if something goes wrong, like a computer crash or a power outage, clients can restore their files and data to the way they were before the event, without losing any important information.

In the OpenShift GUI, navigate to the Projects screen by clicking on the Home (A) menu item in the left-hand side navigation pane and selecting the Projects (B) sub-item. When the Projects screen is shown, click on the Create Project © button.

create pacman project
Figure 62. Create PacMan Project

In the popup dialog enter pacman as the name.

create pacman project
Figure 63. Create PacMan Project

Use the following YAML file to create the PacMan Application in the pacman namespace.

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: mongo-storage
spec:
  storageClassName: ocs-storagecluster-ceph-rbd
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi

---

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: mongodb
    app: mongodb
  name: mongodb
spec:
  replicas: 1
  selector:
    matchLabels:
      name: mongodb
  template:
    metadata:
      labels:
        name: mongodb
        app: mongodb
    spec:
      containers:
      - image: bitnami/mongodb:5.0.24-debian-11-r20
        name: mongodb
        ports:
        - name: mongodb
          containerPort: 27017
        volumeMounts:
          - name: mongo-db
            mountPath: /bitnami/mongodb/data/db
      volumes:
        - name: mongo-db
          persistentVolumeClaim:
            claimName: mongo-storage

---

apiVersion: v1
kind: Service
metadata:
  labels:
    name: mongodb
  name: mongo
spec:
  type: ClusterIP
  ports:
    - port: 27017
      targetPort: 27017
  selector:
    name: mongodb

---

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: pacman
  name: pacman
spec:
  replicas: 1
  selector:
    matchLabels:
      name: pacman
  template:
    metadata:
      labels:
        name: pacman
    spec:
      containers:
      - image: quay.io/jpacker/nodejs-pacman-app:latest
        name: pacman
        ports:
        - containerPort: 8080
          name: http-server
      initContainers:
      - name: db-check
        image: busybox:latest
        command: ['sh', '-c', 'echo -e "Checking for the availability of MongoDB Server deployment"; while ! nc -z mongo 27017; do sleep 1; printf "-"; done; echo -e "  >> MongoDB Server has started";']


---

apiVersion: v1
kind: Service
metadata:
  name: pacman
  labels:
    name: pacman
spec:
  type: ClusterIP
  ports:
    - port: 80
      targetPort: 8080
      protocol: TCP
  selector:
    name: pacman

---

apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: pacman
  labels:
    app.kubernetes.io/name: pacman
spec:
  path: "/"
  to:
    kind: Service
    name: pacman
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Redirect
  wildcardPolicy: None

Click the Import YAML (A) (the icon that looks like a + sign) button on the OpenShift GUI masthead.

Import YAML
Figure 64. Import YAML

Navigate back to the OpenShift GUI and use Ctrl-V (windows), CMD-V (Mac) or the browser Edit → Paste function to paste the contents of the clipboard into the editor (A) text entry field. Click the Create (B) button to create the recipe.

Create Recipe
Figure 65. Create recipe

In the Fusion GUI, navigate to the Applications screen by clicking on the Applications (A) menu item shown in the left-hand side navigation pane. When the Applications screen is shown, select the pacman checkbox (B) and click on the Assign backup policy © button.

Assign Policy
Figure 66. Assign policy

Select the weekly-backup policy (A) and use the Backup up now (B) toggle to disable the initial backup (shown as gray when disabled). Click the Save © button.

IMPORTANT. Set the Backup up now option to disabled (indicated by the absence of a green checkmark) to prevent an initial backup. The Pacman application does not generate sufficient changes in the MongoDB database and performing an initial backup without the appropriate recipe may result in restore failures when using Change Block Tracking (CBT).
Set Policy
Figure 67. Set policy

The Pacman application is now associated with the weekly-backup policy.

Policy Associated
Figure 68. Policy Associated

In the OpenShift GUI, navigate to the Search screen by clicking on the Home (A) menu item shown in the left-hand side navigation pane and selecting the Search (B) sub-item.

Search
Figure 69. Search

Change to the ibm-spectrum-fusion-ns project, if not already there. Refer to section OpenShift project selector on how to use the project selector. Open the drop-down list associated with the Resources (A) field and (B) enter policyassignment in the search box text entry field (displayed with a magnifying glass). Select the PolicyAssignment ©. Click anywhere outside the drop-down list to dismiss the window.

Project Selector
Figure 70. Project Selector

Click on the PolicyAssignment associated with the pacman application that was just created. The syntax for the policy is, <application>-<backup policy>-<backup cluster name>. In the example shown here, the PolicyAssignment name is pacman-weekly-backup-apps.66d86bd0694f19a4a8b069f1.ocp.techzone.ibm.com.

Policy Assignment
Figure 71. Policy Assignment

Click the YAML (A) tab.

Policy Assignment YAML
Figure 72. Policy Assignment YAML

The recipe created in Step 13 will now be added to the Pacman weekly-backup PolicyAssignment.

The recipe syntax is as follows for use in a PolicyAssignment.

spec:
  recipe:
    apiVersion: spp-data-protection.isf.ibm.com/v1alpha1
    name: RECIPE_NAME
    namespace: RECIPE_NAMESPACE

RECIPE_NAME is the name of the recipe as specified in the Recipe CR. RECIPE_NAMESPACE is the namespace where the Recipe CR is located.

Enter the following 4 lines before status and after runNow as shown in the screenshot. The spacing included in the text entered is needed to conform to the YAML used by OpenShift.

for readability the metadata and status information have been collapsed using the expand/collapse buttons on the left-hand side of the editor.
  recipe:
    apiVersion: spp-data-protection.isf.ibm.com/v1alpha1
    name: mongodb-image-based-backup-restore-recipe
    namespace: ibm-spectrum-fusion-ns

Click the Save (A) button after the 4 new lines have been added.

Policy Save YAML
Figure 73. Policy Save YAML

Change to the pacman project using the Project selector if necessary. Refer to section OpenShift project selector on how to use the project selector. Navigate to the Pods screen by clicking on the Workload (A) menu item shown in the left-hand side navigation pane and selecting the Pods (B) sub-item. Click on the mongodb-XXXXXXXXXX-YYYYY pod © to open the pod details page.

Pacman Project
Figure 74. Pacman project

Click the Logs (A) tab and select Wrap lines (B) to improve readability. Scroll to the bottom of the logs if necessary. Leave this window open for now as we will return to it after a new backup has been run using the updated PolicyAssignment with the newly attached recipe.

Pacman Logs
Figure 75. Pacman logs

In the Fusion GUI, navigate to the Applications page by clicking on the Applications (A) menu item shown in the left-hand side navigation pane. When the Application screen is shown, select the pacman application (B) checkbox and click on the Back up now © button.

Backup Now
Figure 76. backup now

Click on the Back up (A) button.

Backup Now Button
Figure 77. backup now button

Navigate to the Jobs screen by clicking on the Backup & restore (A) menu item shown in the left-hand side navigation pane and selecting the Jobs (B) sub-item. When the Jobs screen is shown, click on the pacman-weekly-backup-<cluster name> job © to open the job details page.

Backup Jobs
Figure 78. backup jobs

Verify that the Backup sequence includes hooks provided in the backup recipe by expanding the Backup sequence section of the Jobs details.

Backup Sequence
Figure 79. backup sequence

Additional details can be displayed by selecting the Log view on the Backup Jobs page.

Backup Log View
Figure 80. backup log view

In the OpenShift GUI, navigate back to the mongodb Pod logs and look for the fsyncLock command to be executed. You may need to scroll back to find the COMMAND being run.

Mongo Logs
Figure 81. Mongo logs view

Continue investigating the mongodb logs and find the fsyncUnlock log entry.

Mongo Logs
Figure 82. Mongo logs view

Verify

  • The backup job for the pacman application completed successfully with the recipe hooks

  • The MongoDB logs show fsyncLock and fsyncUnlock commands, confirming application-consistent backup

Exercise 5: Backup Service Protection

The IBM Storage Fusion Backup & Restore service protection involves the backup of the control plane to a S3 object bucket. In the event of cluster failure, you can use this feature to restore the Backup & Restore service to another cluster. In this section you will configure service protection and run the initial service backup.

Service protection is just for backup/restore on the hub cluster and not for other configurations that exist in IBM Storage Fusion. For example, Red Hat OpenShift Container Platform cluster, disaster recovery, Red Hat OpenShift Data Foundation.

To follow this section, create a new object bucket claim, as was done in the backup location section and use the new bucket claim info service protection.

In the Fusion GUI, navigate to the Service protection page by clicking on the Backup & restore (A) menu item shown in the left-hand side navigation pane and selecting Service protection (B) sub-item.

Service Protection
Figure 83. Service Protection

Click on the Configure service backups (A) tile.

Service Protection Backups
Figure 84. Service Protection Backups

Click on the S3 Compliant tile in the Choose an object storage type wizard step and click the Next button.

Add Backup Location
Figure 85. Add Location

Enter the S3 endpoint and connection information, from the noobaa bucket claim you created.

Add Backup Location
Figure 86. Add Location

An Adding backup location, Location service-protection-location is being added message will appear in the upper-right corner of the Fusion GUI.

Service Protection Location
Figure 87. Service Protection Location

Click the Define schedule (A) button to configure a schedule for service protection.

Service Protection Schedule
Figure 88. Service Protection Schedule

Select Weekly (A) under the Select frequency item, select Sunday (B) from the Schedule item, and select a Start time, End time, and Timezone © under the Time window item. Click the Create policy (D) button. Leave Initiate Service backup now selected.

Service Protection Set Schedule
Figure 89. Service Protection Set Schedule

The backup service protection backup policy information should now be displayed.

Service Protection backup Policy
Figure 90. Service Protection Backup Policy

Confirm that backup service protection has been enabled for the IBM Fusion Backup & restore service.

Service Protection Enable
Figure 91. Service Protection Enable

Verify

  • The Backup & Restore service protection is enabled

  • A service backup schedule is configured with the weekly policy

Module summary

You have successfully explored the IBM Fusion Backup and Restore Service.

What you accomplished:

  • Defined backup and restore locations and policies.

  • Assigned backup polices to applications.

  • Restored an application to a new project.

  • Defined a backup service protection policy.

  • backup up and restored a virtual machine.

Key takeaways:

  • Fusion Backup and Restore is a key component of IBM Fusion and enhances Red Hat OpenShift.

  • IBM Fusion Backup and Restore has an easy to administer user interface.

  • Backup policies allow the customization of scheduled backup and create application consistent backups.