netapp.ontap.na_ontap_aggregate module – NetApp ONTAP manage aggregates.
Note
This module is part of the netapp.ontap collection (version 21.20.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
.
To use it in a playbook, specify: netapp.ontap.na_ontap_aggregate
.
New in version 2.6.0: of netapp.ontap
Requirements
The below requirements are needed on the host that executes this module.
Ansible 2.9
Python3 netapp-lib (2018.11.13) or later. Install using ‘pip install netapp-lib’
netapp-lib 2020.3.12 is strongly recommended as it provides better error reporting for connection issues.
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.
To enable http on the cluster you must run the following commands ‘set -privilege advanced;’ ‘system services web modify -http-enabled true;’
Parameters
Parameter |
Comments |
---|---|
path to SSL client cert file (.pem). not supported with python 2.6. |
|
Class of disk to use to build aggregate.
Choices:
|
|
Number of disks to place into the aggregate, including parity disks. The disks in this newly-created aggregate come from the spare disk pool. The smallest disks in this pool join the aggregate first, unless the Either Required when Modifiable only if specified disk_count is larger than current disk_count. Cannot create raidgroup with 1 disk when using raid type raid4. If the disk_count % raid_size == 1, only disk_count/raid_size * raid_size will be added. If disk_count is 6, raid_type is raid4, raid_size 4, all 6 disks will be added. If disk_count is 5, raid_type is raid4, raid_size 4, 5/4 * 4 = 4 will be added. 1 will not be added. With REST, |
|
Disk size to use in 4K block size. Disks within 10% of specified size will be used. With REST, this is converted to bytes using 4096. Use |
|
Disk size to use in the specified unit. It is a positive integer number followed by unit of T/G/M/K. For example, 72G, 1T and 32M. Or the unit can be omitted for bytes (REST also accepts B). This option is ignored if a specific list of disks is specified through the “disks” parameter. You must only use one of either “disk-size” or “disk-size-with-unit” parameters. With REST, this is converted to bytes, assuming K=1024. |
|
Type of disk to use to build aggregate. Not supported with REST - see SSD-NVM, SSD-CAP were added with ONTAP 9.6. VMLUN was added with ONTAP 9.9. Choices:
|
|
Specific list of disks to use for the new aggregate. To create a “mirrored” aggregate with a specific list of disks, both ‘disks’ and ‘mirror_disks’ options must be supplied. Additionally, the same number of disks must be supplied in both lists. Not supported with REST. |
|
whether to enable software encryption. this is equivalent to -encrypt-with-aggr-key when using the CLI. requires a VE license. Choices:
|
|
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. |
|
Name of the aggregate to be renamed. |
|
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:
|
|
only valid when disks option is used. disks in a plex should belong to the same spare pool, and mirror disks to another spare pool. when set to true, these checks are ignored. Ignored with REST as disks is not supported. Choices:
|
|
Specifies that the new aggregate be mirrored (have two plexes). If set to true, then the indicated disks will be split across the two plexes. By default, the new aggregate will not be mirrored. This option cannot be used when a specific list of disks is supplied with either the ‘disks’ or ‘mirror_disks’ options. Choices:
|
|
path to SSL client key file. |
|
List of mirror disks to use. It must contain the same number of disks specified in ‘disks’. Not supported with REST. |
|
The name of the aggregate to manage. |
|
Node(s) for the aggregate to be created on. If no node specified, mgmt lif home will be used. ZAPI only - if multiple nodes specified an aggr stripe will be made. With REST, only one node can be specified. If disk_count is present, node name is required. |
|
Name of the object store configuration attached to the aggregate. |
|
The ontap api version to use |
|
Password for the specified user. |
|
Sets the maximum number of drives per raid group. |
|
Specifies the type of RAID groups to use in the new aggregate. raid_0 is only available on ONTAP Select. Choices:
|
|
Whether the specified aggregate should be enabled or disabled. Creates aggregate if doesnt exist. Not supported with REST when set to offline. REST does not support changing the state from offline to online, and reciprocally. Choices:
|
|
Type of snaplock for the aggregate being created. Choices:
|
|
Specifies the spare pool from which to select spare disks to use in creation of a new aggregate. Not supported with REST. Choices:
|
|
Whether the specified aggregate should exist or not. Choices:
|
|
time to wait for aggregate creation in seconds. default is set to 100 seconds. Default: 100 |
|
If set to “TRUE”, this option specifies that all of the volumes hosted by the given aggregate are to be unmounted before the offline operation is executed. By default, the system will reject any attempt to offline an aggregate that hosts one or more online volumes. Ignored with REST as offlining an aggregate is not supported. Choices:
|
|
Whether to use REST or ZAPI. always – will always use the REST API if the module supports REST. A warning is issued if the module does not support REST. An error is issued if a module option is not supported in REST. never – will always use ZAPI if the module supports ZAPI. An error may be issued if a REST option is not supported in ZAPI. auto – will try to use the REST API if the module supports REST and modules options are supported. Reverts to ZAPI otherwise. Default: “auto” |
|
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://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/. 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:
|
|
Set this parameter to ‘true’ for synchronous execution during create (wait until aggregate status is online). Set this parameter to ‘false’ for asynchronous execution. For asynchronous, execution exits as soon as the request is sent, without checking aggregate status. Ignored with REST (always wait). Choices:
|
Notes
Note
supports check_mode.
support ZAPI and REST.
The modules prefixed with na_ontap are built to support the ONTAP storage platform.
Examples
- name: Create Aggregates and wait 5 minutes until aggregate is online
netapp.ontap.na_ontap_aggregate:
state: present
service_state: online
name: ansibleAggr
disk_count: 1
wait_for_online: True
time_out: 300
snaplock_type: non_snaplock
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Manage Aggregates
netapp.ontap.na_ontap_aggregate:
state: present
service_state: offline
unmount_volumes: true
name: ansibleAggr
disk_count: 1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Attach object store
netapp.ontap.na_ontap_aggregate:
state: present
name: aggr4
object_store_name: sgws_305
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Rename Aggregates
netapp.ontap.na_ontap_aggregate:
state: present
service_state: online
from_name: ansibleAggr
name: ansibleAggr2
disk_count: 1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Delete Aggregates
netapp.ontap.na_ontap_aggregate:
state: absent
service_state: offline
unmount_volumes: true
name: ansibleAggr
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
Authors
NetApp Ansible Team (@carchi8py)