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

Setting badnwidth for networkset #433

Closed DungKHoang closed 4 years ago

DungKHoang commented 5 years ago

Scenario/Intent

Configure NetworkSet with TypicalBandwidth and MaximumBandwidth

Environment Details

Steps to Reproduce

Set Bandwidth list with typical and maximumbandwidth in playbook ( follow example of network)

Expected Result

Should set bandwidth on network set

Actual Result

Error when running playbook

sijeesh commented 5 years ago

@DungKHoang , Can you please post the error here?

DungKHoang commented 5 years ago

Here is the error: TASK [Create network set ecm_oam_NS] *** 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 bandwidth near line 1, column 173 is not a valid field in this JSON object.', u'message': u'Unrecognized JSON field.', u'nestedErrors': []}) fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/dung/.ansible/tmp/ansible-tmp-1567530578.49-239095104213204/AnsiballZ_oneview_network_set.py\", line 114, in \n _ansiballz_main()\n File \"/home/dung/.ansible/tmp/ansible-tmp-1567530578.49-239095104213204/AnsiballZ_oneview_network_set.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/dung/.ansible/tmp/ansible-tmp-1567530578.49-239095104213204/AnsiballZ_oneview_network_set.py\", line 49, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/tmp/ansible_oneview_network_set_payload_XiKK_K/main.py\", line 177, in \n File \"/tmp/ansible_oneview_network_set_payload_XiKK_K/main.py\", line 173, in main\n File \"/tmp/ansible_oneview_network_set_payload_XiKK_K/ansible_oneview_network_set_payload.zip/ansible/module_utils/oneview.py\", line 662, in run\n File \"/tmp/ansible_oneview_network_set_payload_XiKK_K/main.py\", line 139, in execute_module\n File \"/tmp/ansible_oneview_network_set_payload_XiKK_K/main.py\", line 146, in present\n File \"/tmp/ansible_oneview_network_set_payload_XiKK_K/ansible_oneview_network_set_payload.zip/ansible/module_utils/oneview.py\", line 723, in resource_present\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/networking/network_sets.py\", line 121, in create\n return self._client.create(resource, timeout=timeout, default_values=self.DEFAULT_VALUES)\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 1374, in create\n return self.do_post(uri, resource, timeout, custom_headers)\n File \"build/bdist.linux-x86_64/egg/hpOneView/resources/resource.py\", line 1683, in do_post\n task, entity = self._connection.post(uri, resource, custom_headers=custom_headers)\n File \"build/bdist.linux-x86_64/egg/hpOneView/connection.py\", line 376, in post\n return self.__do_rest_call('POST', 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 bandwidth near line 1, column 173 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}

DungKHoang commented 5 years ago

BTW, the oneview_network_set_facts does not return bandwidth here is the result: TASK [debug] *** ok: [localhost] => { "network_sets": [ { "category": "network-sets", "connectionTemplateUri": "/rest/connection-templates/f75b922a-6dbc-4aa7-a2c8-6a3cf8273156", "created": "2019-09-04T00:07:34.567Z", "description": null, "eTag": "c1aa9e0e-f40d-47a8-8cc1-73f36e3ced63", "modified": "2019-09-04T00:07:34.570Z", "name": "test", "nativeNetworkUri": null, "networkSetType": "Regular", "networkUris": [], "scopesUri": "/rest/scopes/resources/rest/network-sets/4230c169-237b-4e70-a0d3-ffe47314c5a6", "state": "Active", "status": "OK", "type": "network-setV4", "uri": "/rest/network-sets/4230c169-237b-4e70-a0d3-ffe47314c5a6" } ] }

yuvirani commented 4 years ago

@DungKHoang Bandwidth feature is not supported in Network_set resource as of now. We are working on this, we will update you once it is available.

yuvirani commented 4 years ago

Closing it because this is the duplicate issue of #380.