Chapter 4. Creating VolumeReplicationClass resource

The VolumeReplicationClass is used to specify the mirroringMode for each volume to be replicated as well as how often a volume or image is replicated (for example, every 5 minutes) from the local cluster to the remote cluster.

Note

This resource must be created on the Primary managed cluster and the Secondary managed cluster.

Procedure

  1. Save the following YAML to filename rbd-volumereplicationclass.yaml.

    apiVersion: replication.storage.openshift.io/v1alpha1
    kind: VolumeReplicationClass
    metadata:
      name: odf-rbd-volumereplicationclass
    spec:
      provisioner: openshift-storage.rbd.csi.ceph.com
      parameters:
        mirroringMode: snapshot
        schedulingInterval: "5m"  # <-- Must be the same as scheduling interval in the DRPolicy
        replication.storage.openshift.io/replication-secret-name: rook-csi-rbd-provisioner
        replication.storage.openshift.io/replication-secret-namespace: openshift-storage
  2. Create the file on both the managed clusters.

    $ oc create -f rbd-volumereplicationclass.yaml

    Example output:

    volumereplicationclass.replication.storage.openshift.io/odf-rbd-volumereplicationclass created