dellemc.powerflex.snapshot (2.3.0) — module

Manage Snapshots on Dell PowerFlex

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

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

Install collection

Install with ansible-galaxy collection install dellemc.powerflex:==2.3.0


Add to requirements.yml

  collections:
    - name: dellemc.powerflex
      version: 2.3.0

Description

Managing snapshots on PowerFlex Storage System includes creating, getting details, mapping/unmapping to/from SDC, modifying the attributes and deleting snapshot.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create snapshot
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_name: "ansible_snapshot"
    vol_name: "ansible_volume"
    read_only: false
    desired_retention: 2
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get snapshot details using snapshot id
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Map snapshot to SDC
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    sdc:
      - sdc_ip: "198.10.xxx.xxx"
      - sdc_id: "663ac0d200000001"
    allow_multiple_mappings: true
    sdc_state: "mapped"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify the attributes of SDC mapped to snapshot
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    sdc:
      - sdc_ip: "198.10.xxx.xxx"
        iops_limit: 11
        bandwidth_limit: 4096
      - sdc_id: "663ac0d200000001"
        iops_limit: 20
        bandwidth_limit: 2048
    allow_multiple_mappings: true
    sdc_state: "mapped"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Extend the size of snapshot
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    size: 16
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unmap SDCs from snapshot
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    sdc:
      - sdc_ip: "198.10.xxx.xxx"
      - sdc_id: "663ac0d200000001"
    sdc_state: "unmapped"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rename snapshot
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    snapshot_new_name: "ansible_renamed_snapshot_10"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete snapshot
  dellemc.powerflex.snapshot:
    hostname: "{{hostname}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    snapshot_id: "fe6cb28200000007"
    remove_mode: "ONLY_ME"
    state: "absent"

Inputs

    
sdc:
    description:
    - Specifies SDC parameters.
    elements: dict
    suboptions:
      access_mode:
        choices:
        - READ_WRITE
        - READ_ONLY
        - NO_ACCESS
        description:
        - Define the access mode for all mappings of the snapshot.
        type: str
      bandwidth_limit:
        description:
        - Limit of snapshot network bandwidth.
        - Need to mention in multiple of 1024 Kbps.
        - To set no limit, 0 is to be passed.
        type: int
      iops_limit:
        description:
        - Limit of snapshot IOPS.
        - Minimum IOPS limit is 11 and specify 0 for unlimited iops.
        type: int
      sdc_id:
        description:
        - ID of the SDC.
        - Specify either I(sdc_name), I(sdc_id) or I(sdc_ip).
        - Mutually exclusive with I(sdc_name) and I(sdc_ip).
        type: str
      sdc_ip:
        description:
        - IP of the SDC.
        - Specify either I(sdc_name), I(sdc_id) or I(sdc_ip).
        - Mutually exclusive with I(sdc_id) and I(sdc_ip).
        type: str
      sdc_name:
        description:
        - Name of the SDC.
        - Specify either I(sdc_name), I(sdc_id) or I(sdc_ip).
        - Mutually exclusive with I(sdc_id) and I(sdc_ip).
        type: str
    type: list

port:
    default: 443
    description:
    - Port number through which communication happens with PowerFlex host.
    type: int

size:
    description:
    - The size of the snapshot.
    type: int

state:
    choices:
    - present
    - absent
    description:
    - State of the snapshot.
    required: true
    type: str

vol_id:
    description:
    - The ID of the volume.
    type: str

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

cap_unit:
    choices:
    - GB
    - TB
    description:
    - The unit of the volume size. It defaults to C(GB), if not specified.
    type: str

hostname:
    aliases:
    - gateway_host
    description:
    - IP or FQDN of the PowerFlex host.
    required: true
    type: str

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

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

vol_name:
    description:
    - The name of the volume for which snapshot will be taken.
    - Specify either I(vol_name) or I(vol_id) while creating snapshot.
    type: str

read_only:
    description:
    - Specifies whether mapping of the created snapshot volume will have read-write access
      or limited to read-only access.
    - If C(true), snapshot is created with read-only access.
    - If C(false), snapshot is created with read-write access.
    type: bool

sdc_state:
    choices:
    - mapped
    - unmapped
    description:
    - Mapping state of the SDC.
    type: str

