dellemc.powerstore.snapshot (3.2.0) — module

Manage Snapshots for PowerStore

| "added in version" 1.0.0 of dellemc.powerstore"

Authors: Rajshree Khare (@khareRajshree) <ansible.team@dell.com>, Prashant Rakheja (@prashant-dell) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.powerstore:==3.2.0


Add to requirements.yml

  collections:
    - name: dellemc.powerstore
      version: 3.2.0

Description

Managing Snapshots on PowerStore storage system, Create a new Volume Group Snapshot, Get details of Volume Group Snapshot, Modify Volume Group Snapshot, Delete an existing Volume Group Snapshot.

Module also supports Create a new Volume Snapshot, Get details of Volume Snapshot, Modify Volume Snapshot, Delete an existing Volume Snapshot.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a volume snapshot on PowerStore
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    volume: "{{volume}}"
    description: "{{description}}"
    desired_retention: "{{desired_retention}}"
    retention_unit: "{{retention_unit_days}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of a volume snapshot
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    volume: "{{volume}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rename volume snapshot
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    new_snapshot_name: "{{new_snapshot_name}}"
    volume: "{{volume}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete volume snapshot
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{new_snapshot_name}}"
    volume: "{{volume}}"
    state: "{{state_absent}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a volume group snapshot on PowerStore
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    volume_group: "{{volume_group}}"
    description: "{{description}}"
    expiration_timestamp: "{{expiration_timestamp}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of a volume group snapshot
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    volume_group: "{{volume_group}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify volume group snapshot expiration timestamp
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    volume_group: "{{volume_group}}"
    description: "{{description}}"
    expiration_timestamp: "{{expiration_timestamp_new}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rename volume group snapshot
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{snapshot_name}}"
    new_snapshot_name: "{{new_snapshot_name}}"
    volume_group: "{{volume_group}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete volume group snapshot
  dellemc.powerstore.snapshot:
    array_ip: "{{mgmt_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    snapshot_name: "{{new_snapshot_name}}"
    volume_group: "{{volume_group}}"
    state: "{{state_absent}}"

Inputs

    
port:
    description:
    - Port number for the PowerStore array.
    - If not passed, it will take 443 as default.
    type: int

user:
    description:
    - The username of the PowerStore host.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    description:
    - Defines whether the Snapshot should exist or not.
    required: true
    type: str

volume:
    description:
    - The volume. This could be the volume name or ID.
    type: str

timeout:
    default: 120
    description:
    - Time after which the connection will get terminated.
    - It is to be mentioned in seconds.
    type: int

array_ip:
    description:
    - IP or FQDN of the PowerStore management system.
    required: true
    type: str

password:
    description:
    - The password of the PowerStore host.
    required: true
    type: str

description:
    description:
    - The description for the Snapshot.
    type: str

snapshot_id:
    description:
    - The ID of the Snapshot. Either snapshot ID or Snapshot name is required.
    type: str

volume_group:
    description:
    - The volume group. This could be the volume group name or ID.
    type: str

snapshot_name:
    description:
    - The name of the Snapshot. Either snapshot name or ID is required.
    type: str

retention_unit:
    choices:
    - hours
    - days
    description:
    - The unit for retention.
    - If this unit is not specified, C(hours) is taken as default I(retention_unit).
    - If I(desired_retention) is specified, I(expiration_timestamp) cannot be specified.
    type: str

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

desired_retention:
    description:
    - The retention value for the Snapshot.
    - If the retention value is not specified, the Snapshot details would be returned.
    - To create a Snapshot, either a retention or expiration timestamp must be given.
    - If the Snapshot does not have any retention value - specify it as 'None'.
    type: str

new_snapshot_name:
    description:
    - The new name of the Snapshot.
    type: str

expiration_timestamp:
    description:
    - The expiration timestamp of the Snapshot. This should be provided in UTC format,
      e.g 2019-07-24T10:54:54Z.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'true'
  type: bool
create_vg_snap:
  description: A boolean flag to indicate whether volume group snapshot got created.
  returned: When value exists
  sample: 'true'
  type: bool
create_vol_snap:
  description: A boolean flag to indicate whether volume snapshot got created.
  returned: When value exists
  sample: 'true'
  type: bool
delete_vg_snap:
  description: A boolean flag to indicate whether volume group snapshot got deleted.
  returned: When value exists
  sample: 'true'
  type: bool
delete_vol_snap:
  description: A boolean flag to indicate whether volume snapshot got deleted.
  returned: When value exists
  sample: 'true'
  type: bool
modify_vg_snap:
  description: A boolean flag to indicate whether volume group snapshot got modified.
  returned: When value exists
  sample: 'true'
  type: bool
modify_vol_snap:
  description: A boolean flag to indicate whether volume snapshot got modified.
  returned: When value exists
  sample: 'true'
  type: bool
snap_details:
  contains:
    creation_timestamp:
      description: The creation timestamp of the snapshot.
      type: str
    description:
      description: Description about the snapshot.
      type: str
    id:
      description: The system generated ID given to the snapshot.
      type: str
    name:
      description: Name of the snapshot.
      type: str
    performance_policy_id:
      description: The performance policy for the snapshot.
      type: str
    protection_data:
      contains:
        expiration_timestamp:
          description: The expiration timestamp of the snapshot.
          type: str
      description: The protection data of the snapshot.
      type: complex
    protection_policy_id:
      description: The protection policy of the snapshot.
      type: str
    size:
      description: Size of the snapshot.
      type: int
    state:
      description: The state of the snapshot.
      type: str
    type:
      description: The type of the snapshot.
      type: str
    volumes:
      contains:
        id:
          description: The system generated ID given to the volume associated with
            the volume group.
          type: str
      description: The volumes details of the volume group snapshot.
      type: complex
  description: Details of the snapshot.
  returned: When snapshot exists
  sample:
    appliance_id: A1
    creation_timestamp: '2022-01-06T05:41:59.381459+00:00'
    description: Snapshot created
    hlu_details: []
    host: []
    host_group: []
    id: 634e4b95-e7bd-49e7-957b-6dc932642464
    is_replication_destination: false
    location_history: null
    mapped_volumes: []
    migration_session_id: null
    name: sample_snapshot
    nguid: null
    node_affinity: System_Select_At_Attach
    node_affinity_l10n: System Select At Attach
    nsid: null
    performance_policy:
      id: default_medium
      name: Medium
    performance_policy_id: default_medium
    protection_data:
      copy_signature: b9978b85-4a73-4abb-a25a-634e36f3e3d1
      created_by_rule_id: null
      created_by_rule_name: null
      creator_type: User
      creator_type_l10n: User
      expiration_timestamp: '2022-01-06T08:41:00+00:00'
      family_id: dc15650a-2af5-4398-8ae3-63fc7ae25f63
      is_app_consistent: false
      parent_id: dc15650a-2af5-4398-8ae3-63fc7ae25f63
      source_id: dc15650a-2af5-4398-8ae3-63fc7ae25f63
      source_timestamp: '2022-01-06T05:41:59.381459+00:00'
    protection_policy: null
    protection_policy_id: null
    size: 1073741824
    state: Ready
    state_l10n: Ready
    type: Snapshot
    type_l10n: Snapshot
    volume_groups: []
    wwn: null
  type: complex