Welcome to the documentation for HPE Storage Ansible Module.
This comprehensive guide covers:
- HPE Ansible Module for Alletra MP storage automation
- Installation & Setup instructions
- System Requirements and platform compatibility
- Getting Started guides and quick examples
- Module Reference documentation with detailed operation methods
These modules enable automation of HPE Alletra MP storage arrays with Ansible.
- Overview
- System Requirements
- Installation & Setup
- Running Unit Tests
- Getting Started
- Supported Modules
- Module Reference
The HPE Storage Ansible Module enable automation of storage provisioning for the HPE Alletra MP array. The modules use the HPE Storage Flowkit for Python to communicate with the storage array over the WSAPI REST interface.
Supported Storage Platform:
- HPE Alletra MP (OS version 10.5.x)
What You Can Automate:
The collection provides modules to automate complete storage lifecycle management including:
- Volume and volume set operations
- Host and host set operations
- Storage provisioning operations (CPG)
- VLUN management
- Data protection with snapshots
- Manages Online and Offline Clones
- Replication Copy Group operations
- Performance optimization with QoS policies
- System Management - DNS, NTP and user accounts.
- SSL/TLS certificate management
- Alert monitoring and test alert generation
Key Benefits:
- Declarative - Define desired state, Ansible handles the implementation
- Idempotent - Safe to run repeatedly without side effects
- Error Handling - Clear error messages with parameter validation
Actions are Idempotent when they can be run multiple times on the same system and the results will always be identical, without producing unintended side effects.
The following actions are non-idempotent:
- Clone: resync, create_offline
- Snapshot: restore online, restore offline
- Virtual Volume: grow
- VLUN: All actions become non-idempotent when autolun is set to true
- Alert: test_alert
Platform Compatibility:
| Component | Version | Status |
|---|---|---|
| HPE Alletra MP | OS 10.5.x with WSAPI service enabled | ✅ Required |
| Ansible | 2.17.4 | ✅ Supported |
| Python | 3.10 + | ✅ Required |
Prerequisites:
- pip: Python package installer must be available (
pip --versionto verify) - Network Connectivity: Connectivity to HPE Alletra MP array
- WSAPI Service: Enabled on the target HPE Alletra MP array
Python Package Dependencies:
| Package | Version |
|---|---|
| hpe_storage_flowkit_py | 0.8 |
Installation:
pip install hpe-storage-flowkit-pyThis guide walks you through installing and configuring the HPE Storage Ansible Module for Alletra MP.
Prerequisites:
Refer to System Requirements for detailed platform compatibility and dependency information.
Install Ansible and the required HPE Storage Flowkit python package:
pip install ansible
pip install hpe-storage-flowkit-pyTest that the packages were installed correctly:
python3 -c "import hpe_storage_flowkit_py; print('✓ HPE Storage Flowkit installed successfully')"Expected Outcomes:
- Success: Message displays without errors
- Error: Missing dependencies - reinstall packages and retry
Troubleshooting:
If import fails, check:
# Verify pip installation
pip list | grep hpe_storage
# Check Python path
python3 -c "import sys; print('\n'.join(sys.path))"
# Reinstall if needed
pip uninstall hpe-storage-flowkit-py
pip install hpe-storage-flowkit-pyClone the latest HPE Alletra MP Ansible module repository from GitHub:
git clone https://github.com/hpe-storage/hpe_storage_ansible_modules.git
cd hpe_storage_ansible_modulesRepository Contents:
alletramp/- Main module directory for AlletraMPansible_service.py- Ansible client that interfaces with hpe_storage_flowkit_pymodules/- Ansible modules for HPE Alletra MPplaybooks/- Example playbooks and templatesansible.cfg- Sample Ansible configuration
Set up the required environment variables:
export PYTHONPATH="/path/to/your/hpe_storage_ansible_modules/alletramp:$PYTHONPATH"
export ANSIBLE_CONFIG="/path/to/your/hpe_storage_ansible_modules/alletramp/ansible.cfg"
export PATH="$HOME/.local/bin:$PATH"Note: Replace /path/to/your/ with your actual installation path.
Edit the ansible.cfg file in your project root directory to specify the module library path:
library = /path/to/your/hpe_storage_ansible_modules/alletramp/modulesExample with Absolute Path:
[defaults]
library = /home/user/workspace/hpe_storage_ansible_modules/modulesCreate a simple test playbook to verify your setup.
Quick Setup Checklist:
- ☐ Python dependencies installed
- ☐ Python package import test passed
- ☐ Environment variables configured
- ☐ ansible.cfg updated with correct library path
- ☐ Test playbook executed successfully
This section explains how to run the unit tests for the HPE Storage Ansible Module.
Install the required testing dependencies:
pip install pytest mockRun tests from the hpe_storage_ansible_modules/alletramp directory:
python3 -m pytest -vv -spython3 -m pytest test/test_alletramp_volume.py -vv -spython3 -m pytest test/test_alletramp_volume.py::TestAlletrampVolume::test_create_volume_success -vv -sSetting up your working directory:
cd /path/to/hpe_storage_ansible_modules/alletramp
python3 -m pytestNote: Python Path should be set to hpe_storage_ansible_modules/alletramp for running test files.
This guide provides quick examples to help you start using the HPE Storage Ansible Module for Alletra MP.
Prerequisites:
Before you begin, ensure you have:
- ✅ Ansible installed (2.17.4)
- ✅ Python 3.10 or later
- ✅ HPE Storage Ansible Module is cloned
- ✅ Python dependencies installed (
hpe_storage_flowkit_py) - ✅ Connectivity to your Alletra MP array
- ✅ Valid credentials with appropriate privileges
See Installation & Setup for detailed instructions.
Basic Playbook Structure:
All playbooks follow this basic structure:
---
- name: Manage HPE Alletra MP Storage
hosts: localhost
vars:
storage_ip: "10.10.10.100"
storage_user: "admin"
storage_pass: "password"
tasks:
# Your tasks hereExample: Create a Volume
---
- hosts: localhost
tasks:
- name: Create volume
alletramp_volume:
storage_system_ip: "10.10.10.100"
storage_system_username: "admin"
storage_system_password: "password"
operation: create
volume_name: "prod_vol_001"
cpg: "SSD_CPG"
size: 100Running Playbooks:
Execute your playbook:
ansible-playbook -i <playbook.yml> -vvvThis section provides an overview of all modules available in the HPE Storage Ansible Module for Alletra MP.
| Module | Description |
|---|---|
alletramp_alert |
Queries alerts and generates test alerts |
alletramp_certs |
Manages SSL/TLS certificates for array services |
alletramp_cpg |
Manages Common Provisioning Group (storage pool) operations |
alletramp_dns |
Manages DNS configuration and network settings |
alletramp_host |
Manages host operations with FC/iSCSI initiators and CHAP authentication |
alletramp_hostset |
Manages host set operations for grouping multiple hosts |
alletramp_ntp |
Manages NTP configuration for time servers and timezone |
alletramp_offline_clone |
Manages offline clone operations |
alletramp_online_clone |
Manages online clone operations |
alletramp_qos |
Manages QoS operations for performance limits and priorities |
alletramp_remote_copy |
Manages remote copy operations for replication groups |
alletramp_snapshot |
Manages snapshot operations |
alletramp_user |
Manages user account operations |
alletramp_vlun |
Manages VLUN operations for exporting |
alletramp_volume |
Manages volume operations |
alletramp_volumeset |
Manages volume set operations |