#LS mirror volume creation

1 messages · Page 1 of 1 (latest)

lament geyser
#

I have a playbook to create a load-sharing mirror volume for each SVM. it then creates the LS mirror relationship and initialises the mirror.

The volume is created as DP just like regular snapmirror but once initialised as a LS mirror the volume type changes to 'ls'

When re-running the playbook it errors as the volume type doesnt match. I can set ignore_errors but is there any other way to prevent this from erroring out?

error below:
"msg": "Error: changing a volume from one type to another is not allowed. Current: ls, desired: dp."}

playbook:
- name: Create LS mirror FlexVols
na_ontap_volume:
use_rest: always
state: present
name: "{{ item.vserver + '_ls' }}"
aggregate_name: "{{ item.ls_aggr }}"
size: 1
size_unit: gb
space_guarantee: volume
tiering_policy: none
vserver: "{{ item.vserver }}"
type: dp
wait_for_completion: True
comment: load-sharing mirror destination
<<: *login
with_items: "{{ nas_svm_config }}"
- name: create LS mirror for NAS SVMs
netapp.ontap.na_ontap_snapmirror:
state: present
source_vserver: "{{ item.vserver }}"
source_volume: "{{ item.vserver + '_root' }}"
destination_vserver: "{{ item.vserver }}"
destination_volume: "{{ item.vserver + '_ls' }}"
initialize: true
relationship_type: load_sharing
schedule: ls_mirror_15min
<<: *login
with_items: "{{ nas_svm_config }}"

#

I also notice that load-sharing mirror type is not supported on REST. is there plans to add this support in future? [WARNING]: Falling back to ZAPI because of unsupported option(s) or option value(s) in REST: ['schedule', 'relationship_type']

novel trail
#

ignore_errors is one way or we can define task failure using failed_when

- name: Create LS mirror FlexVols na_ontap_volume: use_rest: always state: present name: "{{ item.vserver + '_ls' }}" aggregate_name: "{{ item.ls_aggr }}" size: 1 size_unit: gb space_guarantee: volume tiering_policy: none vserver: "{{ item.vserver }}" type: dp wait_for_completion: True comment: load-sharing mirror destination register: result failed_when: "'Error: changing a volume from one type to another is not allowed' not in result.msg"

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_error_handling.html#defining-failure

#

this returns ok if try to modify volume type.

lament geyser
#

thanks Mohan ill give it a try