Skip to content
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

Added NetApp ONTAP Adaptive QoS Policy Module #58707

Open
wants to merge 5 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@joshedmonds
Copy link

commented Jul 4, 2019

SUMMARY
ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

na_ontap_qos_adaptive_policy_group

ADDITIONAL INFORMATION

Example playbook to create, modify and rename an Adaptive QoS Policy Group

---
- hosts: localhost

  vars:
   login: &login
     hostname: "{{ hostname }}"
     username: "{{ username }}"
     password: "{{ password }}"
     https: true
     validate_certs: false

 name: basic provisioning testing
 tasks:
   - name: create qos policy group
     na_ontap_qos_adaptive_policy_group:
       state: present
       name: aqos_new
       vserver: je_ansible
       absolute_min_iops: 50IOPS
       expected_iops: 150IOPS/TB
       peak_iops: 220IOPS/TB
       peak_iops_allocation: allocated_space
       <<: *login
    - name: modify qos policy group
      na_ontap_qos_adaptive_policy_group:
        state: present
        name: adaptive_qos_pol1
        vserver: je_ansible
        absolute_min_iops: 75IOPS
        expected_iops: 200IOPS/TB
        peak_iops: 300IOPS/TB
        peak_iops_allocation: allocated_space
        <<: *login
    - name: rename qos policy group
      na_ontap_qos_adaptive_policy_group:
        state: present
        name: adaptive_qos_pol1_renamed
        from_name: adaptive_qos_pol1
        vserver: je_ansible
        absolute_min_iops: 75IOPS
        expected_iops: 200IOPS/TB
        peak_iops: 300IOPS/TB
        peak_iops_allocation: allocated_space
        <<: *login


Playbook output (create):

TASK [create qos policy group] 
changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "absolute_min_iops": "50IOPS",
            "expected_iops": "150IOPS/TB",
            "force": false,
            "from_name": null,
            "hostname": "cluster1",
            "http_port": null,
            "https": true,
            "name": "adaptive_qos_pol1",
            "ontapi": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "peak_iops": "220IOPS/TB",
            "peak_iops_allocation": "allocated_space",
            "state": "present",
            "username": "admin",
            "validate_certs": false,
            "vserver": "je_ansible"
        }
    }
}

ONTAP output (create):

::> qos adaptive-policy-group show -policy-group adaptive_qos_pol1

                 Name: adaptive_qos_pol1
              Vserver: je_ansible
                 Uuid: b3b2f429-9e1e-11e9-a00e-00a0b8eb802b
                   ID: 4174
        Expected IOPS: 150IOPS/TB
            Peak IOPS: 220IOPS/TB
Absolute Minimum IOPS: 50IOPS
 Peak IOPS Allocation: allocated-space
  Number of Workloads: 0

Playbook output (modify):

TASK [modify qos policy group]
changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "absolute_min_iops": "75IOPS",
            "expected_iops": "200IOPS/TB",
            "force": false,
            "from_name": null,
            "hostname": "cluster1",
            "http_port": null,
            "https": true,
            "name": "adaptive_qos_pol1",
            "ontapi": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "peak_iops": "300IOPS/TB",
            "peak_iops_allocation": "allocated_space",
            "state": "present",
            "username": "admin",
            "validate_certs": false,
            "vserver": "je_ansible"
        }
    }
}

ONTAP output (modify):

::> qos adaptive-policy-group show -policy-group adaptive_qos_pol1

                 Name: adaptive_qos_pol1
              Vserver: je_ansible
                 Uuid: b3b2f429-9e1e-11e9-a00e-00a0b8eb802b
                   ID: 4174
        Expected IOPS: 200IOPS/TB
            Peak IOPS: 300IOPS/TB
Absolute Minimum IOPS: 75IOPS
 Peak IOPS Allocation: allocated-space
  Number of Workloads: 0

Playbook output (rename):

