dellemc / dellemc.powerflex / 2.3.0 / module / volume Manage volumes on Dell PowerFlex | "added in version" 1.0.0 of dellemc.powerflex" Authors: P Srinivas Rao (@srinivas-rao5) <ansible.team@dell.com>dellemc.powerflex.volume (2.3.0) — module
Install with ansible-galaxy collection install dellemc.powerflex:==2.3.0
collections: - name: dellemc.powerflex version: 2.3.0
Managing volumes on PowerFlex storage system includes creating, getting details, modifying attributes and deleting volume.
It also includes adding/removing snapshot policy, mapping/unmapping volume to/from SDC and listing associated snapshots.
- name: Create a volume dellemc.powerflex.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" 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.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" 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.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" 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.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" 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.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" port: "{{port}}" vol_id: "fe6c8b7100000005" state: "present"
- name: Modify the details of the Volume dellemc.powerflex.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" 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.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" port: "{{port}}" vol_name: "sample_volume" delete_snapshots: false state: "absent"
- name: Delete the Volume and all its dependent snapshots dellemc.powerflex.volume: hostname: "{{hostname}}" username: "{{username}}" password: "{{password}}" validate_certs: "{{validate_certs}}" 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 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 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 I(vol_id). - Mutually exclusive with I(vol_name). 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 'GB'. 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. - Mandatory for create operation. - It is unique across the PowerFlex array. - Mutually exclusive with I(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 use_rmcache: description: - Whether to use RM Cache or not. type: bool vol_new_name: description: - New name of the volume. Used to rename the volume. 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 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 I(storage_pool_name). type: str compression_type: choices: - NORMAL - NONE description: - Type of the compression method. type: str delete_snapshots: description: - If C(true), the volume and all its dependent snapshots will be deleted. - If C(false), only the volume will be deleted. - It can be specified only when the I(state) is C(absent). - It defaults to C(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 I(storage_pool_id). type: str snapshot_policy_id: description: - ID of the snapshot policy. - To remove/detach snapshot policy, empty I(snapshot_policy_id)/I(snapshot_policy_name) is to be passed along with I(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 I(protection_domain_name). type: str snapshot_policy_name: description: - Name of the snapshot policy. - To remove/detach snapshot policy, empty I(snapshot_policy_id)/I(snapshot_policy_name) is to be passed along with I(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 I(snapshot_policy_id)/I(snapshot_policy_name) is to be passed along with I(auto_snap_remove_type). - If the snapshot policy name/id is passed empty then I(auto_snap_remove_type) is defaulted to C(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 I(protection_domain_id). type: str allow_multiple_mappings: description: - Specifies whether to allow or not allow multiple mappings. - If the volume is mapped to one SDC then for every new mapping I(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: dict 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 statistics: contains: numOfChildVolumes: description: Number of child volumes. type: int numOfMappedSdcs: description: Number of mapped Sdcs of the volume. type: int description: Statistics details of the storage pool. type: dict 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 statistics: childVolumeIds: [] descendantVolumeIds: [] initiatorSdcId: null mappedSdcIds: - c42425XXXXXX numOfChildVolumes: 0 numOfDescendantVolumes: 0 numOfMappedSdcs: 1 registrationKey: null registrationKeys: [] replicationJournalVolume: false replicationState: UnmarkedForReplication reservationType: NotReserved rplTotalJournalCap: 0 rplUsedJournalCap: 0 userDataReadBwc: numOccured: 0 numSeconds: 0 totalWeightInKb: 0 userDataSdcReadLatency: numOccured: 0 numSeconds: 0 totalWeightInKb: 0 userDataSdcTrimLatency: numOccured: 0 numSeconds: 0 totalWeightInKb: 0 userDataSdcWriteLatency: numOccured: 0 numSeconds: 0 totalWeightInKb: 0 userDataTrimBwc: numOccured: 0 numSeconds: 0 totalWeightInKb: 0 userDataWriteBwc: numOccured: 0 numSeconds: 0 totalWeightInKb: 0 storagePoolId: e0d8f6c900000000 storagePoolName: pool1 timeStampIsAccurate: false useRmcache: false volumeReplicationState: UnmarkedForReplication volumeType: ThinProvisioned vtreeId: 6e86255c00000001 type: dict