dellemc.unity.volume (2.0.0) — module

Manage volume on Unity storage system

| "added in version" 1.1.0 of dellemc.unity"

Authors: Arindam Datta (@arindam-emc) <ansible.team@dell.com>, Pavan Mudunuri(@Pavan-Mudunuri) <ansible.team@dell.com>

Install collection

Install with ansible-galaxy collection install dellemc.unity:==2.0.0


Add to requirements.yml

  collections:
    - name: dellemc.unity
      version: 2.0.0

Description

Managing volume on Unity storage system includes- Create new volume, Modify volume attributes, Map Volume to host, Unmap volume to host, Display volume details, Delete volume.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Volume
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_name: "{{vol_name}}"
    description: "{{description}}"
    pool_name: "{{pool}}"
    size: 2
    cap_unit: "{{cap_GB}}"
    is_thin: true
    compression: true
    advanced_dedup: true
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Expand Volume by volume id
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_id: "{{vol_id}}"
    size: 5
    cap_unit: "{{cap_GB}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Volume, map host by host_name
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_name: "{{vol_name}}"
    host_name: "{{host_name}}"
    hlu: 5
    mapping_state: "{{state_mapped}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Volume, unmap host mapping by host_name
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_name: "{{vol_name}}"
    host_name: "{{host_name}}"
    mapping_state: "{{state_unmapped}}"
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Map multiple hosts to a Volume
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_id: "{{vol_id}}"
    hosts:
      - host_name: "10.226.198.248"
        hlu: 1
      - host_id: "Host_929"
        hlu: 2
    mapping_state: "mapped"
    state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify Volume attributes
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_name: "{{vol_name}}"
    new_vol_name: "{{new_vol_name}}"
    tiering_policy: "AUTOTIER"
    compression: true
    is_thin: true
    advanced_dedup: true
    state: "{{state_present}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Volume by vol name
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_name: "{{vol_name}}"
    state: "{{state_absent}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Volume by vol id
  dellemc.unity.volume:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    vol_id: "{{vol_id}}"
    state: "{{state_absent}}"

Inputs

    
sp:
    choices:
    - SPA
    - SPB
    description:
    - Storage Processor for this volume.
    type: str

hlu:
    description:
    - Host Lun Unit to be mapped/unmapped with this volume.
    - It is an optional parameter, hlu can be specified along with I(host_name) or I(host_id)
      and I(mapping_state).
    - If I(hlu) is not specified, unity will choose it automatically. The maximum value
      supported is C(255).
    type: int

port:
    default: 443
    description:
    - Port number through which communication happens with Unity management server.
    type: int

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

hosts:
    description:
    - Name of hosts for mapping to a volume.
    elements: dict
    suboptions:
      hlu:
        description:
        - Host Lun Unit to be mapped/unmapped with this volume.
        - It is an optional parameter, I(hlu) can be specified along with I(host_name)
          or I(host_id) and I(mapping_state).
        - If I(hlu) is not specified, unity will choose it automatically. The maximum
          value supported is C(255).
        type: str
      host_id:
        description:
        - ID of the host.
        type: str
      host_name:
        description:
        - Name of the host.
        type: str
    type: list

state:
    choices:
    - absent
    - present
    description:
    - State variable to determine whether volume will exist or not.
    required: true
    type: str

vol_id:
    description:
    - The id of the volume.
    - It can be used only for get, modify, map/unmap host, or delete operation.
    type: str

host_id:
    description:
    - ID of the host to be mapped/unmapped with this volume.
    - Either I(host_name) or I(host_id) can be specified in one task along with I(mapping_state).
    type: str

is_thin:
    description:
    - Boolean variable, Specifies whether or not it is a thin volume.
    - The value is set as C(true) by default if not specified.
    type: bool

pool_id:
    description:
    - This is the id of the pool where the volume will be created.
    - Either the I(pool_name) or I(pool_id) must be provided to create a new volume.
    type: str

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

password:
    description:
    - The password of the Unity management server.
    required: true
    type: str

username:
    description:
    - The username of the Unity management server.
    required: true
    type: str

vol_name:
    description:
    - The name of the volume. Mandatory only for create operation.
    type: str

host_name:
    description:
    - Name of the host to be mapped/unmapped with this volume.
    - Either I(host_name) or I(host_id) can be specified in one task along with I(mapping_state).
    type: str

