dellemc.powerstore.volume (3.2.0) — module

Manage volumes on a PowerStore storage system

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

Authors: Ambuj Dubey (@AmbujDube) <ansible.team@dell.com>, Manisha Agrawal (@agrawm3) <ansible.team@dell.com>, Ananthu S Kuttattu (@kuttattz) <ansible.team@dell.com>, Bhavneet Sharma (@Bhavneet-Sharma) <ansible.team@dell.com>, Pavan Mudunuri(@Pavan-Mudunuri) <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 volume on PowerStore storage system includes create volume, get details of volume, modify volume attributes, map or unmap volume to host/host group, and delete volume.

Volume module also supports start or end of a metro configuration for a volume, clone, refresh and restore a volume.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create volume
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    size: 5
    cap_unit: "{{cap_unit}}"
    state: 'present'
    description: 'Description'
    performance_policy: 'low'
    protection_policy: 'protection_policy_name'
    vg_name: "{{vg_name}}"
    mapping_state: 'mapped'
    host: "{{host_name}}"
    app_type: "Relational_Databases_Other"
    app_type_other: "MaxDB"
    appliance_name: "Appliance_Name"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get volume details using ID
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_id: "{{result.volume_details.id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify volume size, name, description, protection,  performance policy and app_type
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    new_name: "{{new_name}}"
    vol_name: "{{vol_name}}"
    state: "present"
    size: 2
    performance_policy: 'high'
    description: 'new description'
    protection_policy: ''
    app_type: "Business_Applications_CRM"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Map volume to a host with HLU
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    state: 'present'
    mapping_state: 'mapped'
    host: 'host1'
    hlu: 12
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Clone a volume
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    clone_volume:
      name: 'test_name'
      description: 'test description'
      host: 'test_host'
      host_group: 'test_host_group'
      logical_unit_number: 1
      protection_policy: 'TEST_PP'
      performance_policy: 'low'
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Refresh a volume
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    source_volume_name: 'test1'
    create_backup_snap: true
    backup_snap_profile:
      name: 'refresh_backup_snap'
      description: 'test refresh_backup_snap'
      expiration_timestamp: '2022-12-23T01:20:00Z'
      performance_policy: 'low'
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Restore a volume
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    source_snap: 'refresh_backup_snap'
    create_backup_snap: true
    backup_snap_profile:
      name: 'restore_snap_2'
      description: 'test backup snap'
      expiration_timestamp: '2022-12-23T01:20:00Z'
      performance_policy: 'low'
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure a metro volume
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    remote_system: "remote-D123"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: End a metro volume configuration
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    end_metro_config: true
    delete_remote_volume: true
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete volume
  dellemc.powerstore.volume:
    array_ip: "{{array_ip}}"
    validate_certs: "{{validate_certs}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_id: "{{result.volume_details.id}}"
    state: "absent"

Inputs

    
hlu:
    description:
    - Logical unit number for the host/host group volume access.
    - Optional parameter when mapping a volume to host/host group.
    - HLU modification is not supported.
    type: int

host:
    description:
    - Host to be mapped/unmapped to a volume. If not specified, an unmapped volume is
      created. Only one of the host or host group can be supplied in one call.
    - To represent host, both name or ID can be used interchangeably. The module will
      detect both.
    type: str

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

size:
    description:
    - Size of the volume. Minimum volume size is 1MB. Maximum volume size is 256TB. Size
      must be a multiple of 8192.
    - Required in case of create and expand volume.
    type: float

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

state:
    choices:
    - absent
    - present
    description:
    - Define whether the volume should exist or not.
    - Value C(present) - indicates that the volume should exist on the system.
    - Value C(absent) - indicates that the volume should not exist on the system.
    required: true
    type: str

vol_id:
    description:
    - The 36 character long ID of the volume, automatically generated when a volume is
      created.
    - Cannot be used while creating a volume. All other functionalities on a volume are
      supported using 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

vg_name:
    description:
    - The name of the volume group. A volume can optionally be assigned to a volume group
      at the time of creation.
    - Use the Volume Group Module for modification of the assignment.
    type: str

app_type:
    choices:
    - Relational_Databases_Other
    - Relational_Databases_Oracle
    - Relational_Databases_SQL_Server
    - Relational_Databases_PostgreSQL
    - Relational_Databases_MySQL
    - Relational_Databases_IBM_DB2
    - Big_Data_Analytics_Other
    - Big_Data_Analytics_MongoDB
    - Big_Data_Analytics_Cassandra
    - Big_Data_Analytics_SAP_HANA
    - Big_Data_Analytics_Spark
    - Big_Data_Analytics_Splunk
    - Big_Data_Analytics_ElasticSearch
    - Business_Applications_Other
    - Business_Applications_ERP_SAP
    - Business_Applications_CRM
    - Business_Applications_Exchange
    - Business_Applications_Sharepoint
    - Healthcare_Other
    - Healthcare_Epic
    - Healthcare_MEDITECH
    - Healthcare_Allscripts
    - Healthcare_Cerner
    - Virtualization_Other
    - Virtualization_Virtual_Servers_VSI
    - Virtualization_Containers_Kubernetes
    - Virtualization_Virtual_Desktops_VDI
    - Other
    description:
    - Application type to indicate the intended use of the volume.
    type: str

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

