Skip to content

Commit

Permalink
[replication] Added Unity replication section (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
IliaRN authored Aug 11, 2022
1 parent bb88ba6 commit a5d5f98
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 12 deletions.
3 changes: 2 additions & 1 deletion content/docs/replication/deployment/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ The following CSI drivers support replication:
1. CSI driver for PowerMax
2. CSI driver for PowerStore
3. CSI driver for PowerScale
4. CSI driver for Unity XT

Please follow the steps outlined in [PowerMax](../powermax), [PowerStore](../powerstore) or [PowerScale](../powerscale) pages during the driver installation.
Please follow the steps outlined in [PowerMax](../powermax), [PowerStore](../powerstore), [PowerScale](../powerscale) or [Unity](../unity) pages during the driver installation.

>Note: Please ensure that replication CRDs are installed in the clusters where you are installing the CSI drivers. These CRDs are generally installed as part of the CSM Replication controller installation process.
Expand Down
2 changes: 1 addition & 1 deletion content/docs/replication/deployment/storageclasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This should contain the name of the storage class on the remote cluster which is
>Note: You still need to create a pair of storage classes even while using a single stretched cluster

### Driver specific parameters
Please refer to the driver specific sections for [PowerMax](../powermax/#creating-storage-classes), [PowerStore](../powerstore/#creating-storage-classes) or [PowerScale](../powerscale/#creating-storage-classes) for a detailed list of parameters.
Please refer to the driver specific sections for [PowerMax](../powermax/#creating-storage-classes), [PowerStore](../powerstore/#creating-storage-classes), [PowerScale](../powerscale/#creating-storage-classes) or [Unity](../unity/#creating-storage-classes) for a detailed list of parameters.

### PV sync Deletion

Expand Down
178 changes: 178 additions & 0 deletions content/docs/replication/deployment/unity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---
title: Unity
linktitle: Unity
weight: 7
description: >
Enabling Replication feature for CSI Unity
---
## Enabling Replication in CSI Unity

Container Storage Modules (CSM) Replication sidecar is a helper container that is installed alongside a CSI driver to facilitate replication functionality. Such CSI drivers must implement `dell-csi-extensions` calls.

CSI driver for Dell Unity supports necessary extension calls from `dell-csi-extensions`. To be able to provision replicated volumes you would need to do the steps described in these sections.

### Before Installation

#### On Storage Array
Be sure to configure replication between multiple Unity instances using instructions provided by
Unity storage.


#### In Kubernetes
Ensure you installed CRDs and replication controller in your clusters.

To verify you have everything in order you can execute these commands:

* Check controller pods
```shell
kubectl get pods -n dell-replication-controller
```
Pods should be `READY` and `RUNNING`
* Check that controller config map is properly populated
```shell
kubectl get cm -n dell-replication-controller dell-replication-controller-config -o yaml
```
`data` field should be properly populated with cluster-id of your choosing and, if using multi-cluster
installation, your `targets:` parameter should be populated by a list of target clusters IDs.


If you don't have something installed or something is out-of-place, please refer to installation instructions in [installation-repctl](../install-repctl) or [installation](../installation).
### Installing Driver With Replication Module
To install the driver with replication enabled, you need to ensure you have set
helm parameter `controller.replication.enabled` in your copy of example `values.yaml` file
(usually called `my-unity-settings.yaml`, `myvalues.yaml` etc.).
Here is an example of what that would look like:
```yaml
...
# controller: configure controller specific parameters
controller:
...
# replication: allows to configure replication
replication:
enabled: true
image: dellemc/dell-csi-replicator:v1.2.0
replicationContextPrefix: "unity"
replicationPrefix: "replication.storage.dell.com"
...
```
You can leave other parameters like `image`, `replicationContextPrefix`, and `replicationPrefix` as they are.
After enabling the replication module, you can continue to install the CSI driver for Unity following the usual installation procedure. Just ensure you've added the necessary array connection information to secret.

> **_NOTE:_** you need to install your driver on ALL clusters where you want to use replication. Both arrays must be accessible from each cluster.


### Creating Storage Classes

To provision replicated volumes, you need to create adequately configured storage classes on both the source and target clusters.

A pair of storage classes on the source, and target clusters would be essentially `mirrored` copies of one another.
You can create them manually or with the help of `repctl`.

#### Manual Storage Class Creation

You can find a sample replication enabled storage class in the driver repository [here](https://github.com/dell/csi-unity/blob/main/samples/storageclass/unity-replication.yaml).

It will look like this:
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: unity-replication
provisioner: csi-unity.dellemc.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
replication.storage.dell.com/isReplicationEnabled: "true"
replication.storage.dell.com/remoteStorageClassName: "unity-replication"
replication.storage.dell.com/remoteClusterID: "target"
replication.storage.dell.com/remoteSystem: "APM000000002"
replication.storage.dell.com/rpo: "5"
replication.storage.dell.com/ignoreNamespaces: "false"
replication.storage.dell.com/volumeGroupPrefix: "csi"
replication.storage.dell.com/remoteStoragePool: pool_002
replication.storage.dell.com/remoteNasServer: nas_124
arrayId: "APM000000001"
protocol: "NFS"
storagePool: pool_001
nasServer: nas_123
```

Let's go through each parameter and what it means:
* `replication.storage.dell.com/isReplicationEnabled` if set to `true`, will mark this storage class as replication enabled,
just leave it as `true`.
* `replication.storage.dell.com/remoteStorageClassName` points to the name of the remote storage class. If you are using replication with the multi-cluster configuration you can make it the same as the current storage class name.
* `replication.storage.dell.com/remoteClusterID` represents the ID of a remote cluster. It is the same id you put in the replication controller config map.
* `replication.storage.dell.com/remoteSystem` is the name of the remote system that should match whatever `clusterName` you called it in `unity-creds` secret.
* `replication.storage.dell.com/rpo` is an acceptable amount of data, which is measured in units of time, that may be lost due to a failure.
* `replication.storage.dell.com/ignoreNamespaces`, if set to `true` Unity driver, it will ignore in what namespace volumes are created and put every volume created using this storage class into a single volume group.
* `replication.storage.dell.com/volumeGroupPrefix` represents what string would be appended to the volume group name to differentiate them.
* `arrayId` is a unique identifier of the storage array you specified in array connection secret.
* `nasServer` id of the Nas server of local array to which the allocated volume will belong.
* `storagePool` is the storage pool of the local array.
After figuring out how storage classes would look, you just need to go and apply them to your Kubernetes clusters with `kubectl`.
#### Storage Class creation with `repctl`
`repctl` can simplify storage class creation by creating a pair of mirrored storage classes in both clusters
(using a single storage class configuration) in one command.
To create storage classes with `repctl` you need to fill up the config with necessary information.
You can find an example [here](https://github.com/dell/csm-replication/blob/main/repctl/examples/unity_example_values.yaml), copy it, and modify it to your needs.
If you open this example you can see a lot of similar fields and parameters you can modify in the storage class.
Let's use the same example from manual installation and see what config would look like:
```yaml
targetClusterID: "cluster-2"
sourceClusterID: "cluster-1"
name: "unity-replication"
driver: "unity"
reclaimPolicy: "Retain"
replicationPrefix: "replication.storage.dell.com"
remoteRetentionPolicy:
RG: "Retain"
PV: "Retain"
parameters:
arrayId:
source: "APM000000001"
target: "APM000000002"
storagePool:
source: pool_123
target: pool_124
rpo: "0"
ignoreNamespaces: "false"
volumeGroupPrefix: "prefix"
protocol: "NFS"
nasServer:
source: nas_123
target: nas_123
```

After preparing the config, you can apply it to both clusters with `repctl`. Before you do this, ensure you've added your clusters to `repctl` via the `add` command.
To create storage classes just run `./repctl create sc --from-config <config-file>` and storage classes would be applied to both clusters.
After creating storage classes you can make sure they are in place by using `./repctl get storageclasses` command.
### Provisioning Replicated Volumes
After installing the driver and creating storage classes, you are good to create volumes using newly
created storage classes.
On your source cluster, create a PersistentVolumeClaim using one of the replication-enabled Storage Classes.
The CSI Unity driver will create a volume on the array, add it to a VolumeGroup and configure replication
using the parameters provided in the replication enabled Storage Class.
### Supported Replication Actions
The CSI Unity driver supports the following list of replication actions:
- FAILOVER_REMOTE
- UNPLANNED_FAILOVER_LOCAL
- REPROTECT_LOCAL
- SUSPEND
- RESUME
- SYNC
20 changes: 10 additions & 10 deletions content/docs/replication/replication-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ For e.g. -
The following table lists details of what actions should be used in different Disaster Recovery workflows & the equivalent operation done on the storage array:

{{<table "table table-striped table-bordered table-sm">}}
| Workflow | Actions | PowerMax | PowerStore | PowerScale |
| ------------------- | ----------------------------------- | --------------------- | -------------------------------------- | ---------------------------------------------- |
| Planned Migration | FAILOVER_LOCAL<br>FAILOVER_REMOTE | symrdf failover -swap | FAILOVER (no REPROTECT after FAILOVER) | allow_writes on target, disable local policy |
| Reprotect | REPROTECT_LOCAL<br>REPROTECT_REMOTE | symrdf resume/est | REPROTECT | enable local policy, disallow_writes on remote |
| Unplanned Migration | UNPLANNED_FAILOVER_LOCAL<br>UNPLANNED_FAILOVER_REMOTE | symrdf failover -force | FAILOVER (at target site) | break association on target |
| Workflow | Actions | PowerMax | PowerStore | PowerScale | Unity |
| ------------------- | ----------------------------------- | --------------------- | -------------------------------------- | ---------------------------------------------- |---------------------------------------|
| Planned Migration | FAILOVER_LOCAL<br>FAILOVER_REMOTE | symrdf failover -swap | FAILOVER (no REPROTECT after FAILOVER) | allow_writes on target, disable local policy | FAILOVER (no REPROTECT after FAILOVER)|
| Reprotect | REPROTECT_LOCAL<br>REPROTECT_REMOTE | symrdf resume/est | REPROTECT | enable local policy, disallow_writes on remote | REPROTECT |
| Unplanned Migration | UNPLANNED_FAILOVER_LOCAL<br>UNPLANNED_FAILOVER_REMOTE | symrdf failover -force | FAILOVER (at target site) | break association on target | FAILOVER (at target site) |
{{</table>}}

### Maintenance Actions
These actions can be run at any site and are used to change the replication link state for maintenance activities.
The following table lists the supported maintenance actions and the equivalent operation done on the storage arrays

{{<table "table table-striped table-bordered table-sm">}}
| Action | Description | PowerMax | PowerStore | PowerScale |
|-----------|--------------------------------------|----------------|------------|----------------------|
| SUSPEND | Temporarily suspend <br> replication | symrdf suspend | PAUSE | disable local policy |
| RESUME | Resume replication | symrdf resume | RESUME | enable local policy |
| SYNC | Synchronize all changes <br> from source to target | symrdf establish | SYNCHRONIZE NOW | start syncIQ job |
| Action | Description | PowerMax | PowerStore | PowerScale | Unity |
|-----------|--------------------------------------|----------------|------------|----------------------|--------|
| SUSPEND | Temporarily suspend <br> replication | symrdf suspend | PAUSE | disable local policy | PAUSE |
| RESUME | Resume replication | symrdf resume | RESUME | enable local policy | RESUME |
| SYNC | Synchronize all changes <br> from source to target | symrdf establish | SYNCHRONIZE NOW | start syncIQ job | SYNC |
{{</table>}}

### How to perform actions
Expand Down

0 comments on commit a5d5f98

Please sign in to comment.