Introduction: Ansible is an open-source automation tool that makes smooth IT tasks like application deployment, cloud provisioning, and system configuration. As it operates without requiring any agents, that’s making it lightweight and easy to use. Ansible uses playbooks, written in YAML, to define automation tasks in a human-readable format and reduces complexity. Hitachi VSP One Block Storage Modules provides a comprehensive set of Ansible modules for managing Hitachi VSP One series systems. Ansible Playbooks provides a simple, repeatable, and automated way to manage IT infrastructure and applications.
Hitachi TrueCopy using Ansible: Hitachi TrueCopy provides a continues, non-disruptive remote data replication solution where organizations can create mirror images of production data at remote location. TrueCopy pair consists of P-VOL from Primary storage and a S-VOL from secondary storage. When the primary storage accepts a write operation for a P-VOL, the data is written on the primary volume and then sent by the primary storage system to the secondary storage system through the dedicated remote connections. Here we have discussed about the TrueCopy pair create using ansible.
Environment:
Hitachi TrueCopy pair creation using Ansible is tested with the help of following components:
- A Server DL380G10 having VMware 8U3 Installed with client server RHEL 8.10 to install the Ansible tool. It’s recommended to use CPU/vCPU – 2, Memory - 4 GB & HardDisk - 30 GB for client server configuration.
- Two VSP One Block storage as Primary & Secondary Storage.
- Two Brocade G710 SAN Switches and One Brocade 6510 SAN Switch.
- A Server DL380G10 with installed RHEL 9.3 for TrueCopy host side configuration.
Diagram Layout:
The following image shows the setup diagram of Hitachi TrueCopy creation using Ansible tool.

Figure1: Setup Diagram for Hitachi TrueCopy using Ansible tool
Configuration steps:
1. Install VMware 8U3 in Server DL380G10 and configure a client with RHEL 8.10 and install Ansible available on galaxy. You can find the related information here https://github.com/hitachi-vantara/vspone-block-ansible:
[root@control-node ~]# ansible-galaxy collection install hitachivantara.vspone_block:==3.4.2
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/hitachivantara-vspone_block-3.4.2.tar.gz to /root/.ansible/tmp/ansible-local-105094929qhqgu8/tmp47xlrpl5/hitachivantara-vspone_block-3.4.2-i0ydqjb8
Installing 'hitachivantara.vspone_block:3.4.2' to '/root/.ansible/collections/ansible_collections/hitachivantara/vspone_block'
hitachivantara.vspone_block:3.4.2 was installed successfully
[root@control-node ~]#
Now go inside the vsp_direct under playbook directory and you can find different VSP Ansible modules with different playbooks for various type of functions.
2. Make sure the client server (Ansible), Primary storage and secondary storage should be in same network to communicate each other properly.
3. After installing ansible, change the file “ansible_vault_storage_var.yml” inside directory “/root/.ansible/collections/ansible_collections/hitachivantara/vspone_block/playbooks/ansible_vault_vars” with the details of your primary and secondary storage. You can refer the below sample file here:
[root@control-node ansible_vault_vars]# cat ansible_vault_storage_var.yml
---
…………..
storage_serial: 8XXXX3 # Example: 8XXXX5
storage_address: 172.XX.XX.XX # Example: storage1.company.com or sds1.company.com or 10.10.10.10
vault_storage_username: xxxxxxxxxxxx
vault_storage_secret: xxxxxxxxxxxxxx
secondary_storage_serial: 8XXXX5
secondary_storage_address: 172.XX.XX.XX # Example: storage1.company.com or sds1.company.com or 10.10.10.10
vault_secondary_storage_username: xxxxxxxxxxxx
vault_secondary_storage_secret: xxxxxxxxxxxxx
[root@control-node ansible_vault_vars]#
Yellow marked parameters need to change.
4. Do the connectivity between VSP One Block primary storage and secondary storage as per the above diagram.
5. Configure the cascade between Brocade G710 switches.
6. Now you can change storage ports parameters as per your requirements using ansible playbooks. Here you can use several Storage Port Module playbooks to change storage port parameter types:
Port speed and security: Change storage port speed, security setting of the storage port by port id using playbook “port_speed_security.yml”. You can change port security to enable or disable.
Port mode: You can Change port mode setting of the storage port by port id as "FC-NVMe" or "FCP-SCSI" using playbook “port_mode.yml”.
Port connection type: You can change fabric mode and port connection settings of the storage port by port id as "FCAL", "P2P", "PtoP" and fabric mode true or false using playbook “port_connection_type.yml”.
Here a sample playbook file “port_speed_security.yml” and function displayed here to change port speed and security:
[root@control-node upload_playbook]# cat port_speed_security.yml
---
####################################################################
# Example : Storage Port Playbook
####################################################################
- name: Storage Port Module
hosts: localhost
gather_facts: false
vars_files:
- ../ansible_vault_vars/ansible_vault_storage_var.yml
vars:
# Common connection info for all tasks
connection_info:
address: "{{ storage_address }}"
username: "{{ vault_storage_username }}"
password: "{{ vault_storage_secret }}"
tasks:
###########################################################################################
# Task Name : Change port speed and port security settings of the storage port by port id
###########################################################################################
- name: Change port speed and port security settings of the storage port by port id
hitachivantara.vspone_block.vsp.hv_storage_port:
connection_info: "{{ connection_info }}"
spec:
port: "CL8-C"
port_speed: "AUT" # Options: "AUT", "nG" - where n is a number and G can be omitted
enable_port_security: true
register: result
- name: Debug the result variable
ansible.builtin.debug:
var: result
[root@control-node upload_playbook]#

