-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update na_ontap_volume.py #56207
Update na_ontap_volume.py #56207
Conversation
<!--- Your description here --> Specify the valid choices and default for the type parameter +label: docsite_pr
@lonico @carchi8py something you guys want to take a look at? |
This is going to be a hard one. I'll make an internal story for the team to list which are the valid option for each version of ontap in the documentation. |
sounds good @carchi8py |
ls and dc are new to me. Going from the 9.5 manual (volume create|show), there are only the the two options for volume type:
[-type {RW|DP}]} - Volume Type
This optionally specifies the volume's type, either read-write (RW) or data-protection (DP). If you do not specify a value for this parameter, a RW volume is created by default.
So I believe these are the only valid types to provision (there are others, like DEL, that you can’t directly provision)
Are you perhaps thinking of the snapmirror types?:
Relationship Type: Type of the SnapMirror relationship. Can be
one of the following:
- DP: Data protection relationship.
- LS: Load-sharing relationship.
- XDP: Extended data protection relationship.
- RST: Temporary relationship created
during a restore operation, and
deleted if the operation completes
successfully.
- TDP: 7-mode to clustered Data ONTAP
transition data protection
relationship.
…--Jon
From: Chris Archibald <notifications@github.com>
Reply-To: ansible/ansible <reply@reply.github.com>
Date: Thursday, 9. May 2019 at 20:12
To: ansible/ansible <ansible@noreply.github.com>
Cc: "Tourtellot, Jonathan" <Jonathan.Tourtellot@netapp.com>, Author <author@noreply.github.com>
Subject: Re: [ansible/ansible] Update na_ontap_volume.py (#56207)
NetApp Security WARNING: This is an external email. Do not click links or open attachments unless you recognize the sender and know the content is safe.
This is going to be a hard one.
Depending on the version of ONTAP these options are different. The oldest version we support just has 'rw', 'dp', the most common version user are on supports, 'rw', 'dp', 'ls', 'dc'. And i think the latest version removed one of these.
So we'll have to go with String for this.
I'll make an internal story for the team to list which are the valid option for each version of ontap in the documentation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#56207 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAHCXQ6NKDWKGYAYXOWJPGDPURSQPANCNFSM4HLPM32Q>.
|
In the 9.3 documentation, for volume-create zapi, the volume-type variable allows for the following volume-type | | string optional | The type of the volume to be created. Possible values:
In 9.5 it might be only RW, and DP, but we need to support 9.1 to the latest version. |
@@ -78,7 +78,9 @@ | |||
type: | |||
description: | |||
- The volume type, either read-write (RW) or data-protection (DP). | |||
|
|||
choices: ['rw', 'dp'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @carchi8py pointed out, the ZAPI documentation shows 4 possible values:
- 'rw' - read-write volume (default),
- 'ls' - load-sharing volume,
- 'dp' - data-protection volume,
- 'dc' - data-cache volume (FlexCache)
(this is from SDK documentation for 9.5)
even though the CLI allows only 2 values.
I'll check with the product team why there is such an inconsistency.
This is also why I am always conflicted with choices. On one hand, this is a great way to help the end users. On the other hand, we need to support all possible choices for 9.1 to 9.6. And if 9.7 introduces a new value, it will require a change in the module. While a free format fields give a lot of flexibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to wonder if this is a bug in the ZAPI documentation. There are only 2 places where ls and dc are mentioned.
We should try and see if the ZAPI actually accept these values.
Anyway, this is not a critical fix, so it's better to delay until we know for sure this change would not break anything.
Module documentation must match the argument spec. Adding a default value and choices to the documentation without updating the code will fail our CI system every time. You could add to the |
The test
The test
|
Here's what I'd suggest: change the description of the
This way the documentation of the Ansible module is correct, and users have the right resources to figure out which values they should use. |
Also, you could add a line in the |
Note: Running against 9.6RC1 in the CBC lab in Munich (Trinidad) with the most recent (9.5) SDK I could get my hands on:
RW Volume:
<?xml version="1.0" encoding="UTF-8"?>
<netapp xmlns="http://www.netapp.com/filer/admin" version="1.130">
<volume-create>
<containing-aggr-name>aggr1_trinidad_01</containing-aggr-name>
<is-junction-active>false</is-junction-active>
<size>20m</size>
<volume>volRW</volume>
<volume-comment>RW type volume from the API</volume-comment>
<volume-type>rw</volume-type>
</volume-create>
</netapp>
<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.160' xmlns='http://www.netapp.com/filer/admin'>
<!-- Output of volume-create [Execution Time: 3663 ms] -->
<results status='passed'/>
</netapp>
DP Volume:
<?xml version="1.0" encoding="UTF-8"?>
<netapp xmlns="http://www.netapp.com/filer/admin" version="1.130">
<volume-create>
<containing-aggr-name>aggr1_trinidad_01</containing-aggr-name>
<is-junction-active>false</is-junction-active>
<size>20m</size>
<volume>volDP</volume>
<volume-comment>DP type volume from the API</volume-comment>
<volume-type>dp</volume-type>
</volume-create>
</netapp>
<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.160' xmlns='http://www.netapp.com/filer/admin'>
<!-- Output of volume-create [Execution Time: 3777 ms] -->
<results status='passed'/>
</netapp>
LS Volume:
<?xml version="1.0" encoding="UTF-8"?>
<netapp xmlns="http://www.netapp.com/filer/admin" version="1.130">
<volume-create>
<containing-aggr-name>aggr1_trinidad_01</containing-aggr-name>
<is-junction-active>false</is-junction-active>
<size>20m</size>
<volume>volLS</volume>
<volume-comment>LS type volume from the API</volume-comment>
<volume-type>ls</volume-type>
</volume-create>
</netapp>
<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.160' xmlns='http://www.netapp.com/filer/admin'>
<!-- Output of volume-create [Execution Time: 3154 ms] -->
<results reason='This operation is not supported on a volume of type "LS". ' errno='14472' status='failed'/>
</netapp>
Comment: Might this be a throwback to spinnaker? We have LS mirrors in ONTAP 9, but they write to ‘dp’ volumes.
DC Volume:
<?xml version="1.0" encoding="UTF-8"?>
<netapp xmlns="http://www.netapp.com/filer/admin" version="1.130">
<volume-create>
<containing-aggr-name>aggr1_trinidad_01</containing-aggr-name>
<is-junction-active>false</is-junction-active>
<size>20m</size>
<volume>volDC</volume>
<volume-comment>DC type volume from the API</volume-comment>
<volume-type>dc</volume-type>
</volume-create>
</netapp>
<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.160' xmlns='http://www.netapp.com/filer/admin'>
<!-- Output of volume-create [Execution Time: 3611 ms] -->
<results reason='FlexCache volumes are not supported in this version of Data ONTAP.' errno='13001' status='failed'/>
</netapp>
Comment: 9.6RC1 definitely supports FlexCache (available since 9.5) so I’m strongly inclined to believe the ‘dc’ type volume was the 7-Mode FlexCache volume type and doesn’t exist in ONTAP 9, hence irrelevant to ansible. (I don’t have a FlexCache license available so I can’t fully test how one goes about properly creating a FlexGroup).
From: Laurent Nicolas <notifications@github.com>
Reply-To: ansible/ansible <reply@reply.github.com>
Date: Friday, 14. June 2019 at 07:30
To: ansible/ansible <ansible@noreply.github.com>
Cc: "Tourtellot, Jonathan" <Jonathan.Tourtellot@netapp.com>, Author <author@noreply.github.com>
Subject: Re: [ansible/ansible] Update na_ontap_volume.py (#56207)
NetApp Security WARNING: This is an external email. Do not click links or open attachments unless you recognize the sender and know the content is safe.
@lonico commented on this pull request.
________________________________
In lib/ansible/modules/storage/netapp/na_ontap_volume.py<#56207 (comment)>:
@@ -78,7 +78,9 @@
type:
description:
- The volume type, either read-write (RW) or data-protection (DP).
-
+ choices: ['rw', 'dp']
I'm starting to wonder if this is a bug in the ZAPI documentation. There are only 2 places where ls and dc are mentioned.
We should try and see if the ZAPI actually accept these values.
Anyway, this is not a critical fix, so it's better to delay until we know for sure this change would not break anything.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#56207?email_source=notifications&email_token=AAHCXQ3CADPX4NFRGLWWZTTP2MUF7A5CNFSM4HLPM322YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3RFIXQ#discussion_r293663332>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAHCXQZLCCVKTKPVF25UOW3P2MUF7ANCNFSM4HLPM32Q>.
|
Per request, closing this PR & maintainers will address. |
Specify the valid choices and default for the type parameter
+label: docsite_pr
SUMMARY
Added the specific options available for the "type" field
ISSUE TYPE
COMPONENT NAME
na_ontap_volume
ADDITIONAL INFORMATION
Current documentation is not clear which syntax should be used, as "read-write" and "data-protection" are mentioned as the valid options and the Choices field is blank. I'm just filling in the choices field with the options that actually work correctly (after first using "data-protection" instead of "dp" in my playbook and getting errors!)