# Configuring Multiple Storage Backends in Cinder

This article explains how to configure a block storage node with multiple storage backends.

## Prerequisites

Authorize a host with the Block Storage role before continuing this tutorial. You may select any driver on the authorization step. The driver selected on the authorization step won’t be used. The steps outlined below show you how to set the driver for each storage backend.

If you already have a host authorized as a block storage node, you may continue with the configuring the block storage node as given below.

## Multiple storage backend configuration

To enable support for multiple storage backends on a single block storage node, update the configuration file as shown below.

For this article, we assume the following. NFS server 1: 10.4.0.25 (hdd) NFS server 2: 10.4.0.26 (ssd) SolidFire appliance: 10.4.0.27 Block Storage node: 10.4.0.28

We want the block storage node (10.4.0.28) to use NFS servers 1 and 2 as well as the SolidFire appliance as storage pools.

### Step 1

SSH into the block storage node and create a file named cinder\_override.conf in `/opt/pf9/etc/pf9-cindervolume-base/conf.d`:

{% tabs %}
{% tab title="Bash" %}

```bash
cd /opt/pf9/etc/pf9-cindervolume-base/conf.d
touch cinder_override.conf
```

{% endtab %}
{% endtabs %}

### Step 2

Add the following snippet of configuration to `cinder_override.conf`:

{% tabs %}
{% tab title="cinder\_override.conf" %}

```yaml
[DEFAULT]
enabled_backends=nfs-hdd,nfs-ssd,solidfire-backend

[nfs-hdd]
volume_driver = cinder.volume.drivers.nfs.NfsDriver
volume_backend_name = nfs-hdd-type
nfs_shares_config = /tmp/nfs-hdd.conf

[nfs-ssd]
volume_driver = cinder.volume.drivers.nfs.NfsDriver
volume_backend_name = nfs-ssd-type
nfs_shares_config = /tmp/nfs-ssd.conf

[solidfire-backend]
volume_backend_name = solidfire-backend
volume_driver = cinder.volume.drivers.solidfire.SolidFireDriver
san_ip = 10.4.0.27
san_login = <solidfire_username>
san_password = <solidfire_password>
sf_account_prefix = ''
```

{% endtab %}
{% endtabs %}

It is important to append the name of the config group (e.g. nfs-ssd) to the list of enabled\_backends. Otherwise, Cinder ignores that particular config group.

Each config group must have at least the following parameters.

* `volume_driver`
* `volume_backend_name`

The choice of `volume_driver` dictates additional parameters to be set. For NFS,**`nfs_shares_config`** is **required**. This parameter sets the path to the NFS exports to be used for this storage backend.

Drivers available to Cinder are available [here](https://github.com/openstack/cinder/tree/master/cinder/volume/drivers). Use the dot notation format to access the desired driver. See the examples above.

Restart the `pf9-cindervolume` service on the block storage node:

{% tabs %}
{% tab title="Bash" %}

```bash
$ sudo service pf9-cindervolume-base restart
```

{% endtab %}
{% endtabs %}

Here’s an example `nfs-hdd.conf`:

{% tabs %}
{% tab title="nfs-hdd.conf" %}

```none
10.4.0.25:/var/nfs/backup
```

{% endtab %}
{% endtabs %}

An example `nfs-ssd.conf`:

{% tabs %}
{% tab title="nfs-ssd.conf" %}

```none
10.4.0.26:/exports/share
```

{% endtab %}
{% endtabs %}

### Volume Type

To use select a particular storage backend when creating volumes, a volume type must be created referencing the `volume_backend_name` For more information on volume types, please read [this article](https://docs.platform9.com/managed-openstack/5.4/volumes-and-snapshots/storage-cinder-metadata). For our purposes here, let us create volume types for each of our storage backends.

<figure><img src="https://1126553421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8EciOmTwpkZCkUOCYd9%2Fuploads%2Fgit-blob-6e3c4f9cf3d29571b4cfb32c53f4be833808053b%2F1605202929.png?alt=media" alt=""><figcaption></figcaption></figure>

* Create a new volume type by clicking on the Create New Volume Type as seen above.

<figure><img src="https://1126553421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ8EciOmTwpkZCkUOCYd9%2Fuploads%2Fgit-blob-ec2422e8d5624a965bc04204b62f941f37d82c7a%2F1605202940.png?alt=media" alt=""><figcaption></figcaption></figure>

* Fill in the desired name for the volume type.
* Select the desired volume backend name
* Create a key `volume_backend_name` with value `nfs-hdd-type`. The value for the `volume_backend_name` should be the same as the ones in your `cinder_override.conf`.
* Click Create Volume Type to create the volume type.

{% hint style="info" %}
**Info**

**Note:** If the volume type is defined in the database, but no volume types exist for that backend in the configuration, then no valid host is found.
{% endhint %}

You can creating the remaining volume types in a similar way. You are now be able to create volumes on specific storage backends using their corresponding volume types.
