dellemc.powerscale.snapshot (3.0.0) — module

Manage snapshots on PowerScale

| "added in version" 1.2.0 of dellemc.powerscale"

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

Install collection

Install with ansible-galaxy collection install dellemc.powerscale:==3.0.0


Add to requirements.yml

  collections:
    - name: dellemc.powerscale
      version: 3.0.0

Description

You can perform the following operations.

Managing snapshots on PowerScale.

Create a filesystem snapshot.

Modify a filesystem snapshot.

Get details of a filesystem snapshot.

Delete a filesystem snapshot.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a filesystem snapshot on PowerScale
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    path: "<path>"
    access_zone: "{{access_zone}}"
    snapshot_name: "{{snapshot_name}}"
    desired_retention: "{{desired_retention}}"
    retention_unit: "{{retention_unit_days}}"
    alias: "{{ansible_snap_alias}}"
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of a filesystem snapshot
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{snapshot_name}}"
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify filesystem snapshot desired retention
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{snapshot_name}}"
    desired_retention: "{{desired_retention_new}}"
    retention_unit: "{{retention_unit_days}}"
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify filesystem snapshot expiration timestamp
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{snapshot_name}}"
    expiration_timestamp: "{{expiration_timestamp_new}}"
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify filesystem snapshot alias
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{snapshot_name}}"
    alias: "{{ansible_snap_alias_new}}"
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete snapshot alias
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{snapshot_name}}"
    alias: ""
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rename filesystem snapshot
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{snapshot_name}}"
    new_snapshot_name: "{{new_snapshot_name}}"
    state: "{{present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete filesystem snapshot
  dellemc.powerscale.snapshot:
    onefs_host: "{{onefs_host}}"
    verify_ssl: "{{verify_ssl}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    snapshot_name: "{{new_snapshot_name}}"
    state: "{{absent}}"

Inputs

    
path:
    description:
    - Specifies the filesystem path. It is the absolute path for System access zone and
      it is relative if using non-System access zone. For example, if your access zone
      is 'Ansible' and it has a base path '/ifs/ansible' and the path specified is '/user1',
      then the effective path would be '/ifs/ansible/user1'. If your access zone is System,
      and you have 'directory1' in the access zone, the path provided should be '/ifs/directory1'.
    type: str

alias:
    description:
    - The alias for the snapshot.
    type: str

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

port_no:
    default: '8080'
    description:
    - Port number of the PowerScale cluster.It defaults to 8080 if not specified.
    required: false
    type: str

api_user:
    description:
    - username of the PowerScale cluster.
    required: true
    type: str

onefs_host:
    description:
    - IP address or FQDN of the PowerScale cluster.
    required: true
    type: str

verify_ssl:
    choices:
    - true
    - false
    description:
    - boolean variable to specify whether to validate SSL certificate or not.
    - C(true) - indicates that the SSL certificate should be verified.
    - C(false) - indicates that the SSL certificate should not be verified.
    required: true
    type: bool

access_zone:
    default: System
    description:
    - The effective path where the Snapshot is created will be determined by the base
      path of the Access Zone and the path provided by the user in the playbook.
    type: str

api_password:
    description:
    - the password of the PowerScale cluster.
    required: true
    type: str

snapshot_name:
    description:
    - The name of the snapshot.
    required: true
    type: str

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

desired_retention:
    description:
    - The number of days for which the snapshot can be retained.
    - Either this or expiration timestamp can be specified, but not both.
    type: str

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

expiration_timestamp:
    description:
    - The timestamp on which the snapshot will expire (UTC format).
    - Either this or desired retention can be specified, but not both.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'true'
  type: bool
snapshot_details:
  contains:
    alias:
      description: Snapshot alias.
      sample: snapshot_alias
      type: str
    created:
      description: The creation timestamp.
      sample: 1578514373
      type: int
    expires:
      description: The expiration timestamp.
      sample: 1578687172
      type: int
    has_locks:
      description: Whether the snapshot has locks.
      sample: false
      type: bool
    id:
      description: The snapshot ID.
      sample: 230
      type: int
    name:
      description: The name of the snapshot.
      sample: ansible_snapshot
      type: str
    path:
      description: The directory path whose snapshot has been taken.
      sample: /ifs/ansible/
      type: str
    pct_filesystem:
      description: The percentage of filesystem used.
      sample: 2.5
      type: float
    pct_reserve:
      description: The percentage of filesystem reserved.
      sample: 0.0
      type: float
    size:
      description: The snapshot size.
      sample: 4096
      type: int
    state:
      description: The state of the snapshot.
      sample: active
      type: str
    target_id:
      description: target ID of snapshot whose alias it is.
      sample: 10
      type: int
    target_name:
      description: target name of snapshot whose alias it is.
      sample: ansible_target_snap
      type: str
  description: The snapshot details.
  returned: When snapshot exists.
  sample:
    snapshots:
    - alias: null
      created: 1628155527
      expires: null
      has_locks: false
      id: 936
      name: Atest
      path: /ifs/test_src_01
      pct_filesystem: 2.435778242215747e-06
      pct_reserve: 0.0
      schedule: null
      shadow_bytes: 0
      size: 4096
      state: active
      target_id: null
      target_name: null
  type: complex