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.
Note that each third-party storage might have its own recommended settings for the multipathing configuration. The instruction below describes how to configure multipathing for Pure Storage and Huawei storage devices.
To attach an external Pure Storage device
-
Enable multipathing on each compute node:
-
Edit the configuration file /etc/multipath.conf as follows:
defaults { find_multipaths yes polling_interval 10 } devices { device { vendor "PURE" product "FlashArray" path_selector "service-time 0" hardware_handler "1 alua" path_grouping_policy group_by_prio prio alua failback immediate path_checker tur fast_io_fail_tmo 10 user_friendly_names no no_path_retry 0 features 0 dev_loss_tmo 600 } } blacklist { device { vendor "QEMU" product ".*" } }
For more details about the Pure Storage configuration, refer to the Pure Storage recommended settings.
To configure multipathing for other iSCSI storages, refer to your storage documentation.
-
Load the kernel module:
# modprobe dm-multipath
-
Launch and enable the multipathing service:
# systemctl start multipathd; systemctl enable multipathd
-
-
Attach the device to the compute cluster by using the following command:
vinfra service compute storage add <storage_name> --params volume_backend_name=<backend_name>, 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_backend_name=<backend_name>
must be the same as<storage_name>
.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 toTrue
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 toTrue
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_backend_name=pure_storage,\ 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 iscinder.volume.drivers.pure.PureISCSIDriver
.use_multipath_for_image_xfer
toTrue
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. -
Check that the external storage is successfully attached by running:
# 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 | | | | +--------------+-----------------------------------------------------------+-----------------------+---------+------------+
To attach an external Huawei storage device
-
On each compute node, create the /etc/kolla/cinder-volume/cinder_huawei_conf.xml configuration file with the following contents:
# cat /etc/kolla/cinder-volume/cinder_huawei_conf.xml <?xml version="1.0" encoding="UTF-8"?> <config> <Storage> <Product>Dorado</Product> <Protocol>iSCSI</Protocol> <RestURL>https://HUAWEI API IP:8088/deviceManager/rest/</RestURL> <UserName>HUAWEI STORAGE API USERNAME</UserName> <UserPassword>HUAWEI STORAGE API PASSWORD</UserPassword> </Storage> <LUN> <LUNType>Thin</LUNType> <WriteType>1</WriteType> <StoragePool>STORAGE POOL NAME ON HUAWEI STORAGE</StoragePool> </LUN> <iSCSI> <DefaultTargetIP>HUAWEI CLUSTER ISCSI API</DefaultTargetIP> <Initiator Name="INITIATOR NAME FROM /etc/iscsi/initiatorname.iscsi" TargetIP="HUAWEI STORAGE ISCSI IP"/> </iSCSI> <Host OSType="Linux" HostIP="HOST IP ADDRESS IN ISCSI NETWORK"/> </config>
Replace the placeholders with your storage IP addresses and object names.
With multiple storage nodes, it is possible to configure multipathing. To do this, the
<Initiator Name>
line should contain theTargetPortGroup
name from the storage configuration:<Initiator Name="INITIATOR NAME FROM /etc/iscsi/initiatorname.iscsi" TargetPortGroup="STORAGE PORT GROUP NAME ON HUAWEI STORAGE"/>
Note that each node has its own
Initiator Name
, so their configuration files will be slightly different.For more details, refer to the Huawei volume driver documentation.
-
Attach the device to the compute cluster by using the following command:
vinfra service compute storage add <storage_name> --params volume_backend_name=<backend_name>, volume_driver=<openstack_volume_driver_name>,[image_volume_cache_enabled=True], force_active_active=True,cinder_huawei_conf_file=<path_to_conf_file> --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_backend_name=<backend_name>
must be the same as<storage_name>
.volume_driver=<openstack_volume_driver_name>
is the name of the OpenStack volume driver. For example,cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver
.image_volume_cache_enabled=True
should be added only ifTargetPortGroup
is specified in the Huawei configuration file, that is, if multipathing is enabled.force_active_active
should be set toTrue
to use the Active/Active configuration.cinder_huawei_conf_file
specifies the configuration file for the Cinder Huawei driver. For example,/etc/kolla/cinder-volume/cinder_huawei_conf.xml
.
For example, to add the external storage
huawei_storage
with the/etc/kolla/cinder-volume/cinder_huawei_conf.xml
configuration file, run:# vinfra service compute storage add huawei_storage --params volume_backend_name=huawei_storage,\ volume_driver=cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver, image_volume_cache_enabled=True,force_active_active=True, cinder_huawei_conf_file=/etc/kolla/cinder-volume/cinder_huawei_conf.xml --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. -
Check that the external storage is successfully attached by running:
# vinfra service compute storage list +----------------+-----------------------------------------------------------------------------+---------------+---------+------------+ | name | params | secret_params | enabled | configured | +----------------+-----------------------------------------------------------------------------+---------------+---------+------------+ | huawei_storage | cinder_huawei_conf_file: /var/lib/kolla/config_files/cinder_huawei_conf.xml | | True | True | | | force_active_active: 'True' | | | | | | image_volume_cache_enabled: 'True' | | | | | | volume_backend_name: huawei_storage | | | | | | volume_driver: cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver | | | | +----------------+-----------------------------------------------------------------------------+---------------+---------+------------+