pool_name:
    description:
    - This is the name of the pool where the volume will be created.
    - Either the I(pool_name) or I(pool_id) must be provided to create a new volume.
    type: str

compression:
    description:
    - Boolean variable, Specifies whether or not to enable compression. Compression is
      supported only for thin volumes.
    type: bool

description:
    description:
    - Description about the volume.
    - Description can be removed by passing empty string ("").
    type: str

new_vol_name:
    description:
    - New name of the volume for rename operation.
    type: str

mapping_state:
    choices:
    - mapped
    - unmapped
    description:
    - State of host access for volume.
    type: str

snap_schedule:
    description:
    - Snapshot schedule assigned to the volume.
    - Add/Remove/Modify the snapshot schedule for the volume.
    type: str

unispherehost:
    description:
    - IP or FQDN of the Unity management server.
    required: true
    type: str

advanced_dedup:
    description:
    - Boolean variable, Indicates whether or not to enable advanced deduplication.
    - Compression should be enabled to enable advanced deduplication.
    - It can only be enabled on the all flash high end platforms.
    - Deduplicated data will remain as is even after advanced deduplication is disabled.
    type: bool

tiering_policy:
    choices:
    - AUTOTIER_HIGH
    - AUTOTIER
    - HIGHEST
    - LOWEST
    description:
    - Tiering policy choices for how the storage resource data will be distributed among
      the tiers available in the pool.
    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

io_limit_policy:
    description:
    - IO limit policy associated with this volume. Once it is set, it cannot be removed
      through ansible module but it can be changed.
    type: str

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: true
  type: bool
volume_details:
  contains:
    current_sp:
      description: Current storage processor for this volume.
      type: str
    description:
      description: Description about the volume.
      type: str
    host_access:
      description: Host mapped to this volume.
      type: list
    id:
      description: The system generated ID given to the volume.
      type: str
    io_limit_policy:
      description: IO limit policy associated with this volume.
      type: dict
    is_data_reduction_enabled:
      description: Whether or not compression enabled on this volume.
      type: bool
    is_thin_enabled:
      description: Indicates whether thin provisioning is enabled for this volume.
      type: bool
    name:
      description: Name of the volume.
      type: str
    pool:
      description: The pool in which this volume is allocated.
      type: dict
    size_total_with_unit:
      description: Size of the volume with actual unit.
      type: str
    snap_schedule:
      description: Snapshot schedule applied to this volume.
      type: dict
    tiering_policy:
      description: Tiering policy applied to this volume.
      type: str
    wwn:
      description: The world wide name of this volume.
      type: str
  description: Details of the volume.
  returned: When volume exists
  sample:
    current_node: NodeEnum.SPB
    data_reduction_percent: 0
    data_reduction_ratio: 1.0
    data_reduction_size_saved: 0
    default_node: NodeEnum.SPB
    description: null
    effective_io_limit_max_iops: null
    effective_io_limit_max_kbps: null
    existed: true
    family_base_lun:
      UnityLun:
        hash: 8774954523796
        id: sv_27
    family_clone_count: 0
    hash: 8774954522426
    health:
      UnityHealth:
        hash: 8774954528278
    host_access:
    - accessMask: PRODUCTION
      hlu: 0
      id: Host_75
      name: 10.226.198.250
    id: sv_27
    io_limit_policy: null
    is_advanced_dedup_enabled: false
    is_compression_enabled: null
    is_data_reduction_enabled: false
    is_replication_destination: false
    is_snap_schedule_paused: false
    is_thin_clone: false
    is_thin_enabled: false
    metadata_size: 4294967296
    metadata_size_allocated: 4026531840
    name: VSI-UNITY-test-task
    per_tier_size_used:
    - 111400714240
    - 0
    - 0
    pool:
      id: pool_3
      name: Extreme_Perf_tier
    size_allocated: 107374182400
    size_total: 107374182400
    size_total_with_unit: 100.0 GB
    size_used: null
    snap_count: 0
    snap_schedule: null
    snap_wwn: 60:06:01:60:5C:F0:50:00:94:3E:91:4D:51:5A:4F:97
    snaps_size: 0
    snaps_size_allocated: 0
    storage_resource:
      UnityStorageResource:
        hash: 8774954518887
    tiering_policy: TieringPolicyEnum.AUTOTIER_HIGH
    type: LUNTypeEnum.VMWARE_ISCSI
    wwn: 60:06:01:60:5C:F0:50:00:00:B5:95:61:2E:34:DB:B2
  type: dict