diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py b/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py index 782defd757..60e5c1902c 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/data_motion.py @@ -186,13 +186,14 @@ class DataMotionSession(object): source_share_obj) # 1. Create SnapMirror relationship - # TODO(ameade): Change the schedule from hourly to a config value + config = get_backend_configuration(dest_backend) + schedule = config.netapp_snapmirror_schedule dest_client.create_snapmirror_vol(src_vserver, src_volume_name, dest_vserver, dest_volume_name, relationship_type, - schedule='hourly') + schedule=schedule) # 2. Initialize async transfer of the initial data dest_client.initialize_snapmirror_vol(src_vserver, @@ -475,14 +476,14 @@ class DataMotionSession(object): replica_vserver) # 3. create - # TODO(ameade): Update the schedule if needed. relationship_type = na_utils.get_relationship_type(is_flexgroup) + schedule = replica_config.netapp_snapmirror_schedule replica_client.create_snapmirror_vol(new_src_vserver, new_src_volume_name, replica_vserver, replica_volume_name, relationship_type, - schedule='hourly') + schedule=schedule) # 4. resync replica_client.resync_snapmirror_vol(new_src_vserver, diff --git a/manila/share/drivers/netapp/options.py b/manila/share/drivers/netapp/options.py index ad64dd5a15..4b5a08443b 100644 --- a/manila/share/drivers/netapp/options.py +++ b/manila/share/drivers/netapp/options.py @@ -215,6 +215,14 @@ netapp_data_motion_opts = [ default=3600, # One Hour help='The maximum time in seconds to wait for a snapmirror ' 'release when breaking snapmirror relationships.'), + cfg.StrOpt('netapp_snapmirror_schedule', + default='hourly', # One Hour + help='An interval in either minutes or hours used to update ' + 'the SnapMirror relationship. Few valid values are: ' + '5min, 10min, 30min, hourly etc. The schedule at the ' + '"destination" host will be the one that will be ' + 'considered when creating a new replica, or promoting ' + 'a replica'), cfg.IntOpt('netapp_snapmirror_last_transfer_size_limit', min=512, default=1024, # One MB diff --git a/releasenotes/notes/netapp-add-async-snapmirror-schedule-config-54a33647735f751c.yaml b/releasenotes/notes/netapp-add-async-snapmirror-schedule-config-54a33647735f751c.yaml new file mode 100644 index 0000000000..6ebf7e0003 --- /dev/null +++ b/releasenotes/notes/netapp-add-async-snapmirror-schedule-config-54a33647735f751c.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Added new config option `netapp_snapmirror_schedule` which allows admin to + configure netapp asynchronous snapmirror schedule. Admin must make sure + schedule is already created on the backend filer.