| 1 |
# Automated Migration of HyperSwap Volumes to Policy-Based High Availability (PBHA) |
| 2 |
|
| 3 |
This directory contains an Ansible playbook for automating the migration of HyperSwap volumes to Policy-Based High Availability (PBHA). The solution aims to simplify the migration process while ensuring data availability and minimal downtime. |
| 4 |
|
| 5 |
# Table of Contents |
| 6 |
|
| 7 |
- [Overview](#overview) |
| 8 |
- [Prerequisites](#prerequisites) |
| 9 |
- [Playbooks](#playbooks) |
| 10 |
- [Variables](#variables) |
| 11 |
- [Migration Steps](#migration-steps) |
| 12 |
- [Logs and Output](#logs-and-output) |
| 13 |
|
| 14 |
# Overview |
| 15 |
|
| 16 |
This automation simplifies the migration of HyperSwap volumes to PBHA by handling pool mappings, volume relationships, and high availability configurations, ensuring minimal downtime and reliable transition. |
| 17 |
|
| 18 |
# Prerequisites |
| 19 |
|
| 20 |
- IBM Storage Virtualize ansible collection plugins must be installed. |
| 21 |
- Both primary and secondary clusters must be on a PBHA-supported SVC level. Supported SVC levels are: 8.6.0.X & 8.7.0.X |
| 22 |
|
| 23 |
# Playbooks |
| 24 |
|
| 25 |
Migrating HyperSwap to PBHA can be achieved using 2 executable playbooks: |
| 26 |
1. migrate_dependent_volumes.yaml :- |
| 27 |
- Migrates non-HyperSwap (standard) volumes of the site to be removed (e.g. site2) to a pool at the retained site (e.g. site1). |
| 28 |
- Removes the auxiliary copies of HyperSwap volumes. |
| 29 |
> [!WARNING] |
| 30 |
> After executing this playbook, a HyperSwap volumes file (`Hyperswap_volumes_of_<system_name>.json`) is created. **DO NOT REMOVE THIS FILE** as it is required for subsequent steps. |
| 31 |
|
| 32 |
2. migrate_hyperswap_to_pbha.yaml :- |
| 33 |
- Changes topology from HyperSwap to standard volumes. |
| 34 |
- Creates a cluster partnership and links pools between clusters. |
| 35 |
- Migrates HyperSwap volumes to PBHA partitions. |
| 36 |
|
| 37 |
> [!IMPORTANT] |
| 38 |
> This playbook requires the `HyperSwap_volumes_of_<system_name>.json` file generated by the first playbook. |
| 39 |
|
| 40 |
These playbooks can be found in the repository as - |
| 41 |
``` |
| 42 |
ibm.storage_virtualize |
| 43 |
│ |
| 44 |
└─playbooks |
| 45 |
│ |
| 46 |
└─hyperswap_to_pbha_migration |
| 47 |
│ |
| 48 |
└─migrate_dependent_volumes.yaml |
| 49 |
└─migrate_hyperswap_to_pbha.yaml |
| 50 |
└─inventory.ini |
| 51 |
└─README.md |
| 52 |
└─... |
| 53 |
... |
| 54 |
``` |
| 55 |
|
| 56 |
# Variables |
| 57 |
|
| 58 |
| Variable | Required | Default | Notes | |
| 59 |
|----------------------------------|----------|----------------------------|-----------------------------------------------------------------------------------------------------------------------| |
| 60 |
| primary_clustername | yes | X | Cluster name of the primary system. | |
| 61 |
| primary_cluster_username | yes | X | Username for authentication on the primary system. | |
| 62 |
| primary_cluster_password | yes | X | Password for authentication on the primary system. | |
| 63 |
| target_pool | yes | X | Name of the pool to which the volumes from the site being removed will be migrates. | |
| 64 |
| site_to_retain | no | site1 | Name of the site to be retained during migration. | |
| 65 |
| site_to_remove | no | site2 | Name of the site to be removed during migration. | |
| 66 |
| secondary_clustername | yes | X | Cluster name of the auxiliary (secondary) system. | |
| 67 |
| secondary_cluster_username | yes | X | Username for authentication on the auxiliary system. | |
| 68 |
| secondary_cluster_password | yes | X | Password for authentication on the auxiliary system. | |
| 69 |
| drive_counts | yes | X | Array containing the count of drives in each pool, used for validation.For e.g., for 2 pools, the required format is [X, X].| |
| 70 |
| volume_group_name | no | ha_volume_grp | Name of the volume group to be created or used. | |
| 71 |
| location_1_iogrp | no | 0 | ID of the IO Group on the primary cluster for replication policy. | |
| 72 |
| location_2_iogrp | no | 0 | ID of the IO Group on the secondary cluster for replication policy. | |
| 73 |
| ha_replication_policy_name | no | ha_rep_policy_0 | Name of the High availability replication policy to be created or applied. | |
| 74 |
| ha_partition_name | no | ha_partition | Name of the partition to be created or used for PBHA. | |
| 75 |
| partnership_type | yes | X | Type of partnership between clusters. Options are `fc` or `rdma`(Remote Direct Memory Access). | |
| 76 |
| truststore_name | no | ts_0 | Name of the truststore to be created or managed. | |
| 77 |
| linkbandwidth_mbits | no | 8000 | Maximum link bandwidth (in Mbps) for replication between clusters. | |
| 78 |
| background_copyrate | no | 50 | Background copy rate (in percentage) during the migration. | |
| 79 |
| portset_name | no | hse1 | Name of the RDMA port set to be used. *(Required for `rdma` partnership)* | |
| 80 |
| ip_for_primary_cluster | yes | X | IP address of the primary cluster. *(Required for `rdma` partnership)* | |
| 81 |
| primary_cluster_node_name | yes | X | Node name of the primary cluster . *(Required for `rdma` partnership)* | |
| 82 |
| primary_cluster_port_id | yes | X | Port ID on the primary cluster . *(Required for `rdma` partnership)* | |
| 83 |
| primary_cluster_subnet_prefix | yes | X | Subnet prefix for the primary cluster . *(Required for `rdma` partnership)* | |
| 84 |
| ip_for_secondary_cluster | yes | X | IP address of the secondary cluster . *(Required for `rdma` partnership)* | |
| 85 |
| secondary_cluster_node_name | yes | X | Node name of the secondary cluster . *(Required for `rdma` partnership)* | |
| 86 |
| secondary_cluster_port_id | yes | X | Port ID on the secondary cluster . *(Required for `rdma` partnership)* | |
| 87 |
| secondary_cluster_subnet_prefix | yes | X | Subnet prefix for the secondary cluster . *(Required for `rdma` partnership)* | |
| 88 |
| rdma_partnership_type | no | ipv4 | Type of IP protocol used (e.g., ipv4 or ipv6). *(Required for `rdma` partnership)* | |
| 89 |
|
| 90 |
**Example inventory.ini File** |
| 91 |
Here is an example inventory.ini file that demonstrates how to configure the variables: |
| 92 |
``` |
| 93 |
primary_clustername: x.x.x.x |
| 94 |
primary_cluster_username: superuser |
| 95 |
primary_cluster_password: passw0rd |
| 96 |
target_pool: pool_0 |
| 97 |
site_to_retain: site1 |
| 98 |
site_to_remove: site2 |
| 99 |
secondary_clustername: y.y.y.y |
| 100 |
secondary_cluster_username: superuser |
| 101 |
secondary_cluster_password: passw0rd |
| 102 |
drive_counts: [2, 2, 2] |
| 103 |
volume_group_name: HA_Vol_Grp_0 |
| 104 |
location_1_iogrp: 0 |
| 105 |
location_2_iogrp: 0 |
| 106 |
ha_replication_policy_name: HA_policy_0 |
| 107 |
ha_partition_name: HA_Partition_0 |
| 108 |
partnership_type: fc |
| 109 |
truststore_name: ts_0 |
| 110 |
linkbandwidth_mbits: 10000 |
| 111 |
background_copyrate: 50 |
| 112 |
|
| 113 |
# Required only for RDMA partnership |
| 114 |
portset_name: test_hse |
| 115 |
ip_for_primary_cluster: a.a.a.a |
| 116 |
primary_cluster_node_name: node1 |
| 117 |
primary_cluster_port_id: 7 |
| 118 |
primary_cluster_subnet_prefix: 24 |
| 119 |
ip_for_secondary_cluster: b.b.b.b |
| 120 |
secondary_cluster_node_name: node1 |
| 121 |
secondary_cluster_port_id: 7 |
| 122 |
secondary_cluster_subnet_prefix: 24 |
| 123 |
rdma_partnership_type: ipv4 |
| 124 |
``` |
| 125 |
|
| 126 |
# Migration Steps |
| 127 |
|
| 128 |
### migrate_dependent_volumes.yml |
| 129 |
Tasks performed via this playbook: |
| 130 |
- Verify that the target pool exists and is compatible. |
| 131 |
- Migrate volumes to the target pool. |
| 132 |
- Save information about the HyperSwap volumes for use in subsequent tasks. |
| 133 |
- Remove the auxiliary volume copy after the migration. |
| 134 |
- Free up secondary site's space by removing unused pool. |
| 135 |
|
| 136 |
> [!IMPORTANT] |
| 137 |
> After completing these steps, the user must remove site2 nodes from cluster, create a new cluster with these nodes, and update the inventory with the new cluster details. |
| 138 |
|
| 139 |
### migrate_hyperswap_to_pbha.yml |
| 140 |
Tasks performed via this playbook: |
| 141 |
- Change topology from HyperSwap to standard. |
| 142 |
- Create a partnership between clusters. |
| 143 |
- Create new pool(s) on the secondary cluster and link it with the corresponding pool on primary cluster. |
| 144 |
- Create a volume group and add the HyperSwap volumes to it. |
| 145 |
- Create a partition, add volume group(s) to it, publish it and make it highly available by assigning HA replication policy. |
| 146 |
|
| 147 |
> [!NOTE] |
| 148 |
> After successfully executing the playbook, the quorum application will be ready for use. Please copy it to the any host. This may need to be run later in case of broken quorum. Please make sure the host has Java Runtime Environment (JRE) installed, as it is required to run the application. |
| 149 |
|
| 150 |
# Logs and Output |
| 151 |
|
| 152 |
- **Log File**: `HyperSwap_PBHA_migration_of_<system1>_and_<system2>.log` contains detailed information about the migration process. |
| 153 |
- **JSON File:** `HyperSwap_volumes_of_<system_name>.json` required for subsequent steps. Do not delete unless the migration process is complete. |
| 154 |
|
| 155 |
# Authors: |
| 156 |
|
| 157 |
- Sumit Kumar Gupta ([email protected]) |
| 158 |
- Aditya Bhosale ([email protected]) |