remove_mode:
    choices:
    - ONLY_ME
    - INCLUDING_DESCENDANTS
    description:
    - Removal mode for the snapshot.
    - It defaults to C(ONLY_ME), if not specified.
    type: str

snapshot_id:
    description:
    - The ID of the Snapshot.
    type: str

snapshot_name:
    description:
    - The name of the snapshot.
    - Mandatory for create operation.
    - Specify either I(snapshot_name) or I(snapshot_id) (but not both) for any operation.
    type: str

retention_unit:
    choices:
    - hours
    - days
    description:
    - The unit for retention. It defaults to C(hours), if not specified.
    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 retention value for the Snapshot.
    - If the desired_retention is not mentioned during creation, snapshot will be created
      with unlimited retention.
    - Maximum supported desired retention is 31 days.
    type: int

snapshot_new_name:
    description:
    - New name of the snapshot. Used to rename the snapshot.
    type: str

allow_multiple_mappings:
    description:
    - Specifies whether to allow multiple mappings or not.
    type: bool

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'false'
  type: bool
snapshot_details:
  contains:
    ancestorVolumeId:
      description: The ID of the root of the specified volume's V-Tree.
      type: str
    ancestorVolumeName:
      description: The name of the root of the specified volume's V-Tree.
      type: str
    creationTime:
      description: The creation time of the snapshot.
      type: int
    id:
      description: The ID of the snapshot.
      type: str
    mappedSdcInfo:
      contains:
        accessMode:
          description: Mapping access mode for the specified snapshot.
          type: str
        limitBwInMbps:
          description: Bandwidth limit for the SDC.
          type: int
        limitIops:
          description: IOPS limit for the SDC.
          type: int
        sdcId:
          description: ID of the SDC.
          type: str
        sdcIp:
          description: IP of the SDC.
          type: str
        sdcName:
          description: Name of the SDC.
          type: str
      description: The details of the mapped SDC.
      type: dict
    name:
      description: Name of the snapshot.
      type: str
    retentionInHours:
      description: Retention of the snapshot in hours.
      type: int
    secureSnapshotExpTime:
      description: Expiry time of the snapshot.
      type: int
    sizeInGb:
      description: Size of the snapshot.
      type: int
    sizeInKb:
      description: Size of the snapshot.
      type: int
    storagePoolId:
      description: The ID of the Storage pool in which snapshot resides.
      type: str
    storagePoolName:
      description: The name of the Storage pool in which snapshot resides.
      type: str
  description: Details of the snapshot.
  returned: When snapshot exists
  sample:
    accessModeLimit: ReadOnly
    ancestorVolumeId: cdd883cf00000002
    ancestorVolumeName: ansible-volume-1
    autoSnapshotGroupId: null
    compressionMethod: Invalid
    consistencyGroupId: 22f1e80c00000001
    creationTime: 1631619229
    dataLayout: MediumGranularity
    id: cdd883d000000004
    links:
    - href: /api/instances/Volume::cdd883d000000004
      rel: self
    - href: /api/instances/Volume::cdd883d000000004/relationships /Statistics
      rel: /api/Volume/relationship/Statistics
    - href: /api/instances/Volume::cdd883cf00000002
      rel: /api/parent/relationship/ancestorVolumeId
    - href: /api/instances/VTree::6e86255c00000001
      rel: /api/parent/relationship/vtreeId
    - href: /api/instances/StoragePool::e0d8f6c900000000
      rel: /api/parent/relationship/storagePoolId
    lockedAutoSnapshot: false
    lockedAutoSnapshotMarkedForRemoval: false
    managedBy: ScaleIO
    mappedSdcInfo: null
    name: ansible_vol_snap_1
    notGenuineSnapshot: false
    originalExpiryTime: 0
    pairIds: null
    replicationJournalVolume: false
    replicationTimeStamp: 0
    retentionInHours: 0
    retentionLevels: []
    secureSnapshotExpTime: 0
    sizeInGb: 16
    sizeInKb: 16777216
    snplIdOfAutoSnapshot: null
    snplIdOfSourceVolume: null
    storagePoolId: e0d8f6c900000000
    storagePoolName: pool1
    timeStampIsAccurate: false
    useRmcache: false
    volumeReplicationState: UnmarkedForReplication
    volumeType: Snapshot
    vtreeId: 6e86255c00000001
  type: dict