TASK [rename qos policy group]
changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "absolute_min_iops": "75IOPS",
            "expected_iops": "200IOPS/TB",
            "force": false,
            "from_name": "adaptive_qos_pol1",
            "hostname": "nse-ots-per01.ausngs.netapp.au",
            "http_port": null,
            "https": true,
            "name": "adaptive_qos_pol1_renamed",
            "ontapi": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "peak_iops": "300IOPS/TB",
            "peak_iops_allocation": "allocated_space",
            "state": "present",
            "username": "admin",
            "validate_certs": false,
            "vserver": "je_ansible"
        }
    }
}

ONTAP output (rename):

::> qos adaptive-policy-group show -policy-group adaptive_qos_pol1_renamed

                 Name: adaptive_qos_pol1_renamed
              Vserver: je_ansible
                 Uuid: b3b2f429-9e1e-11e9-a00e-00a0b8eb802b
                   ID: 4174
        Expected IOPS: 200IOPS/TB
            Peak IOPS: 300IOPS/TB
Absolute Minimum IOPS: 75IOPS
 Peak IOPS Allocation: allocated-space
  Number of Workloads: 0

Playbook output (delete):

TASK [delete qos policy group]
changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "absolute_min_iops": null,
            "expected_iops": null,
            "force": false,
            "from_name": null,
            "hostname": "cluster1",
            "http_port": null,
            "https": true,
            "name": "adaptive_qos_pol1",
            "ontapi": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "peak_iops": null,
            "peak_iops_allocation": "used_space",
            "state": "absent",
            "username": "admin",
            "validate_certs": false,
            "vserver": "je_ansible"
        }
    }
}

ONTAP output (delete):

::> qos adaptive-policy-group show -policy-group adaptive_qos_pol1
There are no entries matching your query.
@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 4, 2019

@albinpopote @amit0701 @carchi8py @dprts @hulquest @lmprice @lonico @ndswartz @schmots1 @timuster @vicmunoz

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot removed the needs_triage label Jul 4, 2019

Joshua Edmonds
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2019

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/modules/storage/netapp/na_ontap_qos_adaptive_policy_group.py:327:1: E302 expected 2 blank lines, found 1
test/units/modules/storage/netapp/test_na_ontap_qos_adaptive_policy_group.py:135:9: E265 block comment should start with '# '

click here for bot help

Joshua Edmonds
@carchi8py

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

@lonico Do we want to have them bring this into our internal pipeline and run through the other sets of tests we have?

@lonico

lonico approved these changes Jul 9, 2019

Copy link
Contributor

left a comment

shipit

@lonico

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

@carchi8py I think this is good as is. We can pull it back, and fix any issue later if we find any.

@carchi8py
Copy link
Contributor

left a comment

ship it

self.module.fail_json(
msg="the python NetApp-Lib module is required")
else:
self.server = netapp_utils.setup_na_ontap_zapi(

This comment has been minimized.

Copy link
@carchi8py

carchi8py Jul 11, 2019

Contributor

If we are running this as a vserver admin (instead of cluster admin) the vserver needs to be passed into the setup function
Here an example.
https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/storage/netapp/na_ontap_quotas.py#L173

This comment has been minimized.

Copy link
@joshedmonds

joshedmonds Jul 12, 2019

Author

Looking at ZAPI, the qos-* API's are not available at the vserver level; it's only a cluster admin permitted operation at this point.

This comment has been minimized.

Copy link
@lonico

lonico Jul 16, 2019

Contributor

The semantics in create are consistent with using a vserver in a cluster context, so I'm good with that. But I don't see vserver being used in modify or delete. Does it mean that a policy name is unique across a cluster ? Or said otherwise, that 2 vservers cannot use the same policy name (or it points to the same policy).

This comment has been minimized.

Copy link
@joshedmonds

joshedmonds Jul 16, 2019

Author

That's correct - policy names cannot conflict with the cluster-level default policies (extreme, performance, value). They must also be unique across the cluster; defining the same policy name within two vservers results in a ZAPI error.

@ansibot ansibot added the stale_ci label Jul 14, 2019

@ansibot ansibot removed the stale_ci label Jul 16, 2019

@lonico

lonico approved these changes Jul 18, 2019

Copy link
Contributor

left a comment

shipit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.