1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
|
.. _snapshotschedule_module:
snapshotschedule -- Manage snapshot schedules on Unity storage system
=====================================================================
.. contents::
:local:
:depth: 1
Synopsis
--------
Managing snapshot schedules on Unity storage system includes creating new snapshot schedule, getting details of snapshot schedule, modifying attributes of snapshot schedule, and deleting snapshot schedule.
Requirements
------------
The below requirements are needed on the host that executes this module.
- A Dell Unity Storage device version 5.1 or later.
- Ansible-core 2.13 or later.
- Python 3.9, 3.10 or 3.11.
- Storops Python SDK 1.2.11.
Parameters
----------
name (optional, str, None)
The name of the snapshot schedule.
Name is mandatory for a create operation.
Specify either *name* or *id* (but not both) for any operation.
id (optional, str, None)
The ID of the snapshot schedule.
type (optional, str, None)
Type of the rule to be included in snapshot schedule.
Type is mandatory for any create or modify operation.
Once the snapshot schedule is created with one type it can be modified.
interval (optional, int, None)
Number of hours between snapshots.
Applicable only when rule type is ``every_n_hours``.
hours_of_day (optional, list, None)
Hours of the day when the snapshot will be taken.
Applicable only when rule type is ``every_day``.
day_interval (optional, int, None)
Number of days between snapshots.
Applicable only when rule type is ``every_n_days``.
days_of_week (optional, list, None)
Days of the week for which the snapshot schedule rule applies.
Applicable only when rule type is ``every_week``.
day_of_month (optional, int, None)
Day of the month for which the snapshot schedule rule applies.
Applicable only when rule type is ``every_month``.
Value should be [1, 31].
hour (optional, int, None)
The hour when the snapshot will be taken.
Applicable for ``every_n_days``, ``every_week``, ``every_month`` rule types.
For create operation, if *hour* parameter is not specified, value will be taken as ``0``.
Value should be [0, 23].
minute (optional, int, None)
Minute offset from the hour when the snapshot will be taken.
Applicable for all rule types.
For a create operation, if *minute* parameter is not specified, value will be taken as ``0``.
Value should be [0, 59].
desired_retention (optional, int, None)
The number of days/hours for which snapshot will be retained.
When *auto_delete* is ``true``, *desired_retention* cannot be specified.
Maximum desired retention supported is 31 days or 744 hours.
retention_unit (optional, str, hours)
The retention unit for the snapshot.
auto_delete (optional, bool, None)
Indicates whether the system can automatically delete the snapshot.
state (True, str, None)
Define whether the snapshot schedule should exist or not.
unispherehost (True, str, None)
IP or FQDN of the Unity management server.
username (True, str, None)
The username of the Unity management server.
password (True, str, None)
The password of the Unity management server.
validate_certs (optional, bool, True)
Boolean variable to specify whether or not to validate SSL certificate.
``true`` - Indicates that the SSL certificate should be verified.
``false`` - Indicates that the SSL certificate should not be verified.
port (optional, int, 443)
Port number through which communication happens with Unity management server.
Notes
-----
.. note::
- Snapshot schedule created through Ansible will have only one rule.
- Modification of rule type is not allowed. Within the same type, other parameters can be modified.
- If an existing snapshot schedule has more than 1 rule in it, only get and delete operation is allowed.
- The *check_mode* is not supported.
- The modules present in this collection named as 'dellemc.unity' are built to support the Dell Unity storage platform.
Examples
--------
.. code-block:: yaml+jinja
- name: Create snapshot schedule (Rule Type - every_n_hours)
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_N_Hours_Testing"
type: "every_n_hours"
interval: 6
desired_retention: 24
state: "{{state_present}}"
- name: Create snapshot schedule (Rule Type - every_day)
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_Day_Testing"
type: "every_day"
hours_of_day:
- 8
- 14
auto_delete: True
state: "{{state_present}}"
- name: Create snapshot schedule (Rule Type - every_n_days)
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_N_Day_Testing"
type: "every_n_days"
day_interval: 2
desired_retention: 16
retention_unit: "days"
state: "{{state_present}}"
- name: Create snapshot schedule (Rule Type - every_week)
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_Week_Testing"
type: "every_week"
days_of_week:
- MONDAY
- FRIDAY
hour: 12
minute: 30
desired_retention: 200
state: "{{state_present}}"
- name: Create snapshot schedule (Rule Type - every_month)
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_Month_Testing"
type: "every_month"
day_of_month: 17
auto_delete: True
state: "{{state_present}}"
- name: Get snapshot schedule details using name
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_N_Hours_Testing"
state: "{{state_present}}"
- name: Get snapshot schedule details using id
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
id: "{{id}}"
state: "{{state_present}}"
- name: Modify snapshot schedule details id
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
id: "{{id}}"
type: "every_n_hours"
interval: 8
state: "{{state_present}}"
- name: Modify snapshot schedule using name
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_Day_Testing"
type: "every_day"
desired_retention: 200
auto_delete: False
state: "{{state_present}}"
- name: Delete snapshot schedule using id
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
id: "{{id}}"
state: "{{state_absent}}"
- name: Delete snapshot schedule using name
dellemc.unity.snapshotschedule:
unispherehost: "{{unispherehost}}"
validate_certs: "{{validate_certs}}"
username: "{{username}}"
password: "{{password}}"
name: "Ansible_Every_Day_Testing"
state: "{{state_absent}}"
Return Values
-------------
changed (always, bool, True)
Whether or not the resource has changed.
snapshot_schedule_details (When snapshot schedule exists, dict, {'existed': True, 'hash': 8742032390151, 'id': 'snapSch_63', 'is_default': False, 'is_modified': None, 'is_sync_replicated': False, 'luns': None, 'modification_time': '2021-12-14 21:37:47.905000+00:00', 'name': 'SS7_empty_hour_SS', 'rules': [{'access_type': 'FilesystemSnapAccessTypeEnum.CHECKPOINT', 'days_of_month': None, 'days_of_week': {'DayOfWeekEnumList': []}, 'existed': True, 'hash': 8742032280772, 'hours': [0], 'id': 'SchedRule_109', 'interval': 2, 'is_auto_delete': False, 'minute': 0, 'retention_time': 86400, 'retention_time_in_hours': 24, 'rule_type': 'every_n_days', 'type': 'ScheduleTypeEnum.N_DAYS_AT_HHMM'}], 'storage_resources': None, 'version': 'ScheduleVersionEnum.LEGACY'})
Details of the snapshot schedule.
id (, str, )
The system ID given to the snapshot schedule.
name (, str, )
The name of the snapshot schedule.
luns (, dict, )
Details of volumes for which snapshot schedule applied.
UnityLunList (, list, )
List of volumes for which snapshot schedule applied.
UnityLun (, dict, )
Detail of volume.
id (, str, )
The system ID given to volume.
rules (, list, )
Details of rules that apply to snapshot schedule.
id (, str, )
The system ID of the rule.
interval (, int, )
Number of days or hours between snaps, depending on the rule type.
hours (, list, )
Hourly frequency for the snapshot schedule rule.
minute (, int, )
Minute frequency for the snapshot schedule rule.
days_of_week (, dict, )
Days of the week for which the snapshot schedule rule applies.
DayOfWeekEnumList (, list, )
Enumeration of days of the week.
days_of_month (, list, )
Days of the month for which the snapshot schedule rule applies.
retention_time (, int, )
Period of time in seconds for which to keep the snapshot.
retention_time_in_hours (, int, )
Period of time in hours for which to keep the snapshot.
rule_type (, str, )
Type of the rule applied to snapshot schedule.
is_auto_delete (, bool, )
Indicates whether the system can automatically delete the snapshot based on pool automatic-deletion thresholds.
storage_resources (, dict, )
Details of storage resources for which snapshot. schedule applied.
UnityStorageResourceList (, list, )
List of storage resources for which snapshot schedule applied.
UnityStorageResource (, dict, )
Detail of storage resource.
id (, str, )
The system ID given to storage resource.
Status
------
Authors
~~~~~~~
- Akash Shendge (@shenda1) <ansible.team@dell.com>
|