Start a Conversation

Solved!

Go to Solution

997

October 27th, 2020 05:00

dellemc_unity_storagepool module not working with pool_id

I already installed the unity module, I am able to run  "dellemc_unity_gatherfacts"  I got (pool_1)

TASK [debug] **************************************************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "Pool_List": [
        "pool_1"
    ]
}

however when I try to get more information with "dellemc_unity_storagepool" spefifiying the pool id (pool_1)

I am getting this error:

TASK [Get Storage pool details using pool_id] *******************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Storage pool not found - Creation of storage pool is not allowed through Ansible module"}

 

 

1 Rookie

 • 

72 Posts

October 27th, 2020 07:00

Hi Resnik066,

It is odd that you can't retrieve the details on the storage pool.  There are a couple of things that we can try to help identify what the issue is here.

1. Perhaps start with trying to retrieve the details by using the pool_name instead of pool_id

2. You could try the following Python code and use the SDK directly to see if that is able to retireve the information when using the pool id

from  storops  import  UnitySystem
import  pprint
from  requests  import  urllib3
 
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
pp = pprint.PrettyPrinter( indent = 4 )

unity = UnitySystem( '1.2.3.4' ,  'admin' ,  'password' )
pool = unity.get_pool( "pool_1" )

pp.pprint(pool)
 
Thanks
Bryan

9 Posts

November 3rd, 2020 05:00

Hello,

I successfully ran the .py script you posted with Python 3.6. we had issues on Python 2.7 we had to replace from requests import urllib3 from request with import request.

In Summary it seems to be an issue with Python 2.7 and urllib3.

November 3rd, 2020 06:00

The Ansible Unity product guide says Python 2.7.12 and above are supported.

When you said you have problems with Python 2.7, did you have version 2.7.12, or something different?

Just wondering if I need to ask for a doc change or something like that so others don't run into the same problem you did.

9 Posts

November 5th, 2020 16:00

Hello,

I upgraded to Python 3.6 and Ansible 2.9.10 I still get the same error, I also tested on different server (both are running RHEL 7.7)

-bash-4.2$ ansible --version
ansible 2.9.10
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, May  6 2020, 12:04:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Playbook:

---
- hosts: localhost
  vars_files:
    - ../../group_vars/all
  tasks:

    - name: Get Storage pool details using pool_id
      dellemc_unity_storagepool:
        unispherehost: "{ {array_name}}"
        username: "{ {username}}"
        password: "{ {password}}"
        verifycert: "{ {verifycert}}"
        pool_id: pool_1
        state: "present"
      register: result1
    - debug: var=result1

Output:

TASK [Gathering Facts] *************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Get Storage pool details using pool_id] **************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Storage pool not found - Creation of storage pool is not allowed through Ansible module"}

PLAY RECAP *************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0 

 

I successfully ran the python code directily with either Python 2.7 or Python 3.6 :

$ python3.6
Python 3.6.8 (default, May  6 2020, 12:04:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from storops import UnitySystem
>>> import pprint
>>> from requests import urllib3
>>> urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
>>> pp = pprint.PrettyPrinter(indent=4)
>>> unity = UnitySystem('Unity_test', 'user', 'password')
>>> pool = unity.get_pool("pool_1")
>>> pp.pprint(pool)
{
    "UnityPool": {
        "alert_threshold": 70,
        "creation_time": "2019-03-21 08:09:03+00:00",
        "description": "",
        "existed": true,
        "harvest_state": "UsageHarvestStateEnum.IDLE",
        "hash": 8734694785412,
        "health": {
            "UnityHealth": {
                "hash": 4857888556554
            }
        },
        "id": "pool_1",
        "is_all_flash": true,
        "is_empty": false,
        "is_fast_cache_enabled": false,
        "is_harvest_enabled": true,
        "is_snap_harvest_enabled": false,
        "metadata_size_subscribed": 169387548698,
        "metadata_size_used": 110326972416,
        "name": "RAID6_POOL",
        "object_id": 14784587698,
        "pool_space_harvest_high_threshold": 95.0,
        "pool_space_harvest_low_threshold": 85.0,
        "pool_type": "StoragePoolTypeEnum.TRADITIONAL",
        "raid_type": "RaidTypeEnum.RAID6",
        "size_free": 1609807429632,
        "size_subscribed": 448555646976,
        "size_total": 1734361481216,
        "size_used": 111183659008,
        "snap_size_subscribed": 75161927680,
        "snap_size_used": 0,
        "snap_space_harvest_high_threshold": 25.0,
        "snap_space_harvest_low_threshold": 20.0,
        "tiers": {
            "UnityPoolTierList": [
                {
                    "UnityPoolTier": {
                        "hash": 8737236548752
                    }
                },
                {
                    "UnityPoolTier": {
                        "hash": 8735236741256
                    }
                },
                {
                    "UnityPoolTier": {
                        "hash": -922352215545445645
                    }
                }
            ]
        }
    }
}
>>>

 

 

1 Rookie

 • 

72 Posts

November 10th, 2020 15:00

Hi Resnik,

The only time that error message should be shown is if the Ansible code is unable to populate anything in a dictionary called "storage_pool_details"

From looking at the output of the SDK call I think that we are tripping up on this code in the ansible module

is_fast_vp_enabled = api_response._get_property_from_raw(
'pool_fast_vp').is_schedule_enabled
details['is_fast_vp_enabled'] = is_fast_vp_enabled

In your SDK output there is no "pool_fast_vp" field.

Two things that you can check.  There should be a dellemc_ansible_provisioning.log file in the same directory as your playbook which may include more details (perhaps an exception trying to get the data above)

You can also try commenting out those three lines in the dellemc_unity_storagepool.py file to bypass the gathering of that info.

Hope that helps
Bryan

9 Posts

November 11th, 2020 13:00

Hello, after commenting out dellemc_unity_storagepool.py

 

#is_fast_vp_enabled = api_response._get_property_from_raw(
#'pool_fast_vp').is_schedule_enabled
#details['is_fast_vp_enabled'] = is_fast_vp_enabled

the playbook ran fine with Python 2.7 and 3.6

 

 

thanks

No Events found!

Top