Giter Club home page Giter Club logo

ansible-powermax's Introduction

Ansible Modules for Dell Technologies PowerMax

The Ansible modules for Dell Technologies (Dell) PowerMax allow data center and IT administrators to use RedHat Ansible to automate and orchestrate the configuration and management of Dell PowerMax arrays.

The capabilities of Ansible modules are managing volumes, storage groups, ports, port groups, hosts, host groups, masking views, initiators, snapshots, SRDF links, RDF groups, Metro DR environments, jobs, snapshot policies, storage pools and gathering high-level facts about the arrays. The options available for each capability are list, show, create, delete, and modify. These tasks are performed by running simple playbooks written in YAML syntax. The modules are written so that all the operations are idempotent, therefore making multiple identical requests has the same effect as making a single request.

Table of contents

License

Ansible collection for PowerMax is released and licensed under the GPL-3.0 license. See LICENSE for the full terms. Ansible modules and modules utilities that are part of the Ansible collection for PowerMax are released and licensed under the Apache 2.0 license. See MODULE-LICENSE for the full terms.

Supported platforms

Dell PowerMax and VMAX All Flash arrays support Unisphere version 9.2 and later.

Prerequisites

This table provides information about the software prerequisites for the Ansible Modules for Dell PowerMax.

Ansible modules Unisphere version PowerMaxOS Python version Python library version Ansible
v3.0.0 9.2
10.0
10.1
5978.444.444
5978.669.669
5978.711.711
6079.xxx.xxx
3.9.x
3.10.x
3.11.x
9.2.x.x
10.0.x.x
10.1.x.x
2.14
2.15
2.16

Idempotency

The modules are written in such a way that all requests are idempotent and hence fault-tolerant. This means that the result of a successfully performed request is independent of the number of times it is performed.

List of Ansible modules for Dell PowerMax

Installation and execution of Ansible modules for Dell PowerMax

The installation and execution steps of Ansible modules for Dell PowerMax can be found here.

Maintenance

Ansible modules for Dell Technologies PowerMax deprecation cycle is aligned with Ansible.

ansible-powermax's People

Contributors

anil-degwekar avatar astripei70 avatar bhavneet-sharma avatar dattaarindam avatar jennifer-john avatar kharerajshree avatar meenakshidembi691 avatar pavan-mudunuri avatar rajendraindukuri avatar tharun-vr avatar trisha-dell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-powermax's Issues

Module is not idempotent when creating a new host

We are currently deploying our PowerMax setup via Ansible and we notice that when creating a new host, the code doesn't appear to be idempotent.

See attached image;

powermax_new_host_github

The following code is being used to deploy that ( a bit sanitized);

- name: "Create PowerMax host for {{ host }}"
dellemc.powermax.dellemc_powermax_host:
unispherehost: "{{ host }}"
universion: "{{ version }}"
verifycert: "{{ verifycert }}"
serial_no: "{{ serial }}"
user: "{{ username }}"
password: "{{ password }}"
host_name: "{{ host_name"
host_type: "default"
state: "present"
initiator_state: "present-in-host"
initiators: "{{ initiators }}"

[FEATURE]: dellemc.powermax.storagegroup - Make vol_name an optional argument

Currently when using the storagegroup module to create new volumes to an existing storage group, vol_name needs to be provided to label the volume. Is there any way of not making vol_name a required input? There's no requirement in the storage array to label a volume when creating volumes for a SG. Currently I add a randomly generated string to vol_name to be able to use this module to create volumes to a SG over and over again without any vol_names conflicting.

Or is there any other way of achieving the very same thing without having to add a random string to vol_name?

  • name: Create new volumes for existing SG
    dellemc.powermax.storagegroup:
    unispherehost: "{{unispherehost}}"
    universion: "{{universion}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    serial_no: "{{serial_no}}"
    sg_name: "foo"
    state: "present"
    volumes:
    • vol_name: "bar"
      size: 1
      cap_unit: "GB"
      vol_state: "present-in-group"

When not using a unique vol_name it does return:

"msg": "A volume with identifier bar but different size 6.0 GB already exists. Use a different identifier for volume creation. Currently, we support only unique identifiers for volume creation on PowerMax from Ansible"

