dellemc.unity.snapshotschedule (2.0.0) — module

Manage snapshot schedules on Unity storage system

| "added in version" 1.1.0 of dellemc.unity"

Authors: Akash Shendge (@shenda1) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.unity:==2.0.0


Add to requirements.yml

  collections:
    - name: dellemc.unity
      version: 2.0.0

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete snapshot schedule using id
  dellemc.unity.snapshotschedule:
      unispherehost: "{{unispherehost}}"
      validate_certs: "{{validate_certs}}"
      username: "{{username}}"
      password: "{{password}}"
      id: "{{id}}"
      state: "{{state_absent}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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}}"

Inputs

    
id:
    description:
    - The ID of the snapshot schedule.
    type: str

hour:
    description:
    - The hour when the snapshot will be taken.
    - Applicable for C(every_n_days), C(every_week), C(every_month) rule types.
    - For create operation, if I(hour) parameter is not specified, value will be taken
      as C(0).
    - Value should be [0, 23].
    type: int

name:
    description:
    - The name of the snapshot schedule.
    - Name is mandatory for a create operation.
    - Specify either I(name) or I(id) (but not both) for any operation.
    type: str

port:
    default: 443
    description:
    - Port number through which communication happens with Unity management server.
    type: int

type:
    choices:
    - every_n_hours
    - every_day
    - every_n_days
    - every_week
    - every_month
    description:
    - 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.
    type: str

state:
    choices:
    - absent
    - present
    description:
    - Define whether the snapshot schedule should exist or not.
    required: true
    type: str

minute:
    description:
    - Minute offset from the hour when the snapshot will be taken.
    - Applicable for all rule types.
    - For a create operation, if I(minute) parameter is not specified, value will be taken
      as C(0).
    - Value should be [0, 59].
    type: int

interval:
    description:
    - Number of hours between snapshots.
    - Applicable only when rule type is C(every_n_hours).
    type: int

password:
    description:
    - The password of the Unity management server.
    required: true
    type: str

username:
    description:
    - The username of the Unity management server.
    required: true
    type: str

auto_delete:
    description:
    - Indicates whether the system can automatically delete the snapshot.
    type: bool

day_interval:
    description:
    - Number of days between snapshots.
    - Applicable only when rule type is C(every_n_days).
    type: int

day_of_month:
    description:
    - Day of the month for which the snapshot schedule rule applies.
    - Applicable only when rule type is C(every_month).
    - Value should be [1, 31].
    type: int

days_of_week:
    choices:
    - SUNDAY
    - MONDAY
    - TUESDAY
    - WEDNESDAY
    - THURSDAY
    - FRIDAY
    - SATURDAY
    description:
    - Days of the week for which the snapshot schedule rule applies.
    - Applicable only when rule type is C(every_week).
    elements: str
    type: list

hours_of_day:
    description:
    - Hours of the day when the snapshot will be taken.
    - Applicable only when rule type is C(every_day).
    elements: int
    type: list

unispherehost:
    description:
    - IP or FQDN of the Unity management server.
    required: true
    type: str

retention_unit:
    choices:
    - hours
    - days
    default: hours
    description:
    - The retention unit for the snapshot.
    type: str

validate_certs:
    aliases:
    - verifycert
    default: true
    description:
    - Boolean variable to specify whether or not to validate SSL certificate.
    - C(true) - Indicates that the SSL certificate should be verified.
    - C(false) - Indicates that the SSL certificate should not be verified.
    type: bool

desired_retention:
    description:
    - The number of days/hours for which snapshot will be retained.
    - When I(auto_delete) is C(true), I(desired_retention) cannot be specified.
    - Maximum desired retention supported is 31 days or 744 hours.
    type: int

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: true
  type: bool
snapshot_schedule_details:
  contains:
    id:
      description: The system ID given to the snapshot schedule.
      type: str
    luns:
      contains:
        UnityLunList:
          contains:
            UnityLun:
              contains:
                id:
                  description: The system ID given to volume.
                  type: str
              description: Detail of volume.
              type: dict
          description: List of volumes for which snapshot schedule applied.
          type: list
      description: Details of volumes for which snapshot schedule applied.
      type: dict
    name:
      description: The name of the snapshot schedule.
      type: str
    rules:
      contains:
        days_of_month:
          description: Days of the month for which the snapshot schedule rule applies.
          type: list
        days_of_week:
          contains:
            DayOfWeekEnumList:
              description: Enumeration of days of the week.
              type: list
          description: Days of the week for which the snapshot schedule rule applies.
          type: dict
        hours:
          description: Hourly frequency for the snapshot schedule rule.
          type: list
        id:
          description: The system ID of the rule.
          type: str
        interval:
          description: Number of days or hours between snaps, depending on the rule
            type.
          type: int
        is_auto_delete:
          description: Indicates whether the system can automatically delete the snapshot
            based on pool automatic-deletion thresholds.
          type: bool
        minute:
          description: Minute frequency for the snapshot schedule rule.
          type: int
        retention_time:
          description: Period of time in seconds for which to keep the snapshot.
          type: int
        retention_time_in_hours:
          description: Period of time in hours for which to keep the snapshot.
          type: int
        rule_type:
          description: Type of the rule applied to snapshot schedule.
          type: str
      description: Details of rules that apply to snapshot schedule.
      type: list
    storage_resources:
      contains:
        UnityStorageResourceList:
          contains:
            UnityStorageResource:
              contains:
                id:
                  description: The system ID given to storage resource.
                  type: str
              description: Detail of storage resource.
              type: dict
          description: List of storage resources for which snapshot schedule applied.
          type: list
      description: Details of storage resources for which snapshot. schedule applied.
      type: dict
  description: Details of the snapshot schedule.
  returned: When snapshot schedule exists
  sample:
    existed: true
    hash: 8742032390151
    id: snapSch_63
    is_default: false
    is_modified: null
    is_sync_replicated: false
    luns: null
    modification_time: '2021-12-14 21:37:47.905000+00:00'
    name: SS7_empty_hour_SS
    rules:
    - access_type: FilesystemSnapAccessTypeEnum.CHECKPOINT
      days_of_month: null
      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: null
    version: ScheduleVersionEnum.LEGACY
  type: dict