--- title: "Replicate Block Volumes with VAST CSI Replication Operator" slug: "replicate-block-volumes-with-vast-csi-replication-operator-2-6" updated: 2026-11-04T00:31:17Z published: 2026-11-04T00:31:17Z canonical: "docs.vastdata.com/replicate-block-volumes-with-vast-csi-replication-operator-2-6" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt > Use this file to discover all available pages before exploring further. # Replicate Block Volumes with VAST CSI Replication Operator ## Overview of Asynchronous Replication of Block Volumes Starting with version 2.6.6, VAST Block CSI Driver supports asynchronous replication of block volumes between VAST clusters, with the ability to perform a failover to the secondary replication peer. Data from one source cluster can be replicated to multiple destination clusters. VAST CSI Replication Operator is a Kubernetes operator that simplifies configuring asynchronous replication of volumes provisioned on the VAST cluster by providing automated replication management and PVC labeling based on the replication CRDs. Using the information provided in the replication CRDs, VAST CSI Replication Operator can perform the following operations: - Create a protection policy of the NATIVE_REPLICATION type on the source VAST cluster, for each pair of VAST clusters listed in the CRD. - Create a protected path on the source peer and associate it with a replication stream for each destination peer. - Create `VolumeReplicationClass` and `VolumeGroupReplicationClass` definitions required by the driver. - Start replication according to the replication schedule specified in the CRD. - On a failover: - Create/delete PVC-PV pairs on each former destination cluster (so that the workloads can mount the replica). - Create replica objects (volumes) - Restart the pods that are using source PVCs and redirect them to the appropriate PVCs at the former destination cluster. The following replication types are supported: - [One-volume replication](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#vastvolumereplication-crd) is configured on a single volume by means of the `VastVolumeReplication` CRD. - [Multi-volume replication](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#vaststorageclassreplication-crd) lets you replicate all volumes created with a particular storage class. This replication type is implemented using the `VastStorageClassReplication` CRD, with the ability to restrict replication to a certain group of volumes only. - [Subsystem replication](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#subsystem-replication) lets you replicate volumes of a particular subsystem. To set up replication with VAST CSI Replication Operator: 1. Ensure that [VAST cluster](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#vast-cluster-requirements) and [Kubernetes](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#kubernetes-requirements) requirements are met. 2. Complete [preconfiguration](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#preconfigurations-on-vast-clusters) steps on the source and destination VAST clusters. 3. [Install](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#install-vast-csi-repllication-operator) VAST CSI Replication Operator. 4. (Optional) Refine the [name format](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#name-format-for-destination-pvcs-and-pvs) for destination PVCs and PVs. 5. [Create](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#create-replication-crds) the replication CRD. 6. (Optional) [Create](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#optional-create-setup-for-subsystem-replication) setup for subsystem replication. 7. [Create](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#create-pvcs-to-be-replicated) PVCs to be replicated. After the source PVC are created, the replication starts according to the schedule defined in the replication CRD. VAST CSI Replication Operator comes with a [CLI tool](https://github.com/vast-data/vast-csi/releases/tag/v1.0) that lets you [check](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#verify-replication-status-with-csi-cli) the replication status, [initiate](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#initiate-failover-with-csi-cli) a failover, run on-demand [synchronization](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#synchronize-volumes-with-csi-cli), or [remove](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#remove-replication-configuration-with-csi-cli) a replication configuration. > **Note:** A failover can also be [initiated](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#initiate-failover-by-manuallyupdating-replication-crds) manually, by updating the replication CRDs. ## VAST Cluster Requirements - VAST clusters running release 5.5.0 or later, with network connectivity through their replication ports. ## Kubernetes Requirements - Kubernetes 1.26 or later - A Kubernetes secret containing VMS credentials for source and destination clusters. > **Note:** Secrets with VMS API tokens are not supported. ## Preconfigurations on VAST Clusters Ensure that the following items are preconfigured on the source VAST cluster: - An Element Store view to expose the subsystem with the source volumes - A replication virtual IP pool to be used for asynchronous replication of block volumes - An asynchronous replication peer for the destination cluster(s) Ensure that the following items are preconfigured on the destination VAST cluster(s): - A replication virtual IP pool to be used for asynchronous replication of block volumes. - To implement single-volume or multi-volume replication: a view with the same subsystem name as the one created on the source cluster. For subsystem-level replication, the destination view will be created automatically on the destination peer(s) based on the subsystem specification in the storage class. Do not create it manually. > **Note:** The preconfiguration steps are performed using VAST Web UI, VAST CLI or VAST REST API as described in the *VAST Cluster Administrator's Guide*. ## Install VAST CSI Replication Operator To install VAST CSI Replication Operator: 1. Add the following to the driver's [Helm chart configuration file](/develop/docs/deploy-vast-csi-driver-2-6#create-helm-chart-configuration-file-for-vast-block-csi-driver) to enable the extensions controller: ``` extensions: enabled: true replication: pvcNameFormat: "{pvc_name}-repl-{endpoint}" pvNameFormat: "{pv_name}-repl-{endpoint}" image: vastExtensionController: repository: vastdataorg/csi tag: dev ``` 2. If you want to use destination PVC/PV naming rules that are different from the default, [adjust](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#name-format-for-destination-pvcs-and-pvs) the `pvcNameFormat` and `pvNameFormat` as needed. 3. [Deploy](/develop/docs/deploy-vast-block-csi-driver-2-6#install-vast-block-csi-driver-helm-chart) the driver with the updated Helm chart. ## Name Format for Destination PVCs and PVs You can specify the name format for the PVCs and PVs created at the destination cluster by adding the `pvcNameFormat` and `pvNameFormat` entries to the driver's Helm chart configuration file (see [install VAST CSI Replication Operator](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#install-vast-csi-replication-operator) above). By default, the following format is used: ``` {pvc_name}-repl-{endpoint} {pv_name}-repl-{endpoint} ``` For example: `myapp-data-repl-16-0-0-2` You can alter the pattern as needed using any of the following: | | | | --- | --- | | `{pvc_name}` | Full name of the source PVC. | | `{pvc_name_suf:<N>}` | Last N characters of the source PVC name. | | `{pvc_name_pref:<N>}` | First N characters of the source PVC name. | | `{pv_name}` | Full name of the source PV. | | `{pv_name_suf:<N>}` | Last N characters of the source PV name. | | `{pv_name_pref:<N>}` | First N characters of the source PV name. | | `{endpoint}` | VAST cluster endpoint IP where the dots are replaced with hyphens. | | `{sc_name}` | The name of the destination storage class. | | `{sc_name_suf:<N>}` | Last N characters of the destination storage class name. | | `{sc_name_pref:<N>}` | First N characters of the destination storage class name. | ## Create Replication CRDs 1. Create either of the CRDs depending on the number of volumes to be replicated: - [VastStorageClassReplication](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#vaststorageclassreplication-crd) (VSCR) to set up replication for all of the volumes created with a particular storage class. With this CRD, the operator waits at least one replication cycle before creating the PVC on each destination cluster specified in the CRD. - [VastVolumeReplication](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#vastvolumereplication-crd) (VVR) to set up replication for a single volume. With this CRD, the operator creates one `VolumeGroupReplication` and one `VolumeGroupReplicationClass` per storage class specified in the CRD. The PVC on the destination cluster is created without any additional wait time. 2. After the YAML content is created, apply the CRDs with the `kubectl apply` command. ### VastStorageClassReplication CRD The `VastStorageClassReplication` CRD sets up replication for all volumes created with a particular storage class. Below is an example of the CRD used to replicate all volumes created with storage class `vastdata-filesystem1` to destinations controlled with storage classes `vastdata-filesystem2` and `vastdata-filesystem3`. The replicas are created every 15 minutes, with the local snapshots kept for 2 days and the remote snapshots kept for 7 days. > **Note:** For detailed information on each of the parameters, see [Replication CRD Spec Field Reference](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#replication-crd-spec-field-reference). ``` apiVersion: vastdata.com/v1alpha1 kind: VastStorageClassReplication metadata: name: app-replication namespace: default spec: primaryStorageClass: vastdata-filesystem1 protectionTopology: - source: vastdata-filesystem1 destination: vastdata-filesystem2 - source: vastdata-filesystem1 destination: vastdata-filesystem3 - source: vastdata-filesystem2 destination: vastdata-filesystem3 protectionPolicyTemplate: params: - every: 15M keepLocal: 2D keepRemote: 7D failoverType: ungracefulFailover syncIntervalSeconds: 900 syncPVCPV: true pvcRemap: false ``` ### VastVolumeReplication CRD The `VastVolumeReplication` CRD sets up replication for a single volume. It provides the same set of parameters as the `VastStorageClassReplication` CRD, and also the `volumeName` parameter used to identify the replicated volume. > **Note:** For detailed information on each of the parameters, see [Replication CRD Spec Field Reference](/develop/docs/replicate-block-volumes-with-vast-csi-replication-operator-2-6#replication-crd-spec-field-reference). Below is an example of the CRD used to replicate all volumes created with storage class `vastdata-filesystem1` to destinations controlled with storage classes `vastdata-filesystem2`. The replicas are created every hour, with the local snapshots kept for 3 weeks and the remote snapshots kept for 4 weeks. ``` apiVersion: vastdata.com/v1alpha1 kind: VastVolumeReplication metadata: name: app-replication namespace: default spec: volumeName: myapp-data primaryStorageClass: vastdata-filesystem1 protectionTopology: - source: vastdata-filesystem1 destination: vastdata-filesystem2 protectionPolicyTemplate: params: - every: 1H keepLocal: 3W keepRemote: 4w failoverType: gracefulFailover syncIntervalSeconds: 900 syncPVCPV: true pvcRemap: false ``` ### Replication CRD Spec Field Reference The `spec` section of the `VastVolumeReplication` and/or `VastStorageClassReplication` CRD can contain the following fields: #### failoverType Determines the failover type. Valid values: - `ungracefulFailover` - `gracefulFailover` For an explanation of each of the failover types, see *VAST Cluster Administrator's Guide*. Syntax: ``` failoverType: ``` #### primaryStorageClass The name of the storage class that creates volumes to be replicated (initially on the source VAST cluster). Syntax: ``` primaryStorageClass: ``` #### protectionPolicyTemplate Sets one or more replication schedules. Syntax: ``` protectionPolicyTemplate: params: - every: