]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Failover to alternative iSCSI portals on login failure
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>
Tue, 9 Dec 2014 22:09:43 +0000 (17:09 -0500)
committerTomoki Sekiyama <tomoki.sekiyama@hds.com>
Mon, 2 Mar 2015 21:14:10 +0000 (16:14 -0500)
commit6d3733beb5b4a6ca1f75a9e70d92514db983689e
tree07ff5b0f0e8b0fe0c0699724ad96838a14cd2706
parent2abbe19ee3874a2e2e0e8fbc7c21d5ee05eb9d5b
Failover to alternative iSCSI portals on login failure

When the main iSCSI portal is unreachable by network failure etc.,
volume attach will fail even if the array has the other portal
addresses alive. To enable nova-compute and brick (with corresponding
patches) to fall-back to alternative portals, this patch makes Cinder
to contains the multiple portal addresses and corresponding IQNs and
LUNs in connection_info returned by initialize_connection API.
The main portal information is also returned in target_portal,
target_iqn, target_lun for backward compatibility. For example:

 {"connection_info": {
    "driver_volume_type": "iscsi", ...
    "data": {"target_portal": "10.0.1.2:3260",
             "target_portals": ["10.0.1.2:3260",
                                "10.0.2.2:3260"],
             "target_iqn": "iqn.2014-2.org.example:vol1-1",
             "target_iqns":["iqn.2014-2.org.example:vol1-1",
                            "iqn.2014-2.org.example:vol1-2"],
             "target_lun": 1,
             "target_luns": [1, 2],
             ...}}}

This patch makes LVM iSCSI backend return multiple portals,
iqns, and luns when iscsi_secondary_ip_addresses is specified in
cinder.conf.

It also make brick/initiator/connector.py to failover to alternative
paths, if specified, when it fails to establish the main path.

In addition, to unify the data structure, target_portal, target_iqn,
target_lun will also be included even if 'multipath=True' is specified
in connector information.

Change-Id: I55600496487dfaa72301621d1269e50044d9b5dc
Partially Implements: blueprint iscsi-alternative-portal
cinder/brick/initiator/connector.py
cinder/tests/brick/test_brick_connector.py
cinder/tests/targets/test_base_iscsi_driver.py
cinder/tests/test_volume.py
cinder/volume/driver.py
cinder/volume/targets/iscsi.py