Attaching external iSCSI storage

The OpenStack Cinder iSCSI driver allows you to mount multiple iSCSI targets to your compute cluster and use them as external iSCSI storages. As the driver is based on the iSCSI storage protocol, compute nodes must be configured to support multipathing.

To enable multipathing

On each compute node, configure and start the multipathing service:

  1. Edit the configuration file /etc/multipath.conf as follows:

    defaults {
        user_friendly_names yes
        find_multipaths yes
        polling_interval 10
    }
    devices {
      device {
        vendor "PURE"
        product "FlashArray"
        fast_io_fail_tmo 10
        path_grouping_policy "group_by_prio"
        failback "immediate"
        prio "alua"
        hardware_handler "1 alua"
        max_sectors_kb 4096
      }
    }
    
    blacklist {
      device {
        vendor "QEMU"
        product ".*"
      }
    }

    In this example, vendor and product specify the vendor and product names of a Pure Storage device. To configure multipathing for other iSCSI storages, you need to specify these attributes according to your storage documentation.

    For more details about the multipathing configuration, refer to Linux Recommended Settings.

  2. Load the kernel module:

    # modprobe dm-multipath
  3. Launch and enable the multipathing service:

    # systemctl start multipathd; systemctl enable multipathd

To attach an external iSCSI storage

Use the following command:

vinfra service compute storage add <storage_name> --params volume_driver=<openstack_volume_driver_name>,
                               san_ip=<ip_address>,image_volume_cache_enabled=True,use_multipath_for_image_xfer=True
                               --secret-params pure_api_token=<token> [--param <param=value>]
                               [--secret-param <key=value>] --enable

Where:

  • <storage_name> is a custom name of your external storage. The name may only contain letters, numbers, and underscores, and must be 3 to 64 characters long.
  • volume_driver=<openstack_volume_driver_name> is the name of the OpenStack volume driver. For example, cinder.volume.drivers.pure.PureISCSIDriver.
  • san_ip=<ip_address> is the IP address of the external storage to connect to.
  • image_volume_cache_enabled should be set to True to enable image-volume caching for the external storage, to improve the performance of creating a volume from an image.
  • use_multipath_for_image_xfer should be set to True for multipath setups. Do not specify this parameter if multipathing is disabled.
  • --secret-params is intended to be used for sensitive data, like passwords or tokens. For example, pure_api_token=<token> is the API token for a Pure Storage solution.
  • --param and --secret-param are intended for single parameters with values containing the comma symbol. For example, replication_device=backend_id:<storage_name>,san_ip:<ip_address>,api_token:<token>,type:<replication_type>.

For example, to add the external storage pure_storage with the IP address 10.10.10.11, run:

# vinfra service compute storage add pure_storage --params volume_driver=cinder.volume.drivers.pure.PureISCSIDriver,\
san_ip=10.10.10.11,use_multipath_for_image_xfer=True,image_volume_cache_enabled=True \
--secret-params pure_api_token=7acb5db8-d312-4f66-b076-f556d6fa1232 --enable

There is also a storage-specific shortcut. You can specify the --pure option, to automatically set the following parameters required for Pure Storage:

  • volume_backend_name to the external storage name specified by <storage_name>.
  • volume_driver to the name of the Pure Storage iSCSI volume driver, which is cinder.volume.drivers.pure.PureISCSIDriver.
  • use_multipath_for_image_xfer to True to allow multipathing.

For example, to add the external storage pure_storage with the IP address 10.10.10.11, run:

# vinfra service compute storage add pure_storage --pure --params san_ip=10.10.10.11,image_volume_cache_enabled=True \
--secret-params pure_api_token=7acb5db8-d312-4f66-b076-f556d6fa1232 --enable

Ensure that the data specified is valid. An incorrectly configured storage will lead to the critical state of the cinder-volume service and the node itself. However, all other operations on the node will not be affected.

The added external storage will appear in the vinfra service compute storage list output:

# vinfra service compute storage list
+--------------+-----------------------------------------------------------+-----------------------+---------+------------+
| name         | params                                                    | secret_params         | enabled | configured |
+--------------+-----------------------------------------------------------+-----------------------+---------+------------+
| pure_storage | san_ip: 10.10.10.11                                       | pure_ip_token: ****** | True    | True       |
|              | use_multipath_for_image_xfer: True                        |                       |         |            |
|              | image_volume_cache_enabled: True                          |                       |         |            |
|              | volume_backend_name: pure_storage                         |                       |         |            |
|              | volume_driver: cinder.volume.drivers.pure.PureISCSIDriver |                       |         |            |
+--------------+-----------------------------------------------------------+-----------------------+---------+------------+