Using the python module
https://github.com/jialehuo/ansible-dellemc-unity/blob/master/library/dellemc_unity.py
,
below have designed the playbook but am facing Request body errors.
PLAYBOOK:
---
- hosts: localhost
vars_prompt:
- name: pool_id
prompt: "pool_1 : Database Pool\npool_2 : VMWare Pool\npool_3 :
ATKHUNITY500-C5_NLSAS_POOL0\npool_4 : NAS-Mixed\nSelect the pool id"
private: no
- name: lun_name
prompt: "Enter LUN Name"
private: no
- name: lun_size
prompt: "Enter LUN Size(GB)"
private: no
- name: user
prompt: "Enter Username"
private: no
- name: password
prompt: "Enter Password"
private: no
tasks:
- name: Updates
dellemc_unity:
unity_hostname: "165.114.74.40"
unity_username: "{{ user }}"
unity_password: "{{ password }}"
unity_updates:
- { resource_type: storageResource, fields: 'name:{{ lun_name }},
lunParameters:{pool: {id: "{{ pool_id }}"}, size: "{{ lun_size }}",
isThinEnabled:"true", isDataReductionEnabled:"false"}', action: 'createLun'
}
register: result
- debug:
var: result
------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR:
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"unity_hostname": "165.114.74.40",
"unity_license_path": null,
"unity_password": "xxxxxxxxxxxx",
"unity_password_updates": null,
"unity_queries": null,
"unity_updates": [
{
"action": "createLun",
"fields": "name:test_LUN, lunParameters:{pool: {id:
\"pool_1\"}, size: \"1\", isThinEnabled:\"true\",
isDataReductionEnabled:\"false\"}",
"resource_type": "storageResource"
}
],
"unity_username": "admin"
}
},
"msg": {
"args": {
"fields": "name:test_LUN, lunParameters:{pool: {id:
\"pool_1\"}, size: \"1\", isThinEnabled:\"true\",
isDataReductionEnabled:\"false\"}"
},
"error": {
"created": "2019-09-22T03:20:27.622Z",
"errorCode": 131149877,
"httpStatusCode": 422,
*"messages": [*
* {*
* "en-US": "Request body is not correct. There may be
duplicate parameters, wrong parameter name. Please refer to API
documentation page and ensure the body is correct. (Error Code:0x7d13035)"*
* }*
* ]*
},
"url":
"https://165.114.74.40/api/types/storageResource/action/createLun"
},
"unity_query_results": [],
"unity_update_results": []
}
I have highlight the message. Please help out if someone has faced this
error sometime or other.
Thank you :)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/eef549fe-8731-4a73-b172-6988cebf87dd%40googlegroups.com.