Backport/2.7/47621 (#48129)
* NetApp bugfix for na_ontap_snapmirror (#47621)
* Bug fixes for Snapmirror
* Bug fixes for Snapmirror
(cherry picked from commit 8f3e297d7d
)
* add fragment
This commit is contained in:
parent
23851bc8fe
commit
12271999e2
2 changed files with 18 additions and 7 deletions
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- Fixes issues with source and destination location for na_ontap_snapmirror
|
|
@ -13,7 +13,8 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
author: NetApp Ansible Team (ng-ansibleteam@netapp.com)
|
author: NetApp Ansible Team (ng-ansibleteam@netapp.com)
|
||||||
description:
|
description:
|
||||||
- Create/Delete/Initialize/Modify SnapMirror volume/vserver relationships
|
- Create/Delete/Initialize SnapMirror volume/vserver relationships
|
||||||
|
- Modify schedule for a SnapMirror relationship
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- netapp.na_ontap
|
- netapp.na_ontap
|
||||||
module: na_ontap_snapmirror
|
module: na_ontap_snapmirror
|
||||||
|
@ -83,6 +84,7 @@ EXAMPLES = """
|
||||||
na_ontap_snapmirror:
|
na_ontap_snapmirror:
|
||||||
state: absent
|
state: absent
|
||||||
destination_path: <path>
|
destination_path: <path>
|
||||||
|
source_hostname: "{{ source_hostname }}"
|
||||||
hostname: "{{ netapp_hostname }}"
|
hostname: "{{ netapp_hostname }}"
|
||||||
username: "{{ netapp_username }}"
|
username: "{{ netapp_username }}"
|
||||||
password: "{{ netapp_password }}"
|
password: "{{ netapp_password }}"
|
||||||
|
@ -222,18 +224,21 @@ class NetAppONTAPSnapmirror(object):
|
||||||
Delete a SnapMirror relationship
|
Delete a SnapMirror relationship
|
||||||
#1. Quiesce the SnapMirror relationship at destination
|
#1. Quiesce the SnapMirror relationship at destination
|
||||||
#2. Break the SnapMirror relationship at the source
|
#2. Break the SnapMirror relationship at the source
|
||||||
#3. Release the SnapMirror at destination
|
#3. Release the SnapMirror at source
|
||||||
#4. Delete SnapMirror at destination
|
#4. Delete SnapMirror at destination
|
||||||
"""
|
"""
|
||||||
if not self.parameters.get('source_hostname'):
|
if not self.parameters.get('source_hostname'):
|
||||||
self.module.fail_json(msg='Missing parameters for delete: Please specify the '
|
self.module.fail_json(msg='Missing parameters for delete: Please specify the '
|
||||||
'source cluster to release the SnapMirror relation')
|
'source cluster hostname to release the SnapMirror relation')
|
||||||
if self.parameters.get('source_username'):
|
if self.parameters.get('source_username'):
|
||||||
self.module.params['username'] = self.parameters['dest_username']
|
self.module.params['username'] = self.parameters['source_username']
|
||||||
if self.parameters.get('source_password'):
|
if self.parameters.get('source_password'):
|
||||||
self.module.params['password'] = self.parameters['dest_password']
|
self.module.params['password'] = self.parameters['source_password']
|
||||||
|
self.module.params['hostname'] = self.parameters['source_hostname']
|
||||||
self.source_server = netapp_utils.setup_ontap_zapi(module=self.module)
|
self.source_server = netapp_utils.setup_ontap_zapi(module=self.module)
|
||||||
self.snapmirror_quiesce()
|
self.snapmirror_quiesce()
|
||||||
|
if self.parameters.get('relationship_type') and \
|
||||||
|
self.parameters.get('relationship_type') not in ['load_sharing', 'vault']:
|
||||||
self.snapmirror_break()
|
self.snapmirror_break()
|
||||||
if self.get_destination():
|
if self.get_destination():
|
||||||
self.snapmirror_release()
|
self.snapmirror_release()
|
||||||
|
@ -325,6 +330,8 @@ class NetAppONTAPSnapmirror(object):
|
||||||
initialize_zapi = 'snapmirror-initialize'
|
initialize_zapi = 'snapmirror-initialize'
|
||||||
if self.parameters.get('relationship_type') and self.parameters['relationship_type'] == 'load_sharing':
|
if self.parameters.get('relationship_type') and self.parameters['relationship_type'] == 'load_sharing':
|
||||||
initialize_zapi = 'snapmirror-initialize-ls-set'
|
initialize_zapi = 'snapmirror-initialize-ls-set'
|
||||||
|
options = {'source-location': self.parameters['source_path']}
|
||||||
|
else:
|
||||||
options = {'destination-location': self.parameters['destination_path']}
|
options = {'destination-location': self.parameters['destination_path']}
|
||||||
snapmirror_init = netapp_utils.zapi.NaElement.create_node_with_children(
|
snapmirror_init = netapp_utils.zapi.NaElement.create_node_with_children(
|
||||||
initialize_zapi, **options)
|
initialize_zapi, **options)
|
||||||
|
@ -411,6 +418,7 @@ class NetAppONTAPSnapmirror(object):
|
||||||
current = self.snapmirror_get()
|
current = self.snapmirror_get()
|
||||||
cd_action = self.na_helper.get_cd_action(current, self.parameters)
|
cd_action = self.na_helper.get_cd_action(current, self.parameters)
|
||||||
modify = self.na_helper.get_modified_attributes(current, self.parameters)
|
modify = self.na_helper.get_modified_attributes(current, self.parameters)
|
||||||
|
|
||||||
if cd_action == 'create':
|
if cd_action == 'create':
|
||||||
self.snapmirror_create()
|
self.snapmirror_create()
|
||||||
elif cd_action == 'delete':
|
elif cd_action == 'delete':
|
||||||
|
|
Loading…
Reference in a new issue