[BUG]: Info Module is looping on all masking views to filter for lun addresses

Describe the bug
Info Module is looping on all masking views to filter for lun addresses

To Reproduce
Steps to reproduce the behavior:
- name: Get list of masking view connections with filter
dellemc.powermax.info:
unispherehost: "{{localDetail.mgmt_server}}"
universion: "{{universion}}"
verifycert: "{{verifycert}}"
user: "{{credential.username}}"
password: "{{credential.password}}"
serial_no: "{{localDetail.array}}"
gather_subset:
- mv_connections
filters:
- filter_key: "volume_id"
filter_operator: "equal"
filter_value: "{{item.volumeId}}"
loop: "{{ volDetail }}"
register: mvConnResponse

...
n. Step n See error
Code is
def get_mv_connections_list(self, filters_dict=None):
"""Get the list of masking view connections of a given PowerMax or VMAX storage
system"""

    try:
        LOG.info('Getting Masking View Connections List')
        array_serial_no = self.module.params['serial_no']
        masking_view_list = self.get_masking_view_list()
        mv_connections_list = []
        for masking_view_id in masking_view_list:
            connections = self.provisioning.get_masking_view_connections(masking_view_id, filters=filters_dict)
            if connections:
                mv_connections_list.append(
                    {
                        'masking_view_id': masking_view_id,
                        'masking_view_connections': connections
                    }
                )
        LOG.info('Got %d Getting Masking Views Connections from array %s',
                 len(mv_connections_list), array_serial_no)
        return mv_connections_list

Expected behavior
Customer should be able to filter on masking view, to correct a new optional paramter for masking view name should be allowed which would avoid the loop

System Information (please complete the following information):

  • Ansible Collection - Latest

Additional context
Masking view connections REST API is intensive on API server so running this the way it is is potentially going to slow down unisphere server for customer with large number of masking views.

[FEATURE]: Add support for getting volume pair information for a SRDF group

Describe the solution you'd like
Add support for getting the volume pairs information for the SRDF group for a specific volume. The current ansible module retrieves all the devices in the RDF group and then we need to filter the information for a particular volume ID.

- name: Get the details of rdf group and volumes
  dellemc.powermax.rdfgroup:
    unispherehost: "{{unispherehost}}"
    universion: "{{universion}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    serial_no: "{{serial_no}}"
    rdfgroup_number: "{{rdfgroup_id}}"

Describe alternatives you've considered
Using the ansible.builtin.uri module to retrieve this information

- name: Collect Device pair information through API
      uri:
        url: "https://{{unispherehost}}:8443/univmax/restapi/92/replication/symmetrix/{{serial_no}}/rdf_group/{{rdfg}}/volume/{{item}}"
        method: GET

Additional context
Add any other context or screenshots about the feature request here.

[BUG]: ansible-builder introspect fails with file not found

Describe the bug
When attempting to install this collection into an execution environment via the ansible-builder command, the build fails with an error that the requirements.txt file is not found. This appears to be caused by the use of a relative path in the meta/execution-environment.yml file.

To Reproduce
Steps to reproduce the behavior:

  1. Step 1 install the collection with ansible-galaxy collection install dellemc.powermax
  2. Step 2 test collection with ansible-builder introspect --sanitize ~/.ansible/collections/
  3. Step 3 see error
    Expected requirements file not present at: /home/user/.ansible/collections/ansible_collections/dellemc/requirements.txt
    FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.ansible/collections/ansible_collections/dellemc/powermax/../requirements.txt'
    Note the parent folder reference ../requirements.txt
  4. Step 4 edit meta/execution-environment.yml and remove the relative path
---
version: 1
dependencies:
  galaxy: requirements.yml
  python: requirements.txt
  1. Step 5 test collection again and see proper output

Expected behavior
ansible-builder introspect command should list correct dependencies

---
python:
- 'urllib3>=1.26.7  # from collection dellemc.powermax'
- 'PyU4V>=9.1.2.0  # from collection dellemc.powermax'
- 'setuptools  # from collection dellemc.powermax'

