ansible.builtin.na_ontap_volume (v2.9.26) — module

NetApp ONTAP manage volumes.

| "added in version" 2.6 of ansible.builtin"

Authors: NetApp Ansible Team (@carchi8py) <ng-ansibleteam@netapp.com>

preview | supported by certified

Install Ansible via pip

Install with pip install ansible==2.9.26

Description

Create or destroy or modify volumes on NetApp ONTAP.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

    - name: Create FlexVol
      na_ontap_volume:
        state: present
        name: ansibleVolume12
        is_infinite: False
        aggregate_name: ansible_aggr
        size: 100
        size_unit: mb
        space_guarantee: none
        tiering_policy: auto
        policy: default
        percent_snapshot_space: 60
        qos_policy_group: max_performance_gold
        vserver: ansibleVServer
        wait_for_completion: True
        space_slo: none
        nvfail_enabled: False
        comment: ansible created volume
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: Volume Delete
      na_ontap_volume:
        state: absent
        name: ansibleVolume12
        aggregate_name: ansible_aggr
        vserver: ansibleVServer
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: Make FlexVol offline
      na_ontap_volume:
        state: present
        name: ansibleVolume
        is_infinite: False
        is_online: False
        vserver: ansibleVServer
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: Create flexGroup volume manually
      na_ontap_volume:
        state: present
        name: ansibleVolume
        is_infinite: False
        aggr_list: "{{ aggr_list }}"
        aggr_list_multiplier: 2
        size: 200
        size_unit: mb
        space_guarantee: none
        policy: default
        vserver: "{{ vserver }}"
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
        https: False
        unix_permissions: 777
        snapshot_policy: default
        time_out: 0
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: Create flexGroup volume auto provision as flex group
      na_ontap_volume:
        state: present
        name: ansibleVolume
        is_infinite: False
        auto_provision_as: flexgroup
        size: 200
        size_unit: mb
        space_guarantee: none
        policy: default
        vserver: "{{ vserver }}"
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
        https: False
        unix_permissions: 777
        snapshot_policy: default
        time_out: 0
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: Create FlexVol with QoS adaptive
      na_ontap_volume:
        state: present
        name: ansibleVolume15
        is_infinite: False
        aggregate_name: ansible_aggr
        size: 100
        size_unit: gb
        space_guarantee: none
        policy: default
        percent_snapshot_space: 10
        qos_adaptive_policy_group: extreme
        vserver: ansibleVServer
        wait_for_completion: True
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: Modify volume dr protection (vserver of the volume must be in a snapmirror relationship)
      na_ontap_volume:
        state: present
        name: ansibleVolume
        vserver_dr_protection: protected
        vserver: "{{ vserver }}"
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
        https: False

Inputs

    
name:
    description:
    - The name of the volume to manage.
    required: true
    type: str

size:
    description:
    - The size of the volume in (size_unit). Required when C(state=present).
    type: int

type:
    description:
    - The volume type, either read-write (RW) or data-protection (DP).
    type: str

https:
    default: false
    description:
    - Enable and disable https.
    - Ignored when using REST as only https is supported.
    - Ignored when using SSL certificate authentication as it requires SSL.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the specified volume should exist or not.

ontapi:
    description:
    - The ontap api version to use
    type: int

policy:
    description:
    - Name of the export policy.
    type: str

comment:
    description:
    - Sets a comment associated with the volume.
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

encrypt:
    default: false
    description:
    - Whether or not to enable Volume Encryption.
    type: bool
    version_added: '2.7'
    version_added_collection: ansible.builtin

vserver:
    description:
    - Name of the vserver to use.
    required: true
    type: str

hostname:
    description:
    - The hostname or IP address of the ONTAP instance.
    required: true
    type: str

