hpe.nimble.hpe_nimble_volume module – Manage the HPE Nimble Storage volumes
Note
This module is part of the hpe.nimble collection (version 1.1.4).
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 hpe.nimble
.
To use it in a playbook, specify: hpe.nimble.hpe_nimble_volume
.
New in version 1.0.0: of hpe.nimble
Requirements
The below requirements are needed on the host that executes this module.
Ansible 2.9 or later
Python 3.6 or later
HPE Nimble Storage SDK for Python
HPE Nimble Storage arrays running NimbleOS 5.0 or later
Parameters
Parameter |
Comments |
---|---|
External management agent type. Choices:
|
|
Application identifier of volume. |
|
Size in bytes of blocks in the volume. |
|
If set to true, all the contents of this volume are kept in flash cache. Choices:
|
|
Indicate caching the volume is enabled. Choices:
|
|
Change name of the existing source volume. |
|
Whether this volume is a clone. Use this attribute in combination with name and snapshot to create a clone by setting clone = true. Choices:
|
|
Indicate whether dedupe is enabled. Choices:
|
|
Text description of volume. |
|
Name of the destination pool where the volume is moving to. |
|
The encryption cipher of the volume. Choices:
|
|
Name of the folder holding this volume. |
|
Forcibly offline, reduce size or change read-only status a volume. Choices:
|
|
Forcibly move a virtual volume. Choices:
|
|
HPE Nimble Storage IP address. |
|
This indicates whether volume is exported under iSCSI Group Target or iSCSI volume target. This attribute is only meaningful to iSCSI system. Choices:
|
|
Limit on the volume’s mapped usage, expressed as a percentage of the volume’s size. |
|
IOPS limit for this volume. |
|
Throughput limit for this volume in MB/s. |
|
User defined key-value pairs that augment an volume’s attributes. List of key-value pairs. Keys must be unique and non-empty. When creating an object, values must be non-empty. When updating an object, an empty value causes the corresponding key to be removed. |
|
Move a volume to different pool. Choices:
|
|
For iSCSI volume target, this flag indicates whether the volume and its snapshots can be accessed from multiple initiators at the same time. Choices:
|
|
Name of the source volume. |
|
Online state of volume, available for host initiators to establish connections. Choices:
|
|
Name of group that currently owns the volume. |
|
Name of parent volume. |
|
HPE Nimble Storage password. |
|
Name of the performance policy. After creating a volume, performance policy for the volume can only be changed to another performance policy with same block size. |
|
Name associated with the pool in the storage pool table. |
|
Volume is read-only. Choices:
|
|
Volume size in megabytes. Size is required for creating a volume but not for cloning an existing volume. |
|
Base snapshot name. This attribute is required together with name and clone when cloning a volume with the create operation. |
|
The volume operations. Choices:
|
|
Set volume’s provisioning level to thin. Choices:
|
|
HPE Nimble Storage user name. |
|
Name of volume collection of which this volume is a member. Use this attribute in update operation to associate or dissociate volumes with or from volume collections. When associating, set this attribute to the name of the volume collection. When dissociating, set this attribute to empty string. |
Examples
# If state is "create", then create a volume if not present. Fails if already present.
# if state is present, then create a volume if not present. Succeeds if it already exists.
- name: Create volume if not present
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
state: "{{ state | default('present') }}"
size: "{{ size }}"
limit_iops: "{{ limit_iops }}"
limit_mbps: 5000
force: false
metadata: "{{ metadata }}" # metadata = {'mykey1': 'myval1', 'mykey2': 'myval2'}
description: "{{ description }}"
name: "{{ name }}"
- name: Changing volume "{{ name }}" to offline state
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
online: False
state: present
name: "{{ name }}"
- name: Changing volume "{{ name }}" to online state
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
online: True
state: present
name: "{{ name }}"
# Create a clone from the given snapshot name.
# If snapshot name is not provided then a snapshot is created on the source volume.
# Clone task only run if "parent" is specified. Snapshot is optional.
- name: Create or Refresh a clone
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
name: "{{ name }}" # name here is the name of cloned volume
parent: "{{ parent | mandatory }}"
snapshot: "{{ snapshot | default(None)}}"
state: "{{ state | default('present') }}"
when:
- parent is defined
- name: Destroy volume (must be offline)
hpe.nimble.hpe_nimble_volume:
name: "{{ name }}"
state: absent
# If no snapshot is given, then restore volume to last snapshot. Fails if no snapshots exist.
# If snapshot is provided, then restore volume from specified snapshot.
- name: Restore volume "{{ name }}"
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
name: "{{ name }}"
snapshot: "{{ snapshot | default(None)}}"
state: restore
- name: Delete volume "{{ name }}" (must be offline)
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
name: "{{ name }}"
state: absent
- name: Move volume to pool
hpe.nimble.hpe_nimble_volume:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
move: true
name: "{{ name }}"
state: present
destination: "{{ destination | mandatory }}"
Authors
HPE Nimble Storage Ansible Team (@ar-india)