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

Deploy profile from template with OS deployment plan fails on DCS #376

Closed VincentBerger closed 4 years ago

VincentBerger commented 5 years ago

Scenario/Intent

Trying to deploy a server profile from a server profile template that includes an OS deployment plan, against a simulated environment (DCS). It fails with Deploy OS volume failed Doing the same operation from the OneView GUI works fine. Doing the same operation with Ansible with a server profile template WITHOUT an OS deployment plan works fine

Environment Details

Steps to Reproduce

Running playbook https://github.com/HewlettPackard/oneview-ansible-samples/blob/master/infrastructue-as-code/server_profile.yml where the server profile template has simply one network connection and an OS deployment plan and nothing else

Expected Result

Have the server profile created successfully

Actual Result

PLAY [all] *****

TASK [Create a Server Profile from a Server Profile Template] ** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: HPOneViewTaskError: Deploy OS volume failed. fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/Users/vincent/.ansible/tmp/ansible-tmp-1542646771.473202-159590999462787/AnsiballZ_oneview_server_profile.py\", line 113, in \n _ansiballz_main()\n File \"/Users/vincent/.ansible/tmp/ansible-tmp-1542646771.473202-159590999462787/AnsiballZ_oneview_server_profile.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/Users/vincent/.ansible/tmp/ansible-tmp-1542646771.473202-159590999462787/AnsiballZ_oneview_server_profile.py\", line 48, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/var/folders/bw/s3583vsn1xdcj6w06pqv8q7r0000gn/T/ansible_oneview_server_profile_payload_1ErmNh/main.py\", line 634, in \n File \"/var/folders/bw/s3583vsn1xdcj6w06pqv8q7r0000gn/T/ansible_oneview_server_profile_payload_1ErmNh/main.py\", line 630, in main\n File \"/var/folders/bw/s3583vsn1xdcj6w06pqv8q7r0000gn/T/ansible_oneview_server_profile_payload_1ErmNh/ansible_oneview_server_profile_payload.zip/ansible/module_utils/oneview.py\", line 430, in run\n File \"/var/folders/bw/s3583vsn1xdcj6w06pqv8q7r0000gn/T/ansible_oneview_server_profile_payload_1ErmNh/main.py\", line 279, in execute_module\n File \"/var/folders/bw/s3583vsn1xdcj6w06pqv8q7r0000gn/T/ansible_oneview_server_profile_payload_1ErmNh/main.py\", line 321, in present\n File \"/var/folders/bw/s3583vsn1xdcj6w06pqv8q7r0000gn/T/ansible_oneview_server_profile_payload_1ErmNh/main.py\", line 446, in __create_profile\n File \"/Library/Python/2.7/site-packages/hpOneView/resources/servers/server_profiles.py\", line 70, in create\n return self._client.create(resource=resource, uri=uri, timeout=timeout, default_values=self.DEFAULT_VALUES)\n File \"/Library/Python/2.7/site-packages/hpOneView/resources/resource.py\", line 450, in create\n return self.do_post(uri, resource, timeout, custom_headers)\n File \"/Library/Python/2.7/site-packages/hpOneView/resources/resource.py\", line 764, in do_post\n return self._task_monitor.wait_for_task(task, timeout)\n File \"/Library/Python/2.7/site-packages/hpOneView/resources/task_monitor.py\", line 88, in wait_for_task\n task_response = self.__get_task_response(task)\n File \"/Library/Python/2.7/site-packages/hpOneView/resources/task_monitor.py\", line 147, in get_task_response\n raise HPOneViewTaskError(msg, error_code)\nHPOneViewTaskError: Deploy OS volume failed.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} to retry, use: --limit @/Users/vincent/oneview-ansible-samples/infrastructue-as-code/server_profile.retry

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

sijeesh commented 5 years ago

@VincentBerger , If it works from GUI, your playbook is missing some configuration required for OS deployment.

Are you using a valid OS deployment plan?

If you are using a valid OS deployment plan, make sure you have added all the OS custom attributes (if required) in the playbook.

yuvirani commented 4 years ago

@VincentBerger I hope Sijeesh's comment was useful to fix the above problem. Please reopen this if you still facing the same issue even after correcting your configuration.