dellemc / dellemc.powerflex / 1.1.0 / module / dellemc_powerflex_volume Manage volumes on Dell EMC PowerFlex | "added in version" 1.0.0 of dellemc.powerflex" Authors: P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com> preview | supported by communitydellemc.powerflex.dellemc_powerflex_volume (1.1.0) — module
Install with ansible-galaxy collection install dellemc.powerflex:==1.1.0
collections: - name: dellemc.powerflex version: 1.1.0
Managing volumes on PowerFlex storage system includes creating new volume, getting details of volume, adding/removing snapshot policy to/from volume, mapping/unmapping volume to/from SDC, listing snapshots associated with a volume, modifying attributes of volume and deleting volume.
- name: Create a volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" storage_pool_name: "pool_1" protection_domain_name: "pd_1" vol_type: "THICK_PROVISIONED" compression_type: "NORMAL" use_rmcache: True size: 16 state: "present"
- name: Map a SDC to volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" allow_multiple_mappings: True sdc: - sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764" access_mode: "READ_WRITE" sdc_state: "mapped" state: "present"
- name: Unmap a SDC to volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" sdc: - sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764" sdc_state: "unmapped" state: "present"
- name: Map multiple SDCs to a volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" protection_domain_name: "pd_1" sdc: - sdc_id: "92A304DB-EFD7-44DF-A07E-D78134CC9764" access_mode: "READ_WRITE" bandwidth_limit: 2048 iops_limit: 20 - sdc_ip: "198.10.xxx.xxx" access_mode: "READ_ONLY" allow_multiple_mappings: True sdc_state: "mapped" state: "present"
- name: Get the details of the volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_id: "fe6c8b7100000005" state: "present"
- name: Modify the details of the Volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" storage_pool_name: "pool_1" new_vol_name: "new_sample_volume" size: 64 state: "present"
- name: Delete the Volume dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" delete_snapshots: False state: "absent"
- name: Delete the Volume and all its dependent snapshots dellemc.powerflex.dellemc_powerflex_volume: gateway_host: "{{gateway_host}}" username: "{{username}}" password: "{{password}}" verifycert: "{{verifycert}}" port: "{{port}}" vol_name: "sample_volume" delete_snapshots: True state: "absent"
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 volume. type: str bandwidth_limit: description: - Limit of volume 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 volume IOPS. - Minimum IOPS limit is 11 and specify 0 for unlimited iops. type: int sdc_id: description: - ID of the SDC. - Specify either sdc_name, sdc_id or sdc_ip. - Mutually exclusive with sdc_name and sdc_ip. type: str sdc_ip: description: - IP of the SDC. - Specify either sdc_name, sdc_id or sdc_ip. - Mutually exclusive with sdc_id and sdc_ip. type: str sdc_name: description: - Name of the SDC. - Specify either sdc_name, sdc_id or sdc_ip. - Mutually exclusive with sdc_id and sdc_ip. type: str type: list port: default: 443 description: - Port number through which communication happens with PowerFlex gateway host. required: false type: int size: description: - The size of the volume. - Size of the volume will be assigned as higher multiple of 8 GB. type: int state: choices: - present - absent description: - State of the volume. required: true type: str vol_id: description: - The ID of the volume. - Except create operation, all other operations can be performed using vol_id. - Mutually exclusive with vol_id. type: str cap_unit: choices: - GB - TB description: - The unit of the volume size. It defaults to 'GB'. type: str password: description: - The password of the PowerFlex gateway host. required: true type: str username: description: - The username of the PowerFlex gateway host. required: true type: str vol_name: description: - The name of the volume. - Mandatory for create operation. - It is unique across the PowerFlex array. - Mutually exclusive with vol_id. type: str vol_type: choices: - THICK_PROVISIONED - THIN_PROVISIONED description: - Type of volume provisioning. type: str sdc_state: choices: - mapped - unmapped description: - Mapping state of the SDC. 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 use_rmcache: description: - Whether to use RM Cache or not. type: bool gateway_host: description: - IP or FQDN of the PowerFlex gateway host. required: true type: str vol_new_name: description: - New name of the volume. Used to rename the volume. type: str storage_pool_id: description: - The ID of the storage pool. - Either name or the id of the storage pool is required for creating a volume. - Mutually exclusive with storage_pool_name. type: str compression_type: choices: - NORMAL - NONE description: - Type of the compression method. type: str delete_snapshots: description: - If True, the volume and all its dependent snapshots will be deleted. - If False, only the volume will be deleted. - It can be specified only when the state is absent. - It defaults to False, if not specified. type: bool storage_pool_name: description: - The name of the storage pool. - Either name or the id of the storage pool is required for creating a volume. - During creation, if storage pool name is provided then either protection domain name or id must be mentioned along with it. - Mutually exclusive with storage_pool_id. type: str snapshot_policy_id: description: - ID of the snapshot policy. - To remove/detach snapshot policy, empty snapshot_policy_id/snapshot_policy_name is to be passed along with auto_snap_remove_type. type: str protection_domain_id: description: - The ID of the protection domain. - During creation of a volume, if more than one storage pool exists with the same name then either protection domain name or id must be mentioned along with it. - Mutually exclusive with protection_domain_name. type: str snapshot_policy_name: description: - Name of the snapshot policy. - To remove/detach snapshot policy, empty snapshot_policy_id/snapshot_policy_name is to be passed along with auto_snap_remove_type. type: str auto_snap_remove_type: choices: - remove - detach description: - Whether to remove or detach the snapshot policy. - To remove/detach snapshot policy, empty snapshot_policy_id/snapshot_policy_name is to be passed along with auto_snap_remove_type. - If the snapshot policy name/id is passed empty then auto_snap_remove_type is defaulted to 'detach'. type: str protection_domain_name: description: - The name of the protection domain. - During creation of a volume, if more than one storage pool exists with the same name then either protection domain name or id must be mentioned along with it. - Mutually exclusive with protection_domain_id. type: str allow_multiple_mappings: description: - Specifies whether to allow multiple mappings or not. - If the volume is mapped to one SDC then for every new mapping allow_multiple_mappings has to be passed as True. type: bool
changed: description: Whether or not the resource has changed. returned: always sample: 'false' type: bool volume_details: contains: id: description: The ID of the volume. type: str mappedSdcInfo: contains: accessMode: description: mapping access mode for the specified volume. 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: complex name: description: Name of the volume. type: str protectionDomainId: description: ID of the protection domain in which volume resides. type: str protectionDomainName: description: Name of the protection domain in which volume resides. type: str sizeInGb: description: Size of the volume in Gb. type: int sizeInKb: description: Size of the volume in Kb. type: int snapshotPolicyId: description: ID of the snapshot policy associated with volume. type: str snapshotPolicyName: description: Name of the snapshot policy associated with volume. type: str snapshotsList: description: List of snapshots associated with the volume. type: str storagePoolId: description: ID of the storage pool in which volume resides. type: str storagePoolName: description: Name of the storage pool in which volume resides. type: str description: Details of the volume. returned: When volume exists sample: accessModeLimit: ReadWrite ancestorVolumeId: null autoSnapshotGroupId: null compressionMethod: Invalid consistencyGroupId: null creationTime: 1631618520 dataLayout: MediumGranularity id: cdd883cf00000002 links: - href: /api/instances/Volume::cdd883cf00000002 rel: self - href: /api/instances/Volume::cdd883cf00000002/relationships /Statistics rel: /api/Volume/relationship/Statistics - 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-volume-1 notGenuineSnapshot: false originalExpiryTime: 0 pairIds: null protectionDomainId: 9300c1f900000000 protectionDomainName: domain1 replicationJournalVolume: false replicationTimeStamp: 0 retentionLevels: [] secureSnapshotExpTime: 0 sizeInGB: 16 sizeInKb: 16777216 snapshotPolicyId: null snapshotPolicyName: null snapshotsList: - accessModeLimit: ReadOnly ancestorVolumeId: cdd883cf00000002 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 retentionLevels: [] secureSnapshotExpTime: 0 sizeInKb: 16777216 snplIdOfAutoSnapshot: null snplIdOfSourceVolume: null storagePoolId: e0d8f6c900000000 timeStampIsAccurate: false useRmcache: false volumeReplicationState: UnmarkedForReplication volumeType: Snapshot vtreeId: 6e86255c00000001 snplIdOfAutoSnapshot: null snplIdOfSourceVolume: null storagePoolId: e0d8f6c900000000 storagePoolName: pool1 timeStampIsAccurate: false useRmcache: false volumeReplicationState: UnmarkedForReplication volumeType: ThinProvisioned vtreeId: 6e86255c00000001 type: complex