netapp.ontap.na_ontap_cg module – NetApp ONTAP module to manage operations related to consistency groups.
Note
This module is part of the netapp.ontap collection (version 23.4.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install netapp.ontap.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: netapp.ontap.na_ontap_cg.
New in netapp.ontap 23.4.0
Synopsis
Create a consistency group with one or more consistency groups having new or existing volumes.
Modify or delete an existing consistency group.
Requirements
The below requirements are needed on the host that executes this module.
Ansible 2.9 or later - 2.12 or later is recommended.
Python3 - 3.9 or later is recommended.
netapp-lib only when using ZAPI (install using ‘pip install netapp-lib’), Please note that netapp-lib is deprecated and no longer maintained. Proceed at your own risk.
A physical or virtual clustered Data ONTAP system, the modules support Data ONTAP 9.1 and onward, REST support requires ONTAP 9.6 or later.
Parameters
Parameter |
Comments |
|---|---|
path to SSL client cert file (.pem). not supported with python 2.6. |
|
List of consistency groups to be included in the consistency group. |
|
The LUNs array can be used to create or modify LUNs in a consistency group on a new or existing volume that is a member of the consistency group. |
|
An array of LUN maps. |
|
Lists of the initiators that are members of the group. |
|
The name of the initiator group. |
|
The os type for the initiator groups. |
|
The fully qualified path name of the LUN composed of the “/vol” prefix, the volume name, the qtree name (optional), and the base name of the LUN. Example, /vol/volume1/lun1 or /vol/volume1/qtree1/lun1. |
|
The os type for the LUN. |
|
Options that are applied to the operation. Module is not idempotent when ‘count’ option is set as the name is considered a prefix, and a suffix of the form _<N> is generated where N is the next available numeric index, starting with 1. |
|
Operation to perform. Choices:
|
|
Number of elements to perform the operation on. |
|
Specifies the provisioned size in |
|
The unit used to interpret the size parameter. Choices:
|
|
Specifies the name of the consistency group. |
|
The namespaces array can be used to create or modify namespaces in a consistency group. |
|
The name of the NVMe namespace, of the form “/vol/<volume>[/<qtree>]/<namespace>” where the qtree name is optional. Example, /vol/volume1/namespace1 or /vol/volume1/qtree1/namespace1. |
|
The os type for the namespace. |
|
Options that are applied to the operation. Module is not idempotent when ‘count’ option is set as the name is considered a prefix, and a suffix of the form _<N> is generated where N is the next available numeric index, starting with 1. |
|
Operation to perform. Choices:
|
|
Number of elements to perform the operation on. |
|
Specifies the provisioned size in |
|
The unit used to interpret the size parameter. Choices:
|
|
Options that are applied to the operation. |
|
Operation to perform. Choices:
|
|
New name for consistency group. Required to resolve naming collisions. Requires ONTAP 9.13.1 or later. |
|
Specifies the QoS policy for the consistency group. Only supported when provisioning new objects. |
|
Specifies the snapshot policy for the consistency group. |
|
List of volumes to be included in the consistency group. The volumes array can be used to create new volumes in the consistency group, add existing volumes to the consistency group. A volume can only be associated with one direct parent consistency group. |
|
Specifies the name of the volume. |
|
Options that are applied to the operation. Module is not idempotent when ‘count’ option is set as the name is considered a prefix, and a suffix of the form _<N> is generated where N is the next available numeric index, starting with 1. |
|
Operation to perform on the volume. Choices:
|
|
Number of elements to perform the operation on. |
|
The QoS policy for this volume. Only supported when provisioning new objects. |
|
Specifies the provisioned size of the volume in |
|
The unit used to interpret the size parameter. Choices:
|
|
The snapshot policy for this volume. |
|
Enable or disable a new feature. This can be used to enable an experimental feature or disable a new feature that breaks backward compatibility. Supported keys and values are subject to change without notice. Unknown keys are ignored. |
|
Override the cluster ONTAP version when using REST. The behavior is undefined if the version does not match the target cluster. This is provided as a work-around when the cluster version cannot be read because of permission issues. See https://github.com/ansible-collections/netapp.ontap/wiki/Known-issues. This should be in the form 9.10 or 9.10.1 with each element being an integer number. |
|
The hostname or IP address of the ONTAP instance. |
|
Override the default port (80 or 443) with this port |
|
Enable and disable https. Ignored when using REST as only https is supported. Ignored when using SSL certificate authentication as it requires SSL. Choices:
|
|
path to SSL client key file. |
|
The LUNs array can be used to create or modify LUNs in a consistency group on a new or existing volume that is a member of the consistency group. |
|
An array of LUN maps. |
|
Lists of the initiators that are members of the group. |
|
The name of the initiator group. |
|
The os type for the initiator groups. |
|
The fully qualified path name of the LUN composed of the “/vol” prefix, the volume name, the qtree name (optional), and the base name of the LUN. Example, /vol/volume1/lun1 or /vol/volume1/qtree1/lun1. |
|
The os type for the LUN. |
|
Options that are applied to the operation. Module is not idempotent when ‘count’ option is set as the name is considered a prefix, and a suffix of the form _<N> is generated where N is the next available numeric index, starting with 1. |
|
Operation to perform. Choices:
|
|
Number of elements to perform the operation on. |
|
Specifies the provisioned size in |
|
The unit used to interpret the size parameter. Choices:
|
|
Specifies the name of the consistency group. The consistency group name must be unique within an SVM. |
|
The namespaces array can be used to create or modify namespaces in a consistency group. |
|
The name of the NVMe namespace, of the form “/vol/<volume>[/<qtree>]/<namespace>” where the qtree name is optional. Example, /vol/volume1/namespace1 or /vol/volume1/qtree1/namespace1. |
|
The os type for the namespace. |
|
Options that are applied to the operation. Module is not idempotent when ‘count’ option is set as the name is considered a prefix, and a suffix of the form _<N> is generated where N is the next available numeric index, starting with 1. |
|
Operation to perform. Choices:
|
|
Number of elements to perform the operation on. |
|
Specifies the provisioned size in |
|
The unit used to interpret the size parameter. Choices:
|
|
Password for the specified user. |
|
Specifies the QoS policy for the consistency group. Only supported when provisioning new objects. |
|
Specifies the snapshot policy for the consistency group. |
|
Specifies whether to create, modify, or delete a consistency group. Choices:
|
|
Specifies if AWS Lambda proxy functionality should be used to connect to the ONTAP system. Supported only with REST. Choices:
|
|
This module only supports REST. always – will always use the REST API. A warning is issued if the module does not support REST. Default: |
|
This can be a Cluster-scoped or SVM-scoped account, depending on whether a Cluster-level or SVM-level API is required. For more information, please read the documentation https://docs.netapp.com/us-en/ontap/authentication/create-svm-user-accounts-task.html. Two authentication methods are supported
To use a certificate, the certificate must have been installed in the ONTAP cluster, and cert authentication must have been enabled. |
|
If set to This should only set to Choices:
|
|
List of volumes to be included in the consistency group. The volumes array can be used to create new volumes in the consistency group, add existing volumes to the consistency group. A volume can only be associated with one direct parent consistency group. Removing all volumes from a consistency group will automatically delete the consistency group. |
|
Specifies the name of the volume. |
|
Options that are applied to the operation. Module is not idempotent when ‘count’ option is set as the name is considered a prefix, and a suffix of the form _<N> is generated where N is the next available numeric index, starting with 1. |
|
Operation to perform on the volume. Choices:
|
|
Number of elements to perform the operation on. |
|
The QoS policy for this volume. Only supported when provisioning new objects. |
|
Specifies the provisioned size of the volume in |
|
The unit used to interpret the size parameter. Choices:
|
|
The snapshot policy for this volume. |
|
Specifies the SVM in which the consistency group is located. |
Notes
Note
Only supported with REST and requires ONTAP 9.10.1 or later.
Update operation will never delete storage elements. Mapping or unmapping a consistency group from igroups or subsystems is not supported.
Delete operation will not delete any associated volumes or LUNs. To delete those elements, use the appropriate object associated modules.
The modules prefixed with na_ontap are built to support the ONTAP storage platform.
https is enabled by default and recommended. To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’
Examples
- name: Creating a single consistency group with a new SAN volume
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: test_cg1
volumes:
- name: test_vol1
size: 50
size_unit: mb
provisioning_options:
action: create
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Adding an existing volume to an existing consistency group
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: test_cg1
volumes:
- name: test_vol2
provisioning_options:
action: add
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Adding LUNs to an existing volume in an existing consistency group
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: test_cg1
luns:
- name: "/vol/test_vol2/new_lun"
size: 5
size_unit: mb
os_type: linux
provisioning_options:
action: create
lun_maps:
- igroup_name: new_igroup1
igroup_initiators:
- iqn.1995-08.com.example:new-initiator1
os_type: linux
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Adding namespaces to an existing volume in an existing consistency group
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: test_cg1
namespaces:
- name: "/vol/test_vol2/new_namespace"
size: 5
size_unit: mb
os_type: linux
provisioning_options:
action: create
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Deleting a CG (consistency group)
netapp.ontap.na_ontap_cg:
state: absent
vserver: svm1
name: test_cg1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Creating a parent CG with two child consistency groups with existing SAN volumes
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: parent_cg
consistency_groups:
- name: child_1
volumes:
- name: test_vol1
provisioning_options:
action: add
- name: child_2
volumes:
- name: test_vol2
provisioning_options:
action: add
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Removing a child consistency group from nested CG
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: parent_cg
consistency_groups:
- name: child_2
provisioning_options:
action: remove
name: new_single_cg
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
- name: Creating a parent CG with a new child CG with existing volumes
netapp.ontap.na_ontap_cg:
state: present
vserver: svm1
name: parent_cg
consistency_groups:
- name: child_1
provisioning_options:
action: create
volumes:
- name: test_vol1
provisioning_options:
action: add
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: "{{ validate_certs }}"
Authors
NetApp Ansible Team (@carchi8py)