When specifying the type parameter in na_ontap_volume, if you specify RW it will cause the task to fail with a fatal error after the volume has been created on the storage cluster. This appears to be due to the API returning the type as rw (lower case) as part of a GET response on the object. The na_ontap_volume module code should handle this difference and allow the user to specify the volume type as either upper or lower case. When the type is specified as rw in the module, it works as expected.
Task should run without a failure. The input of "type" parameter should not be case sensitive.
Actual Results
When you run the task the first time, it will create the volume in ONTAP but will return this error
TASK [Create nfs volume] ************************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error: volume type was not set properly at creation time. Current: rw, desired: RW."}
If you run the task a second time after the volume is created, you will see this error.
TASK [Create nfs volume] ************************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error: changing a volume from one type to another is not allowed. Current: rw, desired: RW."}
Looking at the output of an na_ontap_rest_info call. I see that the API is returning the "type" field as "rw" instead of "RW"
TASK [debug] *********************************************************************************************************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
"volume_info": {
"changed": false,
"failed": false,
"ontap_info": {
"storage/volumes": {
"_links": {
"self": {
"href": "/api/storage/volumes?fields=name%2Ctype&max_records=1024&svm.name=natestdal0505-fc_vs00&name=ansible_testvol"
}
},
"num_records": 1,
"records": [
{
"_links": {
"self": {
"href": "/api/storage/volumes/c4a954ca-6905-11ee-b059-d039ea4f9878"
}
},
"name": "ansible_testvol",
"svm": {
"name": "natestdal0505-fc_vs00"
},
"type": "rw",
"uuid": "c4a954ca-6905-11ee-b059-d039ea4f9878"
}
]
}
}
}
}
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
Summary
When specifying the type parameter in na_ontap_volume, if you specify RW it will cause the task to fail with a fatal error after the volume has been created on the storage cluster. This appears to be due to the API returning the type as rw (lower case) as part of a GET response on the object. The na_ontap_volume module code should handle this difference and allow the user to specify the volume type as either upper or lower case. When the type is specified as rw in the module, it works as expected.
Component Name
na_ontap_volume
Ansible Version
ONTAP Collection Version
ONTAP Version
Playbook
Steps to Reproduce
Expected Results
Task should run without a failure. The input of "type" parameter should not be case sensitive.
Actual Results