dellemc.unity.consistencygroup (2.0.0) — module

Manage consistency groups on Unity storage system

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

Authors: Akash Shendge (@shenda1) <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 the consistency group on the Unity storage system includes creating new consistency group, adding volumes to consistency group, removing volumes from consistency group, mapping hosts to consistency group, unmapping hosts from consistency group, renaming consistency group, modifying attributes of consistency group, enabling replication in consistency group, disabling replication in consistency group and deleting consistency group.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      validate_certs: "{{validate_certs}}"
      username: "{{username}}"
      password: "{{password}}"
      cg_name: "{{cg_name}}"
      description: "{{description}}"
      snap_schedule: "{{snap_schedule1}}"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get details of consistency group using id
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_id: "{{cg_id}}"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add volumes to consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_id: "{{cg_id}}"
      volumes:
          - vol_name: "Ansible_Test-3"
          - vol_id: "sv_1744"
      vol_state: "{{vol_state_present}}"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Rename consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_name: "{{cg_name}}"
      new_cg_name: "{{new_cg_name}}"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify consistency group details
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_name: "{{new_cg_name}}"
      snap_schedule: "{{snap_schedule2}}"
      tiering_policy: "{{tiering_policy1}}"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Map hosts to a consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_id: "{{cg_id}}"
      hosts:
          - host_name: "10.226.198.248"
          - host_id: "Host_511"
      mapping_state: "mapped"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Unmap hosts from a consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_id: "{{cg_id}}"
      hosts:
          - host_id: "Host_511"
          - host_name: "10.226.198.248"
      mapping_state: "unmapped"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove volumes from consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_name: "{{new_cg_name}}"
      volumes:
          - vol_name: "Ansible_Test-3"
          - vol_id: "sv_1744"
      vol_state: "{{vol_state_absent}}"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_name: "{{new_cg_name}}"
      state: "absent"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable replication for consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_id: "cg_id_1"
      replication_params:
          destination_cg_name: "destination_cg_1"
          replication_mode: "asynchronous"
          rpo: 60
          replication_type: "remote"
          remote_system:
              remote_system_host: '10.1.2.3'
              remote_system_verifycert: false
              remote_system_username: 'username'
              remote_system_password: 'password'
          destination_pool_name: "pool_test_1"
      replication_state: "enable"
      state: "present"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable replication for consistency group
  dellemc.unity.consistencygroup:
      unispherehost: "{{unispherehost}}"
      username: "{{username}}"
      password: "{{password}}"
      validate_certs: "{{validate_certs}}"
      cg_name: "dis_repl_ans_source"
      replication_state: "disable"
      state: "present"

Inputs

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

cg_id:
    description:
    - The ID of the consistency group.
    - It can be used only for get, modify, add/remove volumes, or delete operations.
    type: str

hosts:
    description:
    - This is a list of hosts.
    - Either the host ID or name must be provided for mapping/unmapping hosts for a consistency
      group.
    - If I(hosts) are given, then I(mapping_state) should also be specified.
    - Hosts cannot be mapped to a consistency group, if the consistency group has no volumes.
    - When a consistency group is being mapped to the host, users should not use the volume
      module to map the volumes in the consistency group to hosts.
    elements: dict
    suboptions:
      host_id:
        description:
        - The ID of the host.
        type: str
      host_name:
        description:
        - The name of the host.
        type: str
    type: list

state:
    choices:
    - absent
    - present
    description:
    - Define whether the consistency group should exist or not.
    required: true
    type: str

cg_name:
    description:
    - The name of the consistency group.
    - It is mandatory for the create operation.
    - Specify either I(cg_name) or I(cg_id) (but not both) for any operation.
    type: str

volumes:
    description:
    - This is a list of volumes.
    - Either the volume ID or name must be provided for adding/removing existing volumes
      from consistency group.
    - If I(volumes) are given, then I(vol_state) should also be specified.
    - Volumes cannot be added/removed from consistency group, if the consistency group
      or the volume has snapshots.
    elements: dict
    suboptions:
      vol_id:
        description:
        - The ID of the volume.
        type: str
      vol_name:
        description:
        - The name of the volume.
        type: str
    type: list

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_state:
    choices:
    - present-in-group
    - absent-in-group
    description:
    - String variable, describes the state of volumes inside consistency group.
    - If I(volumes) are given, then I(vol_state) should also be specified.
    type: str

description:
    description:
    - Description of the consistency group.
    type: str

new_cg_name:
    description:
    - The new name of the consistency group, used in rename operation.
    type: str

mapping_state:
    choices:
    - mapped
    - unmapped
    description:
    - String variable, describes the state of hosts inside the consistency group.
    - If I(hosts) are given, then I(mapping_state) should also be specified.
    type: str

snap_schedule:
    description:
    - Snapshot schedule assigned to the consistency group.
    - Specifying an empty string "" removes the existing snapshot schedule from consistency
      group.
    type: str

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

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

replication_state:
    choices:
    - enable
    - disable
    description:
    - State of the replication.
    type: str

