#ontap collection, we want to migrate from 21.18.0 -> 22.7.0

1 messages · Page 1 of 1 (latest)

opaque tapir
#

hello,
I am testing new ontap collection, we want to migrate from 21.18.0 -> 22.7.0
I have a problem with na_ontap_volume when creating DP volume.
it seems that it is no longer permissible to set security-style:

msg": "Error modifying volume test_vol calling: storage/volumes/xxxx: got {'message': 'Modification of the following fields: security-style not allowed for volumes of the type "Flexible volume - DP read-only volume".', 'code': '917628'}."

following are module args:

"module_args": {
"state": "present",
"name": "test_vol",
"vserver": "xxx",
"aggregate_name": "xxx",
"type": "DP",
"size": 1575,
"percent_snapshot_space": 35,
"size_unit": "mb",
"size_change_threshold": 0,
"policy": "default",
"encrypt": true,
"snapshot_policy": "none",
"space_guarantee": "none",
"volume_security_style": "unix",
"comment": "testalloc",
"wait_for_completion": true,
"hostname": "xxx",
"username": "xxx",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"https": true,
"validate_certs": false,
"export_policy": "default",
"use_rest": "auto",

This is odd as it worked on the older collection version.

I understand, that for DP volume security-style might not matter, but it used to be possible to use the same playbook to allocate both source and destination.
If i have to eliminate security-style from module arguments, then i need separate tasks for source and destination

knotty salmon
#

what exactly is your question?

#

if you feel this is a bug or regression, it would probably be best to raise an issue on GitHub

opaque tapir
#

to me it looks like a bug, or at least silent change in behavior.
Is there any way to make an argument presence in a task conditional ?

or in in this situation i wil be forced to create different task for RW and DP volumes ?

pastel plume
#

So the big change between 21.18.0 an 22.7.0 is that the default ONTAP API switches from REST to Zapi.

Before it was using ZAPI to make the change it now using rest.

If you change "use_rest": "never",

it should go back to your old behavor.

opaque tapir
#

I understand that, but entire point of this migration is to prepare for ontap 9.13 which will no longer support ZAPI

what we did is duplication of the task with conditions for RW and DP types.
it does not look nice but works
i was hoping for a more "elegant" solution.

stuck sleet
#

I agree, the module shouldn't behave like that. Why not omit it in the module if the API will throw an error? Much more than not, switching to REST breaks existing workflows. 🙁
You could use some ugly Ansible magic to work around it:

volume_security_style: "{{ 'unix' if sample_var == 'RW' else omit }}"