cap_unit:
    choices:
    - MB
    - GB
    - TB
    description:
    - Volume size unit.
    - Used to signify unit of the size provided for creation and expansion of volume.
    - It defaults to C(GB), if not specified.
    type: str

new_name:
    description:
    - The new volume name for the volume, used in case of rename functionality.
    type: str

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

vol_name:
    description:
    - Unique name of the volume. This value must contain 128 or fewer printable unicode
      characters.
    - Required when creating a volume. All other functionalities on a volume are supported
      using volume name or ID.
    type: str

hostgroup:
    description:
    - Hostgroup to be mapped/unmapped to a volume. If not specified, an unmapped volume
      is created.
    - Only one of the host or host group can be mapped in one call.
    - To represent a hostgroup, both name or ID can be used interchangeably. The module
      will detect both.
    type: str

description:
    description:
    - Description for the volume.
    - Optional parameter when creating a volume.
    - To modify, pass the new value in description field.
    type: str

source_snap:
    description:
    - Unique identifier or name of the source snapshot that will be used for the restore
      operation.
    type: str

appliance_id:
    description:
    - ID of the appliance on which the volume is provisioned.
    - I(appliance_id) and I(appliance_name) are mutually exclusive.
    type: str

clone_volume:
    description:
    - Details of the volume clone.
    suboptions:
      description:
        description:
        - Description of the clone.
        type: str
      host:
        description:
        - Unique identifier or name of the host to be attached to the clone.
        type: str
      host_group:
        description:
        - Unique identifier or name of the host group to be attached to the clone.
        type: str
      logical_unit_number:
        description:
        - logical unit number when creating a C(mapped) volume.
        - If no C(host_id) or C(host_group_id) is specified, C(logical_unit_number) is
          ignored.
        type: int
      name:
        description:
        - Name of the clone set to be created.
        type: str
      performance_policy:
        choices:
        - high
        - medium
        - low
        description:
        - The performance policy of the clone set to be created.
        type: str
      protection_policy:
        description:
        - The protection policy of the clone set to be created.
        type: str
    type: dict

mapping_state:
    choices:
    - mapped
    - unmapped
    description:
    - Define whether the volume should be mapped to a host or hostgroup.
    - Value C(mapped) - indicates that the volume should be mapped to the host or host
      group.
    - Value C(unmapped) - indicates that the volume should not be mapped to the host or
      host group.
    - Only one of a host or host group can be supplied in one call.
    type: str

remote_system:
    description:
    - The remote system to which metro relationship will be established.
    - The remote system must support metro volume.
    - This is mandatory while configuring a metro volume.
    - To represent remote system, both name and ID are interchangeable.
    - This parameter is added in PowerStore version 3.0.0.0.
    type: str

source_volume:
    description:
    - Unique identifier or name of the volume to refresh from.
    type: str

app_type_other:
    description:
    - Application type for volume when I(app_type) is set to C(*Other) types.
    type: str

appliance_name:
    description:
    - Name of the appliance on which the volume is provisioned.
    - I(appliance_id) and I(appliance_name) are mutually exclusive.
    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

end_metro_config:
    default: false
    description:
    - Whether to end the metro session from a volume.
    - This is mandatory for end metro configuration operation.
    type: bool

protection_policy:
    description:
    - The I(protection_policy) of the volume.
    - To represent policy, both name or ID can be used interchangably. The module will
      detect both.
    - A volume can be assigned a protection policy at the time of creation of the volume
      or later.
    - The policy can also be changed for a given volume by simply passing the new value.
    - The policy can be removed by passing an empty string.
    - Check examples for more clarity.
    type: str

create_backup_snap:
    description:
    - Indicates whether a backup snapshot of the target volume will be created or not.
    type: bool

performance_policy:
    choices:
    - high
    - medium
    - low
    description:
    - The I(performance_policy) for the volume.
    - A volume can be assigned a performance policy at the time of creation of the volume,
      or later.
    - The policy can also be changed for a given volume, by simply passing the new value.
    - Check examples for more clarity.
    - If not given, performance policy will be C(medium).
    type: str

backup_snap_profile:
    description:
    - Details of the backup snapshot set to be created.
    suboptions:
      description:
        description:
        - Description of the backup snapshot set.
        type: str
      expiration_timestamp:
        description:
        - Time after which the snapshot set can be auto-purged.
        type: str
      name:
        description:
        - Name of the backup snapshot set to be created.
        - The default name of the volume snapshot is the date and time when the snapshot
          is taken.
        type: str
      performance_policy:
        choices:
        - high
        - medium
        - low
        description:
        - Performance policy assigned to the snapshot.
        type: str
    type: dict