System Information (please complete the following information):
ansible --version
ansible [core 2.12.1]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.8/site-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.8.8 (default, Aug 25 2021, 16:13:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
jinja version = 2.10.3
libyaml = True

[FEATURE]: Ability to force move devices between storage groups if SRDF Protected

Describe the solution you'd like
When moving devices that are SRDF protected the Ansible, moving of devices is blocked. API will allow me to do this. Customer HSBC have reverted to URI module to accomplish this

Describe alternatives you've considered
URI Module

Additional context
Customer needs to be able to force move devices in and out of SRDF storage groups keeping SRDF protection on the devices even if it will render them unmanageable, they maintain separate SG for SRDF and Provisioning so this is a common occurrence for them and a blocker for ansible

[FEATURE]: Add volume_identifier to info module 'vol' subset

Describe the solution you'd like
Currently info.py module doesn't return volume_identifier of volumes as part of return dictionary, but is able to filter on it.
volume_identifier is only seen on volume_details in volume.py module, but that require to querying multiple volumes in loop.

Describe alternatives you've considered
Query multiple volumes in loop using volume.py, but that approach is slow.

Additional context
We manage volumes/devices using volume_identifier, so having it returned from info.py (like volume name in different storage array modules) could be helpfull.

[QUESTION]: how to get details (IG/SG/PG) about specific MV?

We are trying to get details about specific masking view - what initiator group, storage group and port group it contains, but looks like such functionality is not available in current version of ansible-powermax. Isn't it?

We can get MV based on initiator group name (with a help of host_or_host_group_name filter), but how to know what storage group (SG) and port group (PG) is part of the same MV?

[BUG]: Unable to Create a New Volume without vol_name

Describe the bug

I was testing a volume create automation using dellemc.powermax.volume module. I was able to create a volume from Unisphere GUI without providing a volume name but when I tried to create the same usning ansible module without vol_name getting error "one of the following is required: vol_id, vol_name, vol_wwn". But as per our standard practice name/id/wwn we let autoassign by array and also vol_name is marked as mandatory field as per documentation

To Reproduce
Steps to reproduce the behavior:

  1. Create a new playbook as per following template

  • name: Volume operations on VMAX
    hosts: localhost
    connection: local
    vars:
    unispherehost: '10.XX.XX.XX'
    universion: '101'
    verifycert: false
    user: 'user'
    password: 'password'
    serial_no: '000123456789'
    sg_name: 'Test'
    new_sg_name: 'Ansible_Move_Volume_Testing'
    vol_name: 'Volume'
    cap_unit: 'GB'
    append_vol_id: false

    tasks:
    - name: Create volume
    register: result
    dellemc.powermax.volume:
    unispherehost: "{{ unispherehost }}"
    universion: "{{ universion }}"
    verifycert: "{{ verifycert }}"
    user: "{{ user }}"
    password: "{{ password }}"
    serial_no: "{{ serial_no }}"
    sg_name: "{{ sg_name }}"
    size: 1
    cap_unit: "{{ cap_unit }}"
    append_vol_id: "{{ append_vol_id }}"
    state: 'present'

  1. Run the playbook
  2. We should see the similar error as mentioned above
    ...
    n. Step n See error

Expected behavior
Playbook task should execute without providing vol_name/vol_id/vol_wwn as per similar behavior as volume creation from GUI

Screenshots
N/A

Logs
"one of the following is required: vol_id, vol_name, vol_wwn"

System Information (please complete the following information):

  • OS/Version: RHEL 8.9
  • Ansible Version: 2.15.10
  • Python Version: 3.9.18
  • Ansible-navigator Version: 3.4.1
  • ansible-powermax Version: 3.0.0

Additional context
N/A

[BUG]: Host WWNs not idempotent if input in different case

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  • name: Create Child initiato groups
    dellemc.powermax.host:
    unispherehost: "{{unispherehost}}"
    universion: "{{universion}}"
    verifycert: "{{verifycert}}"
    user: "{{user}}"
    password: "{{password}}"
    serial_no: "{{serial_no}}"
    host_name: "{{'IG_'+item.name | upper }}"
    host_flags:
    consistent_lun: true
    state: 'present'
    initiators: "{{ item.initiators}}"
    initiator_state: 'present-in-host'
    register: childIgCreateResponse
    loop: "{{ hosts }}"
    ...
    hosts:
    • name: "REGTESTESX041"
      initiators:
      • "3311111111111EA2"
      • "3311111111111EA3"
    • name: "REGTESTESX042"
      initiators:
      • "3311111111111EA4"
      • "3311111111111EA5"

n. Step n See error

failed: [localhost] (item={'name': 'REGTESTESX041', 'initiators': ['3311111111111EA2', '3311111111111EA3']}) => {"ansible_loop_var": "item", "changed": false, "item": {"initiators": ["3311111111111EA2", "3311111111111EA3"], "name": "REGTESTESX041"}, "msg": "Adding initiators ['3311111111111EA2', '3311111111111EA3'] to host IG_REGTESTESX041 failed with error Bad or unexpected response from the storage volume backend API: Error PUT symmetrix resource. The status code received is 500 and the message is {'message': 'A problem occurred modifying the host resource: Error for: 000297900442/IG_REGTESTESX041: The operation can not be performed because the group is already in this state'}."}
failed: [localhost] (item={'name': 'REGTESTESX042', 'initiators': ['3311111111111EA4', '3311111111111EA5']}) => {"ansible_loop_var": "item", "changed": false, "item": {"initiators": ["3311111111111EA4", "3311111111111EA5"], "name": "REGTESTESX042"}, "msg": "Adding initiators ['3311111111111EA5', '3311111111111EA4'] to host IG_REGTESTESX042 failed with error Bad or unexpected response from the storage volume backend API: Error PUT symmetrix resource. The status code received is 500 and the message is {'message': 'A problem occurred modifying the host resource: Error for: 000297900442/IG_REGTESTESX042: The operation can not be performed because the group is already in this state'}."}

Expected behavior
Module should not care about case, WWN should be normalised on API side to match for idempotency regardless of upper|lower this is the behaviour in PowerMax CLI

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
If applicable, submit logs or stack traces from the affected services

System Information (please complete the following information):

  • OS/Version: RHEL 8.2
  • PowerMax Collection 1.8

Additional context
Add any other context about the problem here.

[FEATURE]: Add Unisphere port parameter

Describe the solution you'd like
Allow the possibility to set a different port then the default 8443 hardcoded one.

Describe alternatives you've considered
A port-forwarding iptables rule

[BUG]:fatal: [localhost]: FAILED! => {"changed": false, "msg": "Delete storage group X999RSWP_12312423_tmp99CRTEST_RSWP failed with error get_storage_group_snapshot_generation_list() got an unexpected keyword argument 'storagegroup_id' "}

Describe the bug
A clear and concise description of what the bug is.

storagegroup.py calls get_storage_group_snapshot_generation_list with the wrong parameter.

https://github.com/dell/ansible-powermax/blob/189e5ad993e5351d5c9dcdfcbb7ca40c6a993feb/plugins/modules/storagegroup.py#L1437C25-L1437C40

        for snap in snap_list:
            gen_list = self.replication.\
                get_storage_group_snapshot_generation_list(
                    storagegroup_id=sg_name,
                    snap_name=snap)

Should be
for snap in snap_list:
gen_list = self.replication.
get_storage_group_snapshot_generation_list(
storage_group_id=sg_name,
snap_name=snap)

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Delete storage group X999RSWP_12312423_tmp99CRTEST_RSWP failed with error get_storage_group_snapshot_generation_list() got an unexpected keyword argument 'storagegroup_id' "}

Please fix, issue seen at HSBC

[QUESTION]: Is it possible to restore from a storage group snapshot?

How can the Team help you today?

I am working with snapshots on PowerMax (Unisphere Version 9.2.4.3). I am unable to find any mention of restoring from a storage group snapshot. I am able to take and delete snapshots with the dellemc.powermax.snapshot module without issue, but I need to be able to restore from a snapshot. I don't see any option to do this with any of the modules in this collection.

I am able to restore from snapshot within the GUI, but that's not ideal for my situation.
Details: ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.