| 1 |
# Playbook to Setup Policy-Based Replication (PBR) |
| 2 |
|
| 3 |
## Table of Contents |
| 4 |
- [Objective](#objective) |
| 5 |
- [Prerequisites](#prerequisites) |
| 6 |
- [Tasks Performed](#tasks-performed) |
| 7 |
- [Playbooks Overview](#playbooks-overview) |
| 8 |
- [Variables](#variables) |
| 9 |
|
| 10 |
## Objective |
| 11 |
|
| 12 |
- Set up mTLS and configure Policy Based Replication between 2 FlashSystems. |
| 13 |
|
| 14 |
## Prerequisites |
| 15 |
|
| 16 |
- IBM Storage Virtualize ansible collection plugins must be installed. |
| 17 |
- FC or IP partnership must be present between the clusters. |
| 18 |
- Host must be present on primary cluster. |
| 19 |
|
| 20 |
## Tasks Performed |
| 21 |
|
| 22 |
- These playbooks set up mTLS and configure Policy Based Replication between a primary cluster and the secondary cluster. |
| 23 |
- These playbook is designed to set up mTLS on both the site and configure Policy Based Replication between source cluster to destination cluster. This is designed in a way that it creates Data Reduction Pool, links them, creates provision policy and replication policy. |
| 24 |
- These playbooks also creates multiple Volumes with specified prefix along with volume group and maps all of them to the specified host. |
| 25 |
|
| 26 |
## Playbooks Overview |
| 27 |
|
| 28 |
### 1. main.yml: |
| 29 |
- This is the main file to be executed using: `ansible-playbook main.yml` |
| 30 |
- It leverages other files for PBR configuration. It executes `create_mTLS.yml` and `drp_pool_setup.yml` and then creates volume group and associated volumes with volume_prefix name, specified in `pbr_inventory.ini`. It also maps all the volumes to specified host. |
| 31 |
- Any additional volumes that need to be added to volumegroup, and/or need to be mapped to existing host object (but were not part of volumegroup at the time of execution of the playbook), can be added to inventory file. They'll be added to volumegroup and mapped to host in subsequent execution of the playbook. |
| 32 |
|
| 33 |
### 2. create_mTLS.yml: |
| 34 |
- This playbook sets Mutual Transport Layer Security (mTLS) which includes exporting certificates and creating truststore on both clusters. |
| 35 |
|
| 36 |
### 3. drp_pool_setup.yml: |
| 37 |
- This playbook checks the drive status and drive count. Based on this drive info, it creates mdiskgrp, and data reduction pool with specified level. It links pools of both the sites. Then, it creates provisioning policy and replication policy. Already exiting mdiskgrps (pools) can also be used, only mention name of desired pool in `pbr_inventory.ini`. |
| 38 |
- If user wants to decide drives to be used in pool before running the playbook, he can create a pool and add drives to it (example below): |
| 39 |
- Create a pool: |
| 40 |
```sh |
| 41 |
mkmdiskgrp -unit mb -datareduction yes -easytier auto -encrypt no -ext 1024 -gui -guiid 0 -name mdg0-warning 80% |
| 42 |
``` |
| 43 |
- Assign first 2 disks (via drivecount parameter) to pool: |
| 44 |
```sh |
| 45 |
svctask mkdistributedarray -level raid1 -driveclass 0 -drivecount 2 mdg0 (used drive 0 and drive 1) |
| 46 |
``` |
| 47 |
|
| 48 |
## Variables |
| 49 |
|
| 50 |
### These variables should be defined in your pbr_inventory.ini file, |
| 51 |
|
| 52 |
| Parameter | Description | |
| 53 |
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------| |
| 54 |
| `clusters_data` | Contains primary cluster details (source of replication) and secondary cluster details (target for volume replication). | |
| 55 |
| `host_name` | Host name to which all volumes should be mapped after creation. Assumes the host already exists on the primary cluster. | |
| 56 |
| `volume_size` | Size of each volume to be created. | |
| 57 |
| `volume_prefix` | Prefix for naming volumes (e.g., `vol_` results in `vol_1`, `vol_2`, etc.). | |
| 58 |
| `volume_group_name` | Name of the volume group under which all created volumes will be grouped. | |
| 59 |
| `number_of_volumes` | Number of volumes to be created between clusters. | |
| 60 |
| `log_path` | Specifies the log path for the playbook. Defaults to `/tmp/ansiblePB.debug` if not provided. | |
| 61 |
|
| 62 |
## Authors |
| 63 |
|
| 64 |
- Akshada Thorat ([email protected]) |
| 65 |
- Sandip Rajbanshi ([email protected]) |
| 66 |
- Lavanya C R ([email protected]) |