Open mattjudson opened 4 years ago
Hey Matt, were you ever able to figure out your problem with this? Can you give me some details on what exactly you were trying to do? (it looks like you were trying to install a 2 node cluster, was it on ESX? Did you try a single node just for fun? I'm starting to take a look at this module and will test a two node cluster next week.
No not yet....I am pretty new to ansible, but I was able to get a ansible playbook working to configured a freshly deployed cluster after the cluster is deployed but This na_ots_cluster ONTap Select Cluster config/deployment module gave me a really hard time.
Here is some detailed info from an email that I had been shooting around with my coworkers and some of my netapp support guys as I was working on it.
Specifically with relation to the "na_ots_cluster" module to configure the OnTap Select Cluster in the Deploy utility...I think there may be some flawed logic in a couple of the tasks in this module but i wasn't able to nail it down. I spent a ton of time trying to get it to work. I even went so far as to running the json manually. This became apparent when I tried to use custom node name as opposed to the default node names of Cluster "-01" and "-02". When I would revert my node name to the default I could get further in the process however cluster deployment ultimately still failed and it became apparent the nodes weren't being configured to the appropriate size 2TB vs. their default size 1.67
The Prossess goes further in success if the default node names are used but ultimately fails to deploy due to failure to configure the storage of the nodes.
From what I see The high level steps go as follows and the bold skipped are the problem area's.
Main playbook execution:.....
judsonm@cent8matt:/home/judsonm/OTS>ansible-playbook CreateSelectTSTCluster.yml [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [Create ONTAP Select cluster (ESXi)] ****
TASK [na_ots_cluster : Verify settings] ** included: /home/judsonm/OTS/na_ots_cluster/tasks/verify.yml for localhost
TASK [na_ots_cluster : .....set fact (cluster_nodes_count)] ** ok: [localhost]
TASK [na_ots_cluster : .....set fact (actual_nodes_count)] *** ok: [localhost]
TASK [na_ots_cluster : ....compare node_count to cluster_nodes count] **** skipping: [localhost]
TASK [na_ots_cluster : .....verify image] **** ok: [localhost]
TASK [na_ots_cluster : .....stop task if ONTAP image is not available] *** skipping: [localhost]
TASK [na_ots_cluster : Add Vcenter credentials] ** included: /home/judsonm/OTS/na_ots_cluster/tasks/add_vcenter_credential.yml for localhost
TASK [na_ots_cluster : .....check credential svc_vmadmin@palmbeach.k12.fl.us - vctest.palmbeach.k12.fl.us] *** ok: [localhost]
TASK [na_ots_cluster : .....add credential svc_vmadmin@palmbeach.k12.fl.us - vctest.palmbeach.k12.fl.us] ***** ok: [localhost]
TASK [na_ots_cluster : Add ESXi host credentials (no vCenter )] ** skipping: [localhost] => (item={u'host_name': u'esxtst01.palmbeach.k12.fl.us'}) skipping: [localhost] => (item={u'host_name': u'esxtst03.palmbeach.k12.fl.us'})
TASK [na_ots_cluster : Add KVM host credentials] ***** skipping: [localhost] => (item={u'host_name': None, u'host_login': None}) skipping: [localhost] => (item={u'host_name': None, u'host_login': None})
TASK [na_ots_cluster : Get existing host IDs] **** included: /home/judsonm/OTS/na_ots_cluster/tasks/get_host_ids.yml for localhost
TASK [na_ots_cluster : Get Host IDs] ***** ok: [localhost]
TASK [na_ots_cluster : .....clear list] ** ok: [localhost]
TASK [na_ots_cluster : .....build list of host IDs] **
TASK [na_ots_cluster : Register ESXi hosts (vCenter)] **** included: /home/judsonm/OTS/na_ots_cluster/tasks/register_esx_vcenter_host.yml for localhost included: /home/judsonm/OTS/na_ots_cluster/tasks/register_esx_vcenter_host.yml for localhost
TASK [na_ots_cluster : Register new ESXi Host - esxtst01.palmbeach.k12.fl.us] **** ok: [localhost]
TASK [na_ots_cluster : .....monitor host registration job] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/monitor_job.yml for localhost
TASK [na_ots_cluster : .....monitor job (89525a3a-80d2-11ea-b7df-00505694379e) until "success" or "failure"] ***** FAILED - RETRYING: .....monitor job (89525a3a-80d2-11ea-b7df-00505694379e) until "success" or "failure" (10 retries left). ok: [localhost]
TASK [na_ots_cluster : Fail check] *** skipping: [localhost]
TASK [na_ots_cluster : Register new ESXi Host - esxtst03.palmbeach.k12.fl.us] **** ok: [localhost]
TASK [na_ots_cluster : .....monitor host registration job] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/monitor_job.yml for localhost
TASK [na_ots_cluster : .....monitor job (9317b4d4-80d2-11ea-b7df-00505694379e) until "success" or "failure"] ***** FAILED - RETRYING: .....monitor job (9317b4d4-80d2-11ea-b7df-00505694379e) until "success" or "failure" (10 retries left). ok: [localhost]
TASK [na_ots_cluster : Fail check] *** skipping: [localhost]
TASK [na_ots_cluster : Register ESXi hosts (no vCenter)] ***** skipping: [localhost] => (item={u'host_name': u'esxtst01.palmbeach.k12.fl.us'}) skipping: [localhost] => (item={u'host_name': u'esxtst03.palmbeach.k12.fl.us'})
TASK [na_ots_cluster : Register KVM hosts] *** skipping: [localhost] => (item={u'host_name': None, u'host_login': None}) skipping: [localhost] => (item={u'host_name': None, u'host_login': None})
TASK [na_ots_cluster : Update host IDs list] ***** included: /home/judsonm/OTS/na_ots_cluster/tasks/get_host_ids.yml for localhost
TASK [na_ots_cluster : Get Host IDs] ***** ok: [localhost]
TASK [na_ots_cluster : .....clear list] ** ok: [localhost]
TASK [na_ots_cluster : .....build list of host IDs] ** ok: [localhost] => (item={u'id': u'894cab08-80d2-11ea-b7df-00505694379e', u'name': u'esxtst01.palmbeach.k12.fl.us'}) ok: [localhost] => (item={u'id': u'9311a468-80d2-11ea-b7df-00505694379e', u'name': u'esxtst03.palmbeach.k12.fl.us'})
TASK [na_ots_cluster : Validate internal network] **** skipping: [localhost]
TASK [na_ots_cluster : Check for existing cluster] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/check_cluster.yml for localhost
TASK [na_ots_cluster : .....checking] **** ok: [localhost]
TASK [na_ots_cluster : .....set fact ( cluster_new (true) - no cluster exists )] ***** ok: [localhost]
TASK [na_ots_cluster : .....set fact ( cluster_new (false) - if cluster exists )] **** skipping: [localhost]
TASK [na_ots_cluster : Create cluster - SelectTST x 2 nodes] ***** included: /home/judsonm/OTS/na_ots_cluster/tasks/create_cluster.yml for localhost
TASK [na_ots_cluster : Fail check] *** skipping: [localhost]
TASK [na_ots_cluster : .....creating cluster] **** ok: [localhost]
TASK [na_ots_cluster : Get cluster ID - SelectTST] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/get_cluster_id.yml for localhost
TASK [na_ots_cluster : .....retrieving cluster id] *** ok: [localhost]
TASK [na_ots_cluster : .....set fact ( cluster_id (9d9cad88-80d2-11ea-b7df-00505694379e) )] ** ok: [localhost]
TASK [na_ots_cluster : Get cluster state - SelectTST] **** included: /home/judsonm/OTS/na_ots_cluster/tasks/get_cluster_state.yml for localhost
TASK [na_ots_cluster : .....retrieving cluster state] **** ok: [localhost]
TASK [na_ots_cluster : .....set fact ( cluster_deployed (False) )] *** ok: [localhost]
TASK [na_ots_cluster : Get node IDs] ***** included: /home/judsonm/OTS/na_ots_cluster/tasks/get_node_ids.yml for localhost
TASK [na_ots_cluster : .....retrieving node IDs] ***** ok: [localhost]
TASK [na_ots_cluster : .....build list of node IDs] ** ok: [localhost] => (item={u'id': u'9d9d5b02-80d2-11ea-b7df-00505694379e', u'name': u'SelectTST-01'}) ok: [localhost] => (item={u'id': u'9d9ec744-80d2-11ea-b7df-00505694379e', u'name': u'SelectTST-02'})
TASK [na_ots_cluster : Configure nodes] ** included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node.yml for localhost included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node.yml for localhost
TASK [na_ots_cluster : Configure Node - SelectTST-01 - 9d9d5b02-80d2-11ea-b7df-00505694379e] ***** skipping: [localhost] => (item=SelectTST1 (10.254.63.181)) skipping: [localhost] => (item=SelectTST2 (10.254.63.182))
TASK [na_ots_cluster : Configure Node - SelectTST-02 - 9d9ec744-80d2-11ea-b7df-00505694379e] ***** skipping: [localhost] => (item=SelectTST1 (10.254.63.181)) skipping: [localhost] => (item=SelectTST2 (10.254.63.182))
TASK [na_ots_cluster : Configure networks] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_network.yml for localhost included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_network.yml for localhost
TASK [na_ots_cluster : Retrieve Node Network IDs] **** ok: [localhost]
TASK [na_ots_cluster : Node SelectTST-01 - Management Network - "Core60-FHtest"] ***** ok: [localhost]
TASK [na_ots_cluster : Node SelectTST-01 - Data Network - "iSCSI-FHtest"] **** ok: [localhost]
TASK [na_ots_cluster : Node SelectTST-01 - Internal Network - "OnTap-FHtest"] **** ok: [localhost]
TASK [na_ots_cluster : Retrieve Node Network IDs] **** ok: [localhost]
TASK [na_ots_cluster : Node SelectTST-02 - Management Network - "Core60-FHtest"] ***** ok: [localhost]
TASK [na_ots_cluster : Node SelectTST-02 - Data Network - "iSCSI-FHtest"] **** ok: [localhost]
TASK [na_ots_cluster : Node SelectTST-02 - Internal Network - "OnTap-FHtest"] **** ok: [localhost]
TASK [na_ots_cluster : Configure storage pool] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml for localhost included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml for localhost
TASK [na_ots_cluster : .....check for existing storage pool] ***** ok: [localhost]
TASK [na_ots_cluster : .....clear (sp_id)] *** ok: [localhost]
TASK [na_ots_cluster : .....set fact (sp_id)] **** skipping: [localhost]
TASK [na_ots_cluster : .....detach existing storage pool] **** skipping: [localhost] => (item={u'capacityTB': 2.0, u'ipAddress': u'10.254.63.181', u'storage_pool': u'Local-esxtst01', u'host_name': u'esxtst01.palmbeach.k12.fl.us', u'node_name': u'SelectTST1'}) skipping: [localhost] => (item={u'capacityTB': 2.0, u'ipAddress': u'10.254.63.182', u'storage_pool': u'Local-esxtst03', u'host_name': u'esxtst03.palmbeach.k12.fl.us', u'node_name': u'SelectTST2'})
TASK [na_ots_cluster : .....attach storage pool] ***** skipping: [localhost] => (item=SelectTST1 (Local-esxtst01)) skipping: [localhost] => (item=SelectTST2 (Local-esxtst03))
TASK [na_ots_cluster : .....check for existing storage pool] ***** ok: [localhost]
TASK [na_ots_cluster : .....clear (sp_id)] *** ok: [localhost]
TASK [na_ots_cluster : .....set fact (sp_id)] **** skipping: [localhost]
TASK [na_ots_cluster : .....detach existing storage pool] **** skipping: [localhost] => (item={u'capacityTB': 2.0, u'ipAddress': u'10.254.63.181', u'storage_pool': u'Local-esxtst01', u'host_name': u'esxtst01.palmbeach.k12.fl.us', u'node_name': u'SelectTST1'}) skipping: [localhost] => (item={u'capacityTB': 2.0, u'ipAddress': u'10.254.63.182', u'storage_pool': u'Local-esxtst03', u'host_name': u'esxtst03.palmbeach.k12.fl.us', u'node_name': u'SelectTST2'})
TASK [na_ots_cluster : .....attach storage pool] ***** skipping: [localhost] => (item=SelectTST1 (Local-esxtst01)) skipping: [localhost] => (item=SelectTST2 (Local-esxtst03))
TASK [na_ots_cluster : Deploy cluster] *** included: /home/judsonm/OTS/na_ots_cluster/tasks/deploy_cluster.yml for localhost
TASK [na_ots_cluster : .....start deployment - SelectTST] **** fatal: [localhost]: FAILED! => {"changed": false, "connection": "close", "content": "{\n \"error\": {\n \"code\": \"LibRestError\",\n \"message\": \"'NoneType' object has no attribute 'hypervisor_type'. Caused by AttributeError(\\"'NoneType' object has no attribute 'hypervisor_type'\\",)\"\n }\n}\n", "content_length": "204", "content_type": "application/json", "date": "Fri, 17 Apr 2020 17:41:13 GMT", "elapsed": 0, "json": {"error": {"code": "LibRestError", "message": "'NoneType' object has no attribute 'hypervisor_type'. Caused by AttributeError(\"'NoneType' object has no attribute 'hypervisor_type'\",)"}}, "msg": "Status code was 500 and not [202]: HTTP Error 500: INTERNAL SERVER ERROR", "redirected": false, "request_id": "2802", "server": "nginx", "status": 500, "url": "https://10.254.63.180/api/v3/clusters/9d9cad88-80d2-11ea-b7df-00505694379e/deploy?inhibit_rollback=false"}
PLAY RECAP *** localhost : ok=55 changed=0 unreachable=0 failed=1 skipped=20 rescued=0 ignored=0
vars_files:
Contents of Varialbe File SelectTSTvars.yml judsonm@cent8matt:/home/judsonm/OTS>cat SelectTSTvars.yml node_count: 2 hypervisor: "ESX" monitor_job: true deploy_api_url: "https://10.254.63.180/api/v3" deploy_login: "admin" vcenter_login: "svc_vmadmin@palmbeach.k12.fl.us" vcenter_name: "vctest.palmbeach.k12.fl.us" use_vcenter: true esxi_hosts:
cluster_name: "SelectTST" cluster_ip: "10.254.63.183" cluster_netmask: "255.255.252.0" cluster_gateway: "10.254.60.1" cluster_ontap_image: "9.7" cluster_ntp:
mgt_network: "Core60-FHtest" data_network: "iSCSI-FHtest" internal_network: "OnTap-FHtest" instance_type: "small" cluster_nodes:
Thanks for the details! That is helpful. I didn't write this role but I did write the playbook a few years ago that was the "inspiration" for the role. So, I am a bit rusty but have a general idea whats going on and I know the product well. I was planning on doing some testing this week anyway so I will see if I can help you as well!
Update: after the first tests, I am able to successfully install a 2 node cluster as well...
I think I see the problem - I believe ONTAP Deploy automatically names the nodes with a "-0x". The query in "get_node_ids.yml" gets a list of the node names from the cluster and then in "configure_node.yml" it compares the node-name as defined in your variable yaml file: cluster_nodes:
It skips it as it doesn't find a match between the node name it defined and the node names you defined. If you are wanting to change the name of the node, you will need to do it after cluster creation, which I'm almost 100% is possible with Ansible as well.
Try to change your variable yaml to "-01" & "-02" for the node names instead of just 1 & 2 and test it again. I bet everything will run through without problem, also the storage bit!
I'm still not sure what you mean that I would have to change the node names after cluster creation, but for now to try and proceed further I have changed the names back to the default node names.
I ran the playbook again and as previous it succeeded further but ran into an error configuring the storage......Here is the verbose output of the storage section.
TASK [na_ots_cluster : Configure storage pool] *** task path: /home/judsonm/OTS/na_ots_cluster/tasks/main.yml:95 Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml' included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml for localhost Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml' included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml for localhost Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml' Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml'
TASK [na_ots_cluster : .....check for existing storage pool] *****
task path: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml:10
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: judsonm
<127.0.0.1> EXEC /bin/sh -c 'echo ~judsonm && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875
" && echo ansible-tmp-1591625601.74-159613905446875="echo /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875
" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/net_tools/basics/uri.py
<127.0.0.1> PUT /home/judsonm/.ansible/tmp/ansible-local-121645bg9RBl/tmpzBpQyX TO /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875/AnsiballZ_uri.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875/ /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875/AnsiballZ_uri.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875/AnsiballZ_uri.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/judsonm/.ansible/tmp/ansible-tmp-1591625601.74-159613905446875/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
"changed": false,
"connection": "close",
"content_length": "40",
"content_type": "application/json",
"cookies": {},
"cookies_string": "",
"date": "Mon, 08 Jun 2020 14:13:21 GMT",
"elapsed": 0,
"invocation": {
"module_args": {
"attributes": null,
"backup": null,
"body": null,
"body_format": "json",
"client_cert": null,
"client_key": null,
"content": null,
"creates": null,
"delimiter": null,
"dest": null,
"directory_mode": null,
"follow": false,
"follow_redirects": "safe",
"force": false,
"force_basic_auth": false,
"group": null,
"headers": {
"Content-Type": "application/json"
},
"http_agent": "ansible-httpget",
"method": "GET",
"mode": null,
"owner": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"regexp": null,
"remote_src": null,
"removes": null,
"return_content": false,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"status_code": [
"200"
],
"timeout": 30,
"unix_socket": null,
"unsafe_writes": null,
"url": "https://10.254.63.180/api/v3/clusters/0c1cda70-a992-11ea-b6f6-00505694379e/nodes/0c1db67a-a992-11ea-b6f6-00505694379e/storage/pools",
"url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"url_username": "admin",
"use_proxy": true,
"user": "admin",
"validate_certs": false
}
},
"json": {
"num_records": 0,
"records": []
},
"msg": "OK (40 bytes)",
"redirected": false,
"request_id": "3131",
"server": "nginx",
"status": 200,
"strict_transport_security": "max-age=31536000; includeSubDomains",
"url": "https://10.254.63.180/api/v3/clusters/0c1cda70-a992-11ea-b6f6-00505694379e/nodes/0c1db67a-a992-11ea-b6f6-00505694379e/storage/pools"
}
Read vars_file 'SelectTSTvars.yml'
Read vars_file 'SelectTSTpwds.yml'
TASK [na_ots_cluster : .....clear (sp_id)] *** task path: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml:29 ok: [localhost] => { "ansible_facts": { "sp_id": "" }, "changed": false } Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml'
TASK [na_ots_cluster : .....set fact (sp_id)] **** task path: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml:37 skipping: [localhost] => { "changed": false, "skip_reason": "Conditional result was False" } Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml'
TASK [na_ots_cluster : .....detach existing storage pool] **** task path: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml:49 skipping: [localhost] => (item={u'capacityTB': u'2.0', u'ipAddress': u'10.254.63.181', u'storage_pool': u'Local-esxtst01', u'host_name': u'esxtst01.palmbeach.k12.fl.us', u'node_name': u'SelectTST-01'}) => { "ansible_loop_var": "item", "changed": false, "item": { "capacityTB": "2.0", "host_name": "esxtst01.palmbeach.k12.fl.us", "ipAddress": "10.254.63.181", "node_name": "SelectTST-01", "storage_pool": "Local-esxtst01" }, "skip_reason": "Conditional result was False" } skipping: [localhost] => (item={u'capacityTB': u'2.0', u'ipAddress': u'10.254.63.182', u'storage_pool': u'Local-esxtst03', u'host_name': u'esxtst03.palmbeach.k12.fl.us', u'node_name': u'SelectTST-02'}) => { "ansible_loop_var": "item", "changed": false, "item": { "capacityTB": "2.0", "host_name": "esxtst03.palmbeach.k12.fl.us", "ipAddress": "10.254.63.182", "node_name": "SelectTST-02", "storage_pool": "Local-esxtst03" }, "skip_reason": "Conditional result was False" } Read vars_file 'SelectTSTvars.yml' Read vars_file 'SelectTSTpwds.yml'
TASK [na_ots_cluster : .....attach storage pool] ***** task path: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node_storage.yml:73 The full traceback is: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 112, in run item_results = self._run_loop(items) File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 366, in _run_loop res = self._execute(variables=task_vars) File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 587, in _execute self._task.post_validate(templar=templar) File "/usr/lib/python2.7/site-packages/ansible/playbook/task.py", line 296, in post_validate super(Task, self).post_validate(templar) File "/usr/lib/python2.7/site-packages/ansible/playbook/base.py", line 431, in post_validate value = templar.template(getattr(self, name)) File "/usr/lib/python2.7/site-packages/ansible/template/init.py", line 623, in template disable_lookups=disable_lookups, File "/usr/lib/python2.7/site-packages/ansible/template/init.py", line 578, in template disable_lookups=disable_lookups, File "/usr/lib/python2.7/site-packages/ansible/template/init.py", line 837, in do_template res = j2_concat(rf) File "", line 18, in root MemoryError fatal: [localhost]: FAILED! => { "msg": "Unexpected failure during module execution.", "stdout": "" }
PLAY RECAP *** localhost : ok=46 changed=0 unreachable=0 failed=1 skipped=16 rescued=0 ignored=0
Was there any information in ONTAP Deploy / Events? Those error messages there might be more helpful and point you in the right direction.
No the OnTap Deploy event shows Everything is fine up until that point. The Cluster info is there but seems to have stopped at configuring the storage. To me the python errors on that step indicate that it didn't even attempt communication to the Deploy Appliance.
I think this has something to do with the capacity calculation line but i'm not sure how to verify that....
name: .....attach storage pool
uri: url: "{{ deploy_api_url }}/clusters/{{ cluster_id }}/nodes/{{ outeritem.node_id }}/storage/pools" method: POST headers: Content-Type: "application/json" body: '{"pool_array": [{"capacity": {{ ( (item.capacityTB TBinBytes) - Overhead - (item.capacityTB TB2Percent) ) | int | abs }},"name": "{{ item.storage_pool }}" }]}' body_format: json user: "{{ deploy_login }}" password: "{{ deploy_pwd }}" status_code: 201,202 validate_certs: False loop: "{{ cluster_nodes }}" loop_control: label: "{{ item.node_name }} ({{ item.storage_pool }})" when:
register: configure_node_storage_response
Screenshots of Deploy events...
I just wanted to let you know that I finally got a deployment to to run fully from start to finish using the na_ots_cluster module.....
Unfortunately, I had to hard code the size in this line with the one after it. I'm not sure why that formula doens't work and causing all the errors i previously referenced.
body: '{"pool_array": [{"capacity": {{ ( (item.capacityTB TBinBytes) - Overhead - (item.capacityTB TB2Percent) ) | int | abs }},"name": "{{ item.storage_pool }}" }]}'
body: '{"pool_array": [{"capacity": {{(2748779069440 | int)}},"name": "{{ item.storage_pool }}" }]}'
I still would like to go back to my First question/problem which is how I can modify the names of the nodes from anything but the default names and get it to run and deploy properly
node_name: "{{ cluster_name }}-01" .... node_name: "{{ cluster_name }}-02"
to
node_name: "{{ cluster_name }}1" .... node_name: "{{ cluster_name }}2"
So From what I have seen there are 2 issues.....
Just want to update that this this NA_OTS_Cluster Module is still flawed when using anything but the deafult node-01 and node-02 names..... I have 2 clusters to deploy soon and I figured i would try again with the latest Ontap 9.15 but i'm still running in to the same issues. I really don't want to use those default names for my cluster nodes or VM's and it's not something I think I should be changing after the fact for a deployment.
These 1st issue still persists. I haven't bypassed yet to try the 2nd issue again. https://github.com/NetApp/ansible/issues/1 Changing the names of the nodes will not work and halts the process https://github.com/NetApp/ansible/issues/2 The Forumala for the capacity size generates errors and does not work properly. Hard coding a number allows the process to complete and deploys the cluster.
I made a modification to get it to run the Configuration of the nodes for non-default names by changin the configure_Node yml from
After ward It will attempt to configure the nodes when a different name is used but The Logic to configure the Nodes seems flawed though somehow. It attempts to configure the nodes twice. I can't figure out how these loops are working to configure the nodes under the default names only and to account for other node names
Looking at the playbook run I can see it attempts to configure the nodes twice before or after this change but when the names are default it skips one in each section
IE. Both nodes are configured in two sepearate tasks which is what looks like it's configuring each node in a separate task but it's NOT. TASK [na_ots_cluster : Configure Node - SelectFH-01 - b6f45fc4-88ed-11ef-87fb-005056a64467] then both nodes are attempted to be configured in another task TASK [na_ots_cluster : Configure Node - SelectFH-02 - b6f578f0-88ed-11ef-87fb-005056a64467]
TASK [na_ots_cluster : Configure nodes] ** included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node.yml for localhost => (item={'node_name': 'SelectFH-01', 'node_id': 'b6f45fc4-88ed-11ef-87fb-005056a64467'}) included: /home/judsonm/OTS/na_ots_cluster/tasks/configure_node.yml for localhost => (item={'node_name': 'SelectFH-02', 'node_id': 'b6f578f0-88ed-11ef-87fb-005056a64467'})
TASK [na_ots_cluster : Configure Node - SelectFH-01 - b6f45fc4-88ed-11ef-87fb-005056a64467] ** ok: [localhost] => (item=SelectFH1 (10.254.61.21)) => {"ansible_loop_var": "item", "changed": false, "connection": "close", "content_length": "3", "content_type": "application/json", "cookies": {}, "cookies_string": "", "date": "Sat, 12 Oct 2024 23:00:05 GMT", "elapsed": 0, "item": {"capacityTB": "2.4", "host_name": "esxhastor1.palmbeach.k12.fl.us", "ipAddress": "10.254.61.21", "node_name": "SelectFH1", "storage_pool": "Local-esxhastor1"}, "json": {}, "msg": "OK (3 bytes)", "redirected": false, "request_id": "275891", "server": "nginx", "status": 200, "strict_transport_security": "max-age=31536000; includeSubDomains", "url": "https://10.105.0.247/api/v3/clusters/b6f39d82-88ed-11ef-87fb-005056a64467/nodes/b6f45fc4-88ed-11ef-87fb-005056a64467"} ok: [localhost] => (item=SelectFH2 (10.254.61.22)) => {"ansible_loop_var": "item", "changed": false, "connection": "close", "content_length": "3", "content_type": "application/json", "cookies": {}, "cookies_string": "", "date": "Sat, 12 Oct 2024 23:00:05 GMT", "elapsed": 0, "item": {"capacityTB": "2.4", "host_name": "esxfhha1.palmbeach.k12.fl.us", "ipAddress": "10.254.61.22", "node_name": "SelectFH2", "storage_pool": "Local-esxfhha1"}, "json": {}, "msg": "OK (3 bytes)", "redirected": false, "request_id": "275892", "server": "nginx", "status": 200, "strict_transport_security": "max-age=31536000; includeSubDomains", "url": "https://10.105.0.247/api/v3/clusters/b6f39d82-88ed-11ef-87fb-005056a64467/nodes/b6f45fc4-88ed-11ef-87fb-005056a64467"}
TASK [na_ots_cluster : Configure Node - SelectFH-02 - b6f578f0-88ed-11ef-87fb-005056a64467] ** ok: [localhost] => (item=SelectFH1 (10.254.61.21)) => {"ansible_loop_var": "item", "changed": false, "connection": "close", "content_length": "3", "content_type": "application/json", "cookies": {}, "cookies_string": "", "date": "Sat, 12 Oct 2024 23:00:06 GMT", "elapsed": 0, "item": {"capacityTB": "2.4", "host_name": "esxhastor1.palmbeach.k12.fl.us", "ipAddress": "10.254.61.21", "node_name": "SelectFH1", "storage_pool": "Local-esxhastor1"}, "json": {}, "msg": "OK (3 bytes)", "redirected": false, "request_id": "275893", "server": "nginx", "status": 200, "strict_transport_security": "max-age=31536000; includeSubDomains", "url": "https://10.105.0.247/api/v3/clusters/b6f39d82-88ed-11ef-87fb-005056a64467/nodes/b6f578f0-88ed-11ef-87fb-005056a64467"} failed: [localhost] (item=SelectFH2 (10.254.61.22)) => {"ansible_loop_var": "item", "changed": false, "connection": "close", "content_length": "176", "content_type": "application/json", "date": "Sat, 12 Oct 2024 23:00:06 GMT", "elapsed": 0, "item": {"capacityTB": "2.4", "host_name": "esxfhha1.palmbeach.k12.fl.us", "ipAddress": "10.254.61.22", "node_name": "SelectFH2", "storage_pool": "Local-esxfhha1"}, "json": {"error": {"code": "ResourcePatchNotAccepted", "message": "Resource could not be modified: A node cannot share the same name of another node in its cluster."}}, "msg": "Status code was 400 and not [200]: HTTP Error 400: BAD REQUEST", "redirected": false, "request_id": "275894", "server": "nginx", "status": 400, "url": "https://10.105.0.247/api/v3/clusters/b6f39d82-88ed-11ef-87fb-005056a64467/nodes/b6f578f0-88ed-11ef-87fb-005056a64467"}
PLAY RECAP ***
I have been racking my head for weeks trying to automate an ontap select cluster deployment with OnTap Select Deploy 9.7. I have found that the nodes aren't being configured properly when anything but the default name is used "clustername-01" IE. Clustername1 Clustername2.
Also, once I got that figured out there was still issues configuring the storage pools approriately. The correct capacity isn't being specified and is causing the deployment to fail.
The configure_nodes.yml and configure_nodes_storage.yml actions in the na_ots_cluster module seem to need some attention.... This is my first shot at ansible, so it's been a weeks long struggle for me. For now I'm giving up automating the OnTap Select Cluster Creation and will move on to attempting to use the other netapp modules in related to actually configuring the cluster I.E. create Aggs, Volumes, SVM's etc after the cluster is deployed.