Akrog.storage
Ansible Storage Role
The Ansible Storage Role is a tool that helps system administrators automate storage management tasks, regardless of the storage vendor.
This role supports more than 80 block storage drivers by default and allows expansion to include other storage providers.
With this tool, you can create reusable playbooks to perform tasks on any of the supported storage systems.
It enables developers or application owners to manage and use storage volumes directly from any Linux machine.
The Storage Role supports different types of storage:
- Block storage
- Shared filesystems
- Object storage
Use Cases:
- Automate volume creation for:
- Bare metal servers
- Virtual machines (VMs) using the virt Ansible module
- VMs managed through oVirt, OpenStack, and VMware
- Cloud platforms
- Take regular snapshots of storage volumes
- Use a "golden" volume for quick provisioning (volume cloning)
- Increase the size of volumes
- Set Quality of Service (QoS) for volumes
- Migrate volumes between different storage systems
Features
The Storage Role currently works with block storage and has simplified these operations:
- Retrieve backend statistics
- Create volumes
- Delete volumes
- Extend volumes
- Attach volumes
- Detach volumes
Getting Started
Here's how to run your first Storage playbook.
Running the example playbook will install necessary packages and create a Volume Group (VG). We recommend running these commands inside a virtual machine (VM) or changing the IP variable to match a VM's IP.
Once the LVM VG is set up, the playbook will create a volume, attach it via iSCSI, show the device details, detach it, and finally delete the volume.
To start, we need to install the Storage Role.
$ ansible-galaxy install Akrog.storage
After installing the role, you can run it as follows.
This example runs the playbook on the local host and assumes that:
- SSH is enabled
- Your SSH key is set up
- You can run
sudo
commands without a password
$ IP=127.0.0.1
$ cd ~/.ansible/roles/Akrog.storage/example
$ ansible-playbook -i $IP, lvm-backend.yml
In this example, we’re not using a real storage system. Instead, the playbook creates a virtual LVM Volume Group (VG) that allows volume creation and export via iSCSI.
Concepts
A provider is an Ansible module that manages storage hardware. Each provider should work with at least one hardware type, but many can support multiple types, like the default provider.
To connect with these providers, the Storage Role uses the term backends. A backend is created by providing specific settings to a provider for managing a certain type of hardware.
There are two main types of nodes in the Storage Role: controllers and consumers.
Controllers connect to the storage management network and can manage storage hardware, such as creating and exporting volumes.
Consumers only need access to the storage data network to connect to the previously set up resources, like connecting a volume via iSCSI.
For more details on usage and configuration, visit the documentation: https://ansible-storage.readthedocs.io/en/docs/