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

Attributes not working for Logical Interconnect Group #383

Closed DungKHoang closed 5 years ago

DungKHoang commented 5 years ago

Scenario/Intent

[What you are trying to achieve but can't?]

Environment Details

Module Version: current master - v5.1.1

**Ansible Version:**2.64

OneView Appliance Version: 4.10.03-364293

OneView Client API Version: 600

Python Version: 2.710

python-hpOneView SDK Version: v4.7

Platform: Ubuntu 18

Steps to Reproduce

When using a playbook to create a logical interconnect group, the following attributes generate error at execution of the playbook enableIgmpSnooping: false igmpIdleTimeoutInterval: 260 enableNetworkLoopProtection: true enablePauseFloodProtection: true enableRichTLV: false enableTaggedLldp: false enableStormControl: false stormControlThreshold: 0 fastMacCacheFailover: true macRefreshInterval: 5

Expected Result

Be able to configure LIG

Actual Result

TASK [Create logical Interconnect Group 1-Frame] ***** 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 enableIgmpSnooping near line 1, column 3,734 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-1546451884.89-122693931272734/AnsiballZ_oneview_logical_interconnect_group.py\", line 113, in \n _ansiballz_main()\n File \"/home/dung/.ansible/tmp/ansible-tmp-1546451884.89-122693931272734/AnsiballZ_oneview_logical_interconnect_group.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/dung/.ansible/tmp/ansible-tmp-1546451884.89-122693931272734/AnsiballZ_oneview_logical_interconnect_group.py\", line 48, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/tmp/ansible_oneview_logical_interconnect_group_payload_twQNZS/main.py\", line 209, in \n File \"/tmp/ansible_oneview_logical_interconnect_group_payload_twQNZS/main.py\", line 205, in main\n File \"/tmp/ansible_oneview_logical_interconnect_group_payload_twQNZS/ansible_oneview_logical_interconnect_group_payload.zip/ansible/module_utils/oneview.py\", line 299, in run\n File \"/tmp/ansible_oneview_logical_interconnect_group_payload_twQNZS/main.py\", line 169, in execute_module\n File \"/tmp/ansible_oneview_logical_interconnect_group_payload_twQNZS/main.py\", line 177, in present\n File \"/tmp/ansible_oneview_logical_interconnect_group_payload_twQNZS/ansible_oneview_logical_interconnect_group_payload.zip/ansible/module_utils/oneview.py\", line 368, in resource_present\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/networking/logical_interconnect_groups.py\", line 148, in update\n return self._client.update(resource, timeout=timeout, default_values=self.DEFAULT_VALUES)\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 386, 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 767, 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 374, 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 404, 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 enableIgmpSnooping near line 1, column 3,734 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}

sijeesh commented 5 years ago

@DungKHoang, "enableIgmpSnooping" field is under ethernetSettings. Can you post the full playbook that you have tried?

DungKHoang commented 5 years ago

Hi Take a look here: https://github.com/DungKHoang/oneview-ansible-examples/blob/master/ov-logicalinterconnectgroup.yml and un-comment the related attribute /Dung

On Wed, Jan 30, 2019 at 10:11 AM Sijeesh Kattumunda < notifications@github.com> wrote:

@DungKHoang https://github.com/DungKHoang, "enableIgmpSnooping" field is under ethernetSettings. Can you post the full playbook that you have tried?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HewlettPackard/oneview-ansible/issues/383#issuecomment-459049136, or mute the thread https://github.com/notifications/unsubscribe-auth/AIxTqN1-L1JrF0Y7Fdx1Xek_Ass8IMvAks5vIeBjgaJpZM4ZnAhv .

-- Dung K Hoang

sijeesh commented 5 years ago

@DungKHoang , All those commented fields have to come under "ethernetSettings", please refer OneView REST API600 documentation.

Example: ethernetSettings: enableIgmpSnooping: false

DungKHoang commented 5 years ago

Hi When I set all commented fields under ethernetSettings, I get the error message: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: HPOneViewException: (u'The "type" field is missing from the JSON.', {u'errorSource': None, u'recommendedActions': [u'Include the "type" field in the JSON and try the request again.'], u'data': {}, u'errorCode': u'MISSING_JSON_TYPE', u'details': u'The "type" field was not included in the JSON input of this request, so the request is invalid.', u'message': u'The "type" field is missing from the JSON.', u'nestedErrors': []})

See playbook attached /Dung

On Wed, Jan 30, 2019 at 11:55 AM Sijeesh Kattumunda < notifications@github.com> wrote:

@DungKHoang https://github.com/DungKHoang , All those commented fields have to come under "ethernetSettings", please refer OneView REST API600 documentation.

Example: ethernetSettings: enableIgmpSnooping: false

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HewlettPackard/oneview-ansible/issues/383#issuecomment-459085912, or mute the thread https://github.com/notifications/unsubscribe-auth/AIxTqD-vLZwLI86F5qpueFT35kEocGINks5vIfi6gaJpZM4ZnAhv .

-- Dung K Hoang

sijeesh commented 5 years ago

@DungKHoang , If you are using API version 200 -600 , you should not get this error. Let me know the API version you have used. As of now, OneView Ansible module does not support API versions above 600.

DungKHoang commented 5 years ago

I'm using API version 600 Here is my oneview-config.json dung@ansible:~/ansible-scripts$ cat oneview-config.json { "ip": "10.254.13.250", "credentials": { "userName": "administrator", "password": "some-password" }, "api_version": 600

On Wed, Jan 30, 2019 at 11:30 PM Sijeesh Kattumunda < notifications@github.com> wrote:

@DungKHoang https://github.com/DungKHoang , If you are using API version 200 -600 , you should not get this error. Let me know the API version you have used. As of now, OneView Ansible module does not support API versions above 600.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HewlettPackard/oneview-ansible/issues/383#issuecomment-459244590, or mute the thread https://github.com/notifications/unsubscribe-auth/AIxTqFwwOzLca19kexofS12K8Gpnd8tqks5vIpusgaJpZM4ZnAhv .

-- Dung K Hoang

sijeesh commented 5 years ago

@DungKHoang , Add "type" field for ethernet settings, it will be solved. Closing this issue.

frippe75 commented 5 years ago

Realized I just opened an issue in the python client repo for the type field as well. What is the Type then. Maybe update the examples so that it works right of the bat?