HewlettPackard / oneview-ansible

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection
Apache License 2.0
104 stars 65 forks source link

Create SAS logical Interconnet group does not allow to use name instead of uri #446

Closed DungKHoang closed 3 years ago

DungKHoang commented 5 years ago

Scenario/Intent

Create playbook for SAS logical interconnect group with name instead of Uri

Environment Details

Steps to Reproduce

 - name: Create SAS logical interconnect group LIG-SAS
   oneview_sas_logical_interconnect_group:       
     config: '{{config}}'                  
     state: present                          
     data:                                   
         name:                        'LIG-SAS' 
         description:                 nan 
         enclosureType:               SY12000     
         interconnectBaySet:          1     

         enclosureIndexes:                   
             - 1                        
         interconnectMapTemplate:            
             interconnectMapEntryTemplates:  
                 - permittedInterconnectTypeUri: "/rest/sas-interconnect-types/Synergy12GbSASConnectionModule"  
                   enclosureIndex:                   1         
                   logicalLocation:                             
                     locationEntries:                           
                         - relativeValue:            1         
                           type:                     'Bay'     
                         - relativeValue:            1         
                           type:                     'Enclosure'     

                 #- permittedInterconnectTypeUri: "/rest/sas-interconnect-types/Synergy12GbSASConnectionModule"
                 - permittedInterconnectTypeName: "Synergy 12Gb SAS Connection Module"

Expected Result

LIG created for SAS. Note: it works for VC 40G F8 and VC-FC

Actual Result

TASK [Create SAS logical interconnect group LIG-SAS] ***** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: HPOneViewException: (u'Unrecognized JSON field.', {u'errorSource': None, u'recommendedActions': [u'Check the valid fields for this JSON object and remove or correct the unrecognized field.'], u'data': {}, u'errorCode': u'UNRECOGNIZED_JSON_FIELD', u'details': u'The field named permittedInterconnectTypeName near line 1, column 1,078 is not a valid field in this JSON object.', u'message': u'Unrecognized JSON field.', u'nestedErrors': []}) fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/dung/.ansible/tmp/ansible-tmp-1567537593.92-5098982024313/AnsiballZ_oneview_sas_logical_interconnect_group.py\", line 114, in \n _ansiballz_main()\n File \"/home/dung/.ansible/tmp/ansible-tmp-1567537593.92-5098982024313/AnsiballZ_oneview_sas_logical_interconnect_group.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/dung/.ansible/tmp/ansible-tmp-1567537593.92-5098982024313/AnsiballZ_oneview_sas_logical_interconnect_group.py\", line 49, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/tmp/ansible_oneview_sas_logical_interconnect_group_payload_lOgEkr/main.py\", line 152, in \n File \"/tmp/ansible_oneview_sas_logical_interconnect_group_payload_lOgEkr/main.py\", line 148, in main\n File \"/tmp/ansible_oneview_sas_logical_interconnect_group_payload_lOgEkr/ansible_oneview_sas_logical_interconnect_group_payload.zip/ansible/module_utils/oneview.py\", line 445, in run\n File \"/tmp/ansible_oneview_sas_logical_interconnect_group_payload_lOgEkr/main.py\", line 142, in execute_module\n File \"/tmp/ansible_oneview_sas_logical_interconnect_group_payload_lOgEkr/ansible_oneview_sas_logical_interconnect_group_payload.zip/ansible/module_utils/oneview.py\", line 508, in resource_present\n File \"/tmp/ansible_oneview_sas_logical_interconnect_group_payload_lOgEkr/ansible_oneview_sas_logical_interconnect_group_payload.zip/ansible/module_utils/oneview.py\", line 525, in _update_resource\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 73, in wrap\n return obj(*args, kwargs)\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 230, in update\n self.data = self._helper.update(resource, uri, force, timeout, custom_headers)\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 469, in update\n return self.do_put(uri, resource, timeout, custom_headers)\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 756, in do_put\n task, body = self._connection.put(uri, resource, custom_headers=custom_headers)\n File \"build/bdist.linux-x86_64/egg/hpOneView/connection.py\", line 373, in put\n return self.__do_rest_call('PUT', uri, body, custom_headers=custom_headers)\n File \"build/bdist.linux-x86_64/egg/hpOneView/connection.py\", line 403, in __do_rest_call\n raise HPOneViewException(body)\nHPOneViewException: (u'Unrecognized JSON field.', {u'errorSource': None, u'recommendedActions': [u'Check the valid fields for this JSON object and remove or correct the unrecognized field.'], u'data': {}, u'errorCode': u'UNRECOGNIZED_JSON_FIELD', u'details': u'The field named permittedInterconnectTypeName near line 1, column 1,078 is not a valid field in this JSON object.', u'message': u'Unrecognized JSON field.', u'nestedErrors': []})\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

VenkateshRavula commented 3 years ago

Going forward, all the enhancement requests will be addressed in the NEW HPE OneView Ansible Collection. Please consider migration to the Ansible Collection. Migration support material can be found in the Migration Support folder.

We have added this resource in our ansible collections backlog. https://github.com/HewlettPackard/oneview-ansible-collection