dellemc.powerstore.dellemc_powerstore_volume (1.3.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>

preview | supported by community

Install collection

Install with ansible-galaxy collection install dellemc.powerstore:==1.3.0


Add to requirements.yml

  collections:
    - name: dellemc.powerstore
      version: 1.3.0

Description

Managing volume on PowerStore storage system includes create volume, get details of volume, modify name, size, description, protection policy, performance policy, map or unmap volume to host/host group, and delete volume.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create stand-alone volume
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    size: 1
    cap_unit: "{{cap_unit}}"
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create stand-alone volume with performance and protection policy
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    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'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create volume and assign to a volume group
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    vg_name: "{{vg_name}}"
    size: 1
    cap_unit: "{{cap_unit}}"
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create volume and map it to a host
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    size: 1
    cap_unit: "{{cap_unit}}"
    mapping_state: 'mapped'
    host: "{{host_name}}"
    state: 'present'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get volume details using ID
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_id: "{{result.volume_details.id}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get volume details using name
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify volume size, name, description and performance policy
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    new_name: "{{new_name}}"
    vol_name: "{{vol_name}}"
    state: "present"
    size: 2
    performance_policy: 'high'
    description: 'new description'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove protection policy from Volume
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    new_name: "{{new_name}}"
    vol_name: "{{vol_name}}"
    state: "present"
    protection_policy: ""
  • 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}}"
    verifycert: "{{verifycert}}"
    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: Map volume to a host without HLU
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    vol_name: "{{vol_name}}"
    state: 'present'
    mapping_state: 'mapped'
    host: 'host2'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete volume
  dellemc_powerstore_volume:
    array_ip: "{{array_ip}}"
    verifycert: "{{verifycert}}"
    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.
    required: false
    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

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.
    - present - indicates that the volume should exist on the system.
    - 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

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

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 '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

verifycert:
    choices:
    - true
    - false
    description:
    - Boolean variable to specify whether to validate SSL certificate or not.
    - True - indicates that the SSL certificate should be verified. Set the environment
      variable REQUESTS_CA_BUNDLE to the path of the SSL certificate.
    - False - indicates that the SSL certificate should not be verified.
    required: true
    type: bool

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

mapping_state:
    choices:
    - mapped
    - unmapped
    description:
    - Define whether the volume should be mapped to a host or hostgroup.
    - mapped - indicates that the volume should be mapped to the host or host group.
    - 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

protection_policy:
    description:
    - The 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 volume or
      later as well.
    - 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

performance_policy:
    choices:
    - high
    - medium
    - low
    description:
    - The performance_policy for the volume.
    - A volume can be assigned a performance policy at the time of creation of the volume,
      or later as well.
    - 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 'medium'.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  type: bool
volume_details:
  contains:
    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
    name:
      description: Name of the volume.
      type: str
    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
    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
  type: complex