Using these ansible playbook you can change your storage port settings according to your setup before starting configurations in SAN switch.
7. Now make the SAN zoning properly between primary and secondary storage for remote path connections in Switch Brocade G710 and create Remote Connection using Ansible playbook “remote_path_create.yml” as below:

8. Create a DP Pool and create virtual volume using ansible playbook. You can see the below sample to create DP Pool using playbook “storage_pool_create.yml”:

Create a virtual volume from a DP Pool with playbook “ldev_create_using_pool_id.yml” as below:

9. Create zoning properly in SAN switch connected with host and both storages.
10. Create host group and map the Ldev using ansible playbook “hostgroup_create.yml” . You can refer to the sample output:

11. Detect the Ldev in host, create file system and run application. After running IO for around 30 mins, stop IO.
12. Create TrueCopy pair using Ansible playbook by specifying the required fields. You can see a sample playbook to create truecopy pair.
[root@Control-Node-new vsp_direct]# cat truecopy_PAIR_create.yml
---
####################################################################
# Example : TrueCopy Playbook
####################################################################
- name: TrueCopy pair operations module
hosts: localhost
gather_facts: false
vars_files:
- ../ansible_vault_vars/ansible_vault_storage_var.yml
vars:
# Common connection info for all tasks
connection_info:
address: "{{ storage_address }}"
username: "{{ vault_storage_username }}"
password: "{{ vault_storage_secret }}"
secondary_connection_info:
address: "{{ secondary_storage_address }}"
username: "{{ vault_secondary_storage_username }}"
password: "{{ vault_secondary_storage_secret }}"
tasks:
#####################################################################
# Task 2 : Create a TrueCopy pair by specifying all the fields
#####################################################################
- name: Create TrueCopy pair
hitachivantara.vspone_block.vsp.hv_truecopy:
connection_info: "{{ connection_info }}"
secondary_connection_info: "{{ secondary_connection_info }}"
state: "present"
spec:
copy_group_name: "tc-copy-group-3"
copy_pair_name: "tc-copy-pair-3"
primary_volume_id: 275
secondary_pool_id: 17
secondary_hostgroup:
name: "tc-ansible-hg"
port: "CL3-A"
fence_level: "NEVER"
path_group_id: 1
local_device_group_name: "ansible-local-device-group-3"
remote_device_group_name: "ansible-remote-device-group-3"
is_consistency_group: true
consistency_group_id: 0
do_initial_copy: true
copy_pace: "MEDIUM"
is_data_reduction_force_copy: false
register: result
- name: Debug the result variable
ansible.builtin.debug:
var: result
[root@Control-Node-new vsp_direct]#
TrueCopy create using playbook “truecopy_PAIR_create.yml” sample output:

13. You can perform pair split, pai resync and pair delete operations using ansible playbook by simply just changing the specified fields. Here you can see the pair split, pair resync and pair delete operations sample output:
Pair Split operation using playbook “truecopy_split.yml”:

Pair resync operations using playbook “truecopy_resync.yml”:

Pair delete operation using playbook “truecopy_PAIR_delete.yml”:

Troubleshooting procedure: For any error you observed during the playbook operations, check the file $HOME/logs/hitachivantara/ansible/vspone_block/hv_vspone_block_modules.log in Ansible host.
References: The following URL provides additional information on Ansible:
https://github.com/hitachi-vantara/vspone-block-ansible?tab=readme-ov-file
https://github.com/hitachi-vantara/vspone-block-ansible/blob/main/docs/MODULES.md
https://github.com/hitachi-vantara/hv-playbooks-vspone-block