language:
    description:
    - Language to use for Volume
    - Default uses SVM language
    - Possible values   Language
    - c                 POSIX
    - ar                Arabic
    - cs                Czech
    - da                Danish
    - de                German
    - en                English
    - en_us             English (US)
    - es                Spanish
    - fi                Finnish
    - fr                French
    - he                Hebrew
    - hr                Croatian
    - hu                Hungarian
    - it                Italian
    - ja                Japanese euc-j
    - ja_v1             Japanese euc-j
    - ja_jp.pck         Japanese PCK (sjis)
    - ja_jp.932         Japanese cp932
    - ja_jp.pck_v2      Japanese PCK (sjis)
    - ko                Korean
    - no                Norwegian
    - nl                Dutch
    - pl                Polish
    - pt                Portuguese
    - ro                Romanian
    - ru                Russian
    - sk                Slovak
    - sl                Slovenian
    - sv                Swedish
    - tr                Turkish
    - zh                Simplified Chinese
    - zh.gbk            Simplified Chinese (GBK)
    - zh_tw             Traditional Chinese euc-tw
    - zh_tw.big5        Traditional Chinese Big 5
    - To use UTF-8 as the NFS character set, append '.UTF-8' to the language code
    type: str
    version_added: '2.8'
    version_added_collection: ansible.builtin

password:
    aliases:
    - pass
    description:
    - Password for the specified user.
    type: str

time_out:
    default: 180
    description:
    - time to wait for flexGroup creation, modification, or deletion in seconds.
    - Error out if task is not completed in defined time.
    - if 0, the request is asynchronous.
    - default is set to 3 minutes.
    type: int
    version_added: '2.8'
    version_added_collection: ansible.builtin

use_rest:
    choices:
    - Never
    - Always
    - Auto
    default: Auto
    description:
    - REST API if supported by the target system for all the resources and attributes
      the module requires. Otherwise will revert to ZAPI.
    - Always -- will always use the REST API
    - Never -- will always use the ZAPI
    - Auto -- will try to use the REST Api
    type: str

username:
    aliases:
    - user
    description:
    - 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 U(https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/).
    - Two authentication methods are supported
    - 1. basic authentication, using username and password,
    - 2. SSL certificate authentication, using a ssl client cert file, and optionally
      a private key file.
    - To use a certificate, the certificate must have been installed in the ONTAP cluster,
      and cert authentication must have been enabled.
    type: str

aggr_list:
    description:
    - an array of names of aggregates to be used for FlexGroup constituents.
    type: list
    version_added: '2.8'
    version_added_collection: ansible.builtin

from_name:
    description:
    - Name of the existing volume to be renamed to name.
    type: str
    version_added: '2.7'
    version_added_collection: ansible.builtin

http_port:
    description:
    - Override the default port (80 or 443) with this port
    type: int

is_online:
    default: true
    description:
    - Whether the specified volume is online, or not.
    type: bool

size_unit:
    choices:
    - bytes
    - b
    - kb
    - mb
    - gb
    - tb
    - pb
    - eb
    - zb
    - yb
    default: gb
    description:
    - The unit used to interpret the size parameter.
    type: str

space_slo:
    choices:
    - none
    - thick
    - semi-thick
    description:
    - Specifies the space SLO type for the volume. The space SLO type is the Service Level
      Objective for space management for the volume.
    - The space SLO value is used to enforce existing volume settings so that sufficient
      space is set aside on the aggregate to meet the space SLO.
    - This parameter is not supported on Infinite Volumes.
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

is_infinite:
    description: Set True if the volume is an Infinite Volume. Deleting an infinite volume
      is asynchronous.
    type: bool

atime_update:
    description:
    - This is an advanced option, the default is True.
    - If false, prevent the update of inode access times when a file is read.
    - This value is useful for volumes with extremely high read traffic, since it prevents
      writes to the inode file for the volume from contending with reads from other files.
    - This field should be used carefully.
    - That is, use this field when you know in advance that the correct access time for
      inodes will not be needed for files on that volume.
    type: bool
    version_added: '2.8'
    version_added_collection: ansible.builtin

key_filepath:
    description:
    - path to SSL client key file.
    type: str
    version_added: 20.6.0
    version_added_collection: netapp.ontap

cert_filepath:
    description:
    - path to SSL client cert file (.pem).
    - not supported with python 2.6.
    type: str
    version_added: 20.6.0
    version_added_collection: netapp.ontap

feature_flags:
    description:
    - 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.
    type: dict
    version_added: 20.5.0
    version_added_collection: netapp.ontap

junction_path:
    description:
    - Junction path of the volume.
    - To unmount, use junction path C('').
    type: str

