dellemc.unity.dellemc_unity_snapshot (1.2.1) — module

Manage snapshots on the Unity storage system

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

Authors: P Srinivas Rao (@srinivas-rao5) <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 snapshots on the Unity storage system includes create snapshot, delete snapshot, update snapshot, get snapshot, map host and unmap host.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Create a Snapshot for a CG
    dellemc.unity.dellemc_unity_snapshot:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      verifycert: "{{verifycert}}"
      port: "{{port}}"
      cg_name: "{{cg_name}}"
      snapshot_name: "{{cg_snapshot_name}}"
      description: "{{description}}"
      auto_delete: False
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Create a Snapshot for a volume with Host attached
    dellemc.unity.dellemc_unity_snapshot:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      verifycert: "{{verifycert}}"
      port: "{{port}}"
      vol_name: "{{vol_name}}"
      snapshot_name: "{{vol_snapshot_name}}"
      description: "{{description}}"
      expiry_time: "04/15/2025 16:30"
      host_name: "{{host_name}}"
      host_state: "mapped"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Unmap a host for a Snapshot
    dellemc.unity.dellemc_unity_snapshot:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      verifycert: "{{verifycert}}"
      port: "{{port}}"
      snapshot_name: "{{vol_snapshot_name}}"
      host_name: "{{host_name}}"
      host_state: "unmapped"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Map snapshot to a host
    dellemc.unity.dellemc_unity_snapshot:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      verifycert: "{{verifycert}}"
      port: "{{port}}"
      snapshot_name: "{{vol_snapshot_name}}"
      host_name: "{{host_name}}"
      host_state: "mapped"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Update attributes of a Snapshot for a volume
    dellemc.unity.dellemc_unity_snapshot:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      verifycert: "{{verifycert}}"
      snapshot_name: "{{vol_snapshot_name}}"
      new_snapshot_name: "{{new_snapshot_name}}"
      description: "{{new_description}}"
      host_name: "{{host_name}}"
      host_state: "unmapped"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  - name: Delete Snapshot of CG
    dellemc.unity.dellemc_unity_snapshot:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      verifycert: "{{verifycert}}"
      snapshot_name: "{{cg_snapshot_name}}"
      state: "absent"

Inputs

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

state:
    choices:
    - absent
    - present
    description:
    - The state option is used to mention the existence of the snapshot.
    required: true
    type: str

cg_name:
    description:
    - The name of the Consistency Group for which snapshot is created.
    - For creation of a snapshot either vol_name or cg_name is required.
    - Not required for other operations.
    type: str

host_id:
    description:
    - The id of the host.
    - Either host_name or host_id is required to map or unmap a snapshot from a host.
    - Snapshot can be attached to multiple hosts.
    type: str

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

vol_name:
    description:
    - The name of the volume for which snapshot is created.
    - For creation of a snapshot either vol_name or cg_name is required.
    - Not required for other operations.
    type: str

host_name:
    description:
    - The name of the host.
    - Either host_name or host_id is required to map or unmap a snapshot from a host.
    - Snapshot can be attached to multiple hosts.
    type: str

host_state:
    choices:
    - mapped
    - unmapped
    description:
    - The host_state option is used to mention the existence of the host for snapshot.
    - It is required when a snapshot is mapped or unmapped from host.
    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:
    - This option specifies whether the snapshot is auto deleted or not.
    - If set to true, snapshot will expire based on the pool auto deletion policy.
    - If set to false, snapshot will not be auto deleted based on the pool auto deletion
      policy.
    - auto_delete can not be set to True, if expiry_time is specified.
    - If during creation neither auto_delete nor expiry_time is mentioned then snapshot
      will be created keeping auto_delete as True.
    - Once the expiry_time is set then snapshot cannot be assigned to the auto delete
      policy.
    type: bool

description:
    description:
    - The additional information about the snapshot can be provided using this option.
    type: str

expiry_time:
    description:
    - This option is for specifying the date and time after which the snapshot will expire.
    - The time is to be mentioned in UTC timezone.
    - The format is "MM/DD/YYYY HH:MM". Year must be in 4 digits.
    type: str

snapshot_id:
    description:
    - The id of the snapshot.
    - For all operations other than creation either snapshot name or snapshot id is required.
    type: str

snapshot_name:
    description:
    - The name of the snapshot.
    - Mandatory parameter for creating a snapshot.
    - For all other operations either snapshot name or snapshot id is required.
    type: str

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

new_snapshot_name:
    description:
    - New name for the snapshot.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  type: bool
snapshot_details:
  contains:
    expiration_time:
      description: Date and time after which the snapshot will expire.
      type: str
    hosts_list:
      description: Contains the name and id of the associated hosts.
      type: dict
    id:
      description: Unique identifier of the snapshot instance.
      type: str
    is_auto_delete:
      description: Additional information mentioned for snapshot.
      type: str
    name:
      description: The name of the snapshot.
      type: str
    storage_resource_id:
      description: Id of the storage resource for which the snapshot exists.
      type: str
    storage_resource_name:
      description: Name of the storage resource for which the snapshot exists.
      type: str
  description: Details of the snapshot.
  returned: When snapshot exists
  type: complex