remote_appliance_id:
    description:
    - A remote system appliance ID to which volume will be assigned.
    - This parameter is added in PowerStore version 3.0.0.0.
    type: str

delete_remote_volume:
    description:
    - Whether to delete the remote volume during removal of metro session.
    - This is parameter is added in the PowerStore version 3.0.0.0.
    type: bool

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: 'false'
  type: bool
is_volume_cloned:
  description: Whether or not the clone of volume is created.
  returned: always
  sample: 'false'
  type: bool
is_volume_refreshed:
  description: Whether or not the volume is refreshed.
  returned: always
  sample: 'false'
  type: bool
is_volume_restored:
  description: Whether or not the volume is restored.
  returned: always
  sample: 'false'
  type: bool
volume_details:
  contains:
    app_type:
      description: Application type indicating the intended use of the volume.
      type: str
    app_type_other:
      description: Application type for volume when app_type is set to *Other.
      type: str
    appliance_id:
      description: ID of appliance on which the volume is provisioned.
      type: str
    appliance_name:
      description: Name of appliance on which the volume is provisioned.
      type: str
    description:
      description: description about the volume.
      type: str
    hlu_details:
      contains:
        host_group_id:
          description: The Host group ID mapped to the volume.
          type: str
        host_id:
          description: The Host ID mapped to the volume.
          type: str
        id:
          description: The HLU ID.
          type: str
        logical_unit_number:
          description: Logical unit number for the host/host group volume access.
          type: int
      description: HLU details for mapped host/host group.
      type: complex
    host:
      contains:
        id:
          description: The Host ID mapped to the volume.
          type: str
        name:
          description: Name of the Host mapped to the volume.
          type: str
      description: Hosts details mapped to the volume.
      type: complex
    host_group:
      contains:
        id:
          description: The Host group ID mapped to the volume.
          type: str
        name:
          description: Name of the Host group mapped to the volume.
          type: str
      description: Host groups details mapped to the volume.
      type: complex
    id:
      description: The system generated ID given to the volume.
      type: str
    mapped_volumes:
      contains:
        id:
          description: Unique identifier of a mapping between a host and a volume.
          type: str
        logical_unit_number:
          description: Logical unit number for the host volume access.
          type: int
      description: This is the inverse of the resource type host_volume_mapping association.
      type: complex
    metro_replication_session_id:
      description: The ID of the metro replication session assigned to volume.
      type: str
    name:
      description: Name of the volume.
      type: str
    nguid:
      description: NVMe Namespace globally unique identifier. Used for volumes attached
        to NVMEoF hosts.
      type: int
    node_affinity:
      description: This attribute shows which node will be advertised as the optimized
        IO path to the volume.
      type: str
    nsid:
      description: NVMe Namespace unique identifier in the NVME subsystem. Used for
        volumes attached to NVMEoF hosts.
      type: int
    performance_policy_id:
      description: The performance policy for the volume.
      type: str
    protection_policy_id:
      description: The protection policy of the volume.
      type: str
    size:
      description: Size of the volume.
      type: int
    snapshots:
      contains:
        id:
          description: The system generated ID given to the snapshot.
          type: str
        name:
          description: Name of the snapshot.
          type: str
      description: List of snapshot associated with the volume.
      type: complex
    volume_groups:
      contains:
        id:
          description: The system generated ID given to the volume group.
          type: str
        name:
          description: Name of the volume group.
          type: str
      description: The volume group details of the volume.
      type: complex
    wwn:
      description: The world wide name of the volume.
      type: str
  description: Details of the volume.
  returned: When volume exists
  sample:
    appliance_id: A1
    creation_timestamp: '2022-01-06T05:41:59.381459+00:00'
    description: Volume 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_volume
    nguid: nguid.ac8ab0e2506d99be8ccf096800e29e40
    node_affinity: System_Select_At_Attach
    node_affinity_l10n: System Select At Attach
    nsid: 54768
    performance_policy:
      id: default_medium
      name: Medium
    performance_policy_id: default_medium
    protection_data:
      copy_signature: null
      created_by_rule_id: null
      created_by_rule_name: null
      creator_type: User
      creator_type_l10n: User
      expiration_timestamp: null
      family_id: 634e4b95-e7bd-49e7-957b-6dc932642464
      is_app_consistent: false
      parent_id: null
      source_id: null
      source_timestamp: null
    protection_policy:
      id: 4bbb6333-59e4-489c-9015-c618d3e8384b
      name: sample_protection_policy
    protection_policy_id: 4bbb6333-59e4-489c-9015-c618d3e8384b
    size: 1073741824
    snapshots:
    - id: 2a07be43-xxxx-4fd0-xxxx-18eaa4081bd9
      name: sample_snap_2
    state: Ready
    state_l10n: Ready
    type: Primary
    type_l10n: Primary
    volume_groups: []
    wwn: naa.68ccf09800ac8ab0e2506d99bee29e40
  type: complex