dellemc.unity.dellemc_unity_snapshotschedule (1.2.1) — 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>

preview | supported by community

Install collection

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


Add to requirements.yml

  collections:
    - name: dellemc.unity
      version: 1.2.1

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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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.dellemc_unity_snapshotschedule:
      unispherehost: "{{unispherehost}}"
      verifycert: "{{verifycert}}"
      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 '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].
    type: int

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

port:
    default: 443
    description:
    - Port number through which communication happens with Unity management server.
    required: false
    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 'minute' parameter is not specified, value will be taken
      as 0.
    - Value should be [0, 59].
    type: int

interval:
    description:
    - Number of hours between snapshots.
    - Applicable only when rule type is '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

verifycert:
    choices:
    - true
    - false
    default: true
    description:
    - 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.
    required: false
    type: bool

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 '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 '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 '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 '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

desired_retention:
    description:
    - 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.
    type: int

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  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: complex
          description: List of volumes for which snapshot schedule applied.
          type: complex
      description: Details of volumes for which snapshot schedule applied.
      type: complex
    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: complex
        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: complex
    storage_resources:
      contains:
        UnityStorageResourceList:
          contains:
            UnityStorageResource:
              contains:
                id:
                  description: The system ID given to storage resource.
                  type: str
              description: Detail of storage resource.
              type: complex
          description: List of storage resources for which snapshot schedule applied.
          type: complex
      description: Details of storage resources for which snapshot schedule applied.
      type: complex
  description: Details of the snapshot schedule.
  returned: When snapshot schedule exists
  type: complex