aggregate_name:
    description:
    - The name of the aggregate the flexvol should exist on.
    - Required when C(state=present).
    type: str

nvfail_enabled:
    description:
    - If true, the controller performs additional work at boot and takeover times if it
      finds that there has been any potential data loss in the volume's constituents due
      to an NVRAM failure.
    - The volume's constituents would be put in a special state called 'in-nvfailed-state'
      such that protocol access is blocked.
    - This will cause the client applications to crash and thus prevent access to stale
      data.
    - To get out of this situation, the admin needs to manually clear the 'in-nvfailed-state'
      on the volume's constituents.
    type: bool
    version_added: '2.9'
    version_added_collection: ansible.builtin

snapdir_access:
    description:
    - This is an advanced option, the default is False.
    - Enable the visible '.snapshot' directory that is normally present at system internal
      mount points.
    - This value also turns on access to all other '.snapshot' directories in the volume.
    type: bool
    version_added: '2.8'
    version_added_collection: ansible.builtin

tiering_policy:
    choices:
    - snapshot-only
    - auto
    - backup
    - none
    description:
    - The tiering policy that is to be associated with the volume.
    - This policy decides whether the blocks of a volume will be tiered to the capacity
      tier.
    - snapshot-only policy allows tiering of only the volume snapshot copies not associated
      with the active file system.
    - auto policy allows tiering of both snapshot and active file system user data to
      the capacity tier.
    - backup policy on DP volumes allows all transferred user data blocks to start in
      the capacity tier.
    - When set to none, the Volume blocks will not be tiered to the capacity tier.
    - If no value specified, the volume is assigned snapshot only by default.
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

validate_certs:
    default: true
    description:
    - If set to C(no), the SSL certificates will not be validated.
    - This should only set to C(False) used on personally controlled sites using self-signed
      certificates.
    type: bool

snapshot_policy:
    description:
    - The name of the snapshot policy.
    - the default policy name is 'default'.
    type: str
    version_added: '2.8'
    version_added_collection: ansible.builtin

space_guarantee:
    choices:
    - none
    - file
    - volume
    description:
    - Space guarantee style for the volume.
    type: str

qos_policy_group:
    description:
    - Specifies a QoS policy group to be set on volume.
    version_added: '2.9'
    version_added_collection: ansible.builtin

unix_permissions:
    description:
    - Unix permission bits in octal or symbolic format.
    - For example, 0 is equivalent to ------------, 777 is equivalent to ---rwxrwxrwx,both
      formats are accepted.
    - The valid octal value ranges between 0 and 777 inclusive.
    type: str
    version_added: '2.8'
    version_added_collection: ansible.builtin

auto_provision_as:
    choices:
    - flexgroup
    description:
    - Automatically provision a FlexGroup volume.
    type: str
    version_added: '2.8'
    version_added_collection: ansible.builtin

efficiency_policy:
    description:
    - Allows a storage efficiency policy to be set on volume creation.
    type: str
    version_added: '2.7'
    version_added_collection: ansible.builtin

wait_for_completion:
    default: false
    description:
    - Set this parameter to 'true' for synchronous execution during create (wait until
      volume status is online)
    - Set this parameter to 'false' for asynchronous execution
    - For asynchronous, execution exits as soon as the request is sent, without checking
      volume status
    type: bool
    version_added: '2.8'
    version_added_collection: ansible.builtin

aggr_list_multiplier:
    description:
    - The number of times to iterate over the aggregates listed with the aggr_list parameter
      when creating a FlexGroup.
    type: int
    version_added: '2.8'
    version_added_collection: ansible.builtin

volume_security_style:
    choices:
    - mixed
    - ntfs
    - unified
    - unix
    default: mixed
    description:
    - The security style associated with this volume.
    type: str

vserver_dr_protection:
    choices:
    - protected
    - unprotected
    description:
    - Specifies the protection type for the volume in a Vserver DR setup.
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

percent_snapshot_space:
    description:
    - Amount of space reserved for snapshot copies of the volume.
    type: int

qos_adaptive_policy_group:
    description:
    - Specifies a QoS adaptive policy group to be set on volume.
    version_added: '2.9'
    version_added_collection: ansible.builtin