replication_params:
    description:
    - Settings required for enabling replication.
    suboptions:
      destination_cg_name:
        description:
        - Name of the destination consistency group.
        - Default value will be source consistency group name prefixed by 'DR_'.
        type: str
      destination_pool_id:
        description:
        - Id of pool to allocate destination Luns.
        - Mutually exclusive with I(destination_pool_name).
        type: str
      destination_pool_name:
        description:
        - Name of pool to allocate destination Luns.
        - Mutually exclusive with I(destination_pool_id).
        type: str
      remote_system:
        description:
        - Details of remote system to which the replication is being configured.
        - The I(remote_system) option should be specified if the I(replication_type) is
          C(remote).
        suboptions:
          remote_system_host:
            description:
            - IP or FQDN for remote Unity unisphere Host.
            required: true
            type: str
          remote_system_password:
            description:
            - Password of remote Unity unisphere Host.
            required: true
            type: str
          remote_system_port:
            default: 443
            description:
            - Port at which remote Unity unisphere is hosted.
            type: int
          remote_system_username:
            description:
            - User name of remote Unity unisphere Host.
            required: true
            type: str
          remote_system_verifycert:
            default: true
            description:
            - Boolean variable to specify whether or not to validate SSL certificate of
              remote Unity unisphere Host.
            - C(true) - Indicates that the SSL certificate should be verified.
            - C(false) - Indicates that the SSL certificate should not be verified.
            type: bool
        type: dict
      replication_mode:
        choices:
        - asynchronous
        - manual
        description:
        - The replication mode.
        required: true
        type: str
      replication_type:
        choices:
        - local
        - remote
        default: local
        description:
        - Type of replication.
        type: str
      rpo:
        description:
        - Maximum time to wait before the system syncs the source and destination LUNs.
        - Option I(rpo) should be specified if the I(replication_mode) is C(asynchronous).
        - The value should be in range of C(5) to C(1440).
        type: int
    type: dict

Outputs

changed:
  description: Whether or not the resource has changed.
  returned: always
  sample: true
  type: bool
consistency_group_details:
  contains:
    block_host_access:
      contains:
        UnityBlockHostAccessList:
          contains:
            UnityBlockHostAccess:
              contains:
                id:
                  description: The ID of the host.
                  type: str
                name:
                  description: The name of the host.
                  type: str
              description: Details of host.
              type: dict
          description: List of hosts mapped to consistency group.
          type: list
      description: Details of hosts mapped to the consistency group.
      type: dict
    cg_replication_enabled:
      description: Whether or not the replication is enabled..
      type: bool
    id:
      description: The system ID given to the consistency group.
      type: str
    luns:
      contains:
        UnityLunList:
          contains:
            UnityLun:
              contains:
                id:
                  description: The system ID given to volume.
                  type: str
                name:
                  description: The name of the volume.
                  type: str
              description: Detail of volume.
              type: dict
          description: List of volumes part of consistency group.
          type: list
      description: Details of volumes part of consistency group.
      type: dict
    relocation_policy:
      description: FAST VP tiering policy for the consistency group.
      type: str
    snap_schedule:
      contains:
        UnitySnapSchedule:
          contains:
            id:
              description: The system ID given to the snapshot schedule.
              type: str
            name:
              description: The name of the snapshot schedule.
              type: str
          description: Snapshot schedule applied to consistency group.
          type: dict
      description: Snapshot schedule applied to consistency group.
      type: dict
    snapshots:
      contains:
        creation_time:
          description: Date and time on which the snapshot was taken.
          type: str
        expirationTime:
          description: Date and time after which the snapshot will expire.
          type: str
        name:
          description: Name of the snapshot.
          type: str
        storageResource:
          contains:
            UnityStorageResource:
              contains:
                id:
                  description: The id of the storage resource.
                  type: str
              description: Details of the storage resource.
              type: dict
          description: Storage resource for which the snapshot was taken.
          type: dict
      description: List of snapshots of consistency group.
      type: list
  description: Details of the consistency group.
  returned: When consistency group exists
  sample:
    advanced_dedup_status: DedupStatusEnum.DISABLED
    block_host_access: null
    cg_replication_enabled: false
    data_reduction_percent: 0
    data_reduction_ratio: 1.0
    data_reduction_size_saved: 0
    data_reduction_status: DataReductionStatusEnum.DISABLED
    datastores: null
    dedup_status: null
    description: Ansible testing
    esx_filesystem_block_size: null
    esx_filesystem_major_version: null
    existed: true
    filesystem: null
    hash: 8776023812033
    health:
      UnityHealth:
        hash: 8776023811889
    host_v_vol_datastore: null
    id: res_7477
    is_replication_destination: false
    is_snap_schedule_paused: null
    luns: null
    metadata_size: 0
    metadata_size_allocated: 0
    name: Ansible_CG_Testing
    per_tier_size_used: null
    pools: null
    relocation_policy: TieringPolicyEnum.MIXED
    replication_type: ReplicationTypeEnum.NONE
    size_allocated: 0
    size_total: 0
    size_used: null
    snap_count: 0
    snap_schedule: null
    snaps_size_allocated: 0
    snaps_size_total: 0
    snapshots: []
    thin_status: ThinStatusEnum.FALSE
    type: StorageResourceTypeEnum.CONSISTENCY_GROUP
    virtual_volumes: null
    vmware_uuid: null
  type: dict