Skip to content

Commit

Permalink
Reworked README to be more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaniv Lavi committed Jun 26, 2018
1 parent 1e82f92 commit c26e5f8
Showing 1 changed file with 45 additions and 97 deletions.
142 changes: 45 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ The Ansible Storage Role is a vendor agnostic abstraction providing
infrastructure administrators with automation for storage solutions and to
access provisioned resources.

The Storage Role includes support for over 80 block storage drivers out of the box, but
it can be also be expanded to support additional storage providers.

Thanks to this abstraction it's now possible to write reusable playbooks that
can automate tasks on any of the supported storage arrays.

This allows to manage and consume storage volumes directly on any infrastructure by the
developer or application owner from any Linux instance.

The role will provide an abstraction for multiple storage types:

- Block storage.
Expand All @@ -30,6 +36,10 @@ Use cases:
- VMs managed on oVirt, OpenStack and VMWare.
- Cloud providers.
- Take periodical snapshots of provisioned volumes.
- Use a golden volume for provisioning (volume cloning).
- Resize provisioned volumes.
- Define QoS for provisioned volumes.
- Perform volume migration between backends.


Features
Expand All @@ -45,55 +55,19 @@ following operations.
- Detach volumes


Concepts
--------

The Storage Role includes support for over 80 block storage drivers out of the
box, but this can be expanded creating a new storage provider.

A provider is the Ansible module responsible for carrying out operations on the
storage hardware. Each provider must support at least one specific hardware
from a vendor, but it may as well support more, like the default provider does.

To expose the functionality of these providers, the Storage Role introduces the
concept of *backends*. A *backend* is constructed passing a specific
configuration to a provider in order to manage a specific storage hardware.

There are two types of nodes in the Storage Role, *controllers* and
*consumers*.

<p align="center">
<img src ="./docs/_static/ansible_diagram.svg" />
</p>

*Controllers* have access to the storage management network and know how to
connect to the storage hardware management interface and control it. For
example to create and export a volume.

*Consumers* only need access to the storage data network in order to connect
to the resources we have provisioned. For example to connect a volume via
iSCSI.

Getting started
---------------

Let's get you started on running your first Storage playbook.

Unlike most real use cases, our example doesn't use a real Storage System. The
playbook first creates an LVM Volume Group (VG) backed by a device loop. Using
this VG we can create volumes and export them via iSCSI using the LIO target.

The playbook will not differentiate between *controller* and *consumer* nodes,
deploying everything in a single node.
Running the example playbook will install packages in the system and present a
VG to the system. We recommend to either run these commands inside a VM or
change the value of the IP variable to the IP of a VM.

After setting up the LVM VG the playbook will create a volume, attach it to the
node via iSCSI, display a message with the device where it has been attached,
detach it, and finally delete the volume.

Running the example playbook will install packages in the system and present a
VG to the system. We recommend to either run these commands inside a VM or
change the value of the IP variable to the IP of a VM.

To run the playbook we'll first need to install the role.

``` bash
Expand All @@ -113,62 +87,36 @@ $ cd ~/.ansible/roles/Akrog.storage/example
$ ansible-playbook -i $IP, lvm-backend.yml
```

Configuration
-------------

Before we can provision or use our storage, we need to setup the *controller*
node.

There are several configuration options that allow us to change default global
configuration for a provider's *controller* and *consumer* modules. For now
we'll assume they have sensible defaults, so we'll only look at the
`storage_backends` configuration variable passed to the Storage Role.

The `storage_backends` is a dictionary providing the configuration for all the
*backends* we want a *controller* node to manage. They keys of the dictionary
will be the identifiers for the *backends*, and they must be unique.

Example of how we can setup a node to manage an XtremIO array:

``` yml
- hosts: storage_controller
vars:
storage_backends:
xtremio:
volume_driver: cinder.volume.drivers.dell_emc.xtremio.XtremIOISCSIDriver
san_ip: w.x.y.z
xtremio_cluster_name: CLUSTER-NAME
san_login: admin
san_password: nomoresecrets
roles:
- {role: storage, node_type: controller}
```
Unlike most real use cases, our example doesn't use a real Storage System. The
playbook first creates an LVM Volume Group (VG) backed by a device loop. Using
this VG we can create volumes and export them via iSCSI using the LIO target.

Example
-------
Now that we have configured the *controller* node, we can start using the
*backend*, for example to provision and attach a new volume for each of our
consumer nodes:
``` yml
- hosts: storage_consumers
roles:
- {role: storage, node_type: consumer}
tasks:
- name: Create volume
storage:
resource: volume
state: present
size: 1
register: vol

- name: Connect volume
storage:
resource: volume
state: connected
register: conn

- debug:
msg: "Volume {{ vol.id }} attached to {{ conn.path }}"
```

Concepts
--------

A provider is the Ansible module responsible for carrying out operations on the
storage hardware. Each provider must support at least one specific hardware
from a vendor, but it may as well support more, like the default provider does.

To expose the functionality of these providers, the Storage Role introduces the
concept of *backends*. A *backend* is constructed passing a specific
configuration to a provider in order to manage a specific storage hardware.

There are two types of nodes in the Storage Role, *controllers* and
*consumers*.

<p align="center">
<img src ="./docs/_static/ansible_diagram.svg" />
</p>

*Controllers* have access to the storage management network and know how to
connect to the storage hardware management interface and control it. For
example to create and export a volume.

*Consumers* only need access to the storage data network in order to connect
to the resources we have provisioned. For example to connect a volume via
iSCSI.

See more info on usage and configuration in the documentation:
https://ansible-storage.readthedocs.io/en/docs/

0 comments on commit c26e5f8

Please sign in to comment.