In Icehouse with "iscsi_use_multipath=true", attaching a multipath
iSCSI volume may create unnecessary iSCSI sessions.
The iscsiadm discovery command in connect_volume() returns all of the
targets in the Cinder node, not just the ones related to the multipath
volume which is specified by iqn. If the storage has many targets,
connecting to all these volumes will also result in many unnecessary
connections.
There are two types of iSCSI multipath devices. One which shares
the same iqn between multiple portals, and the other which use
different iqns on different portals. connect_volume() needs to
identify the type by checking iscsiadm the output if the iqn is
used by multiple portals.
This patch changes the behavior of attaching volume:
1. Identify the type by checking the iscsiadm output.
2. Connect to the correct targets by connect_to_iscsi_portal().
Closes-Bug: #1382440
(cherry picked from commit fb0de106f2f15604750bafc318ba06c41070cc35)
Reviewed: https:/ /review. openstack. org/144064 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=4c1f28a0f46 7d749ebf406f970 b3cea4888ff1b0
Committed: https:/
Submitter: Jenkins
Branch: stable/juno
commit 4c1f28a0f467d74 9ebf406f970b3ce a4888ff1b0
Author: Hiroyuki Eguchi <email address hidden>
Date: Thu Nov 20 10:41:36 2014 +0900
Fix connecting unnecessary iSCSI sessions issue
In Icehouse with "iscsi_ use_multipath= true", attaching a multipath
iSCSI volume may create unnecessary iSCSI sessions.
The iscsiadm discovery command in connect_volume() returns all of the
targets in the Cinder node, not just the ones related to the multipath
volume which is specified by iqn. If the storage has many targets,
connecting to all these volumes will also result in many unnecessary
connections.
There are two types of iSCSI multipath devices. One which shares
the same iqn between multiple portals, and the other which use
different iqns on different portals. connect_volume() needs to
identify the type by checking iscsiadm the output if the iqn is
used by multiple portals.
This patch changes the behavior of attaching volume:
1. Identify the type by checking the iscsiadm output. to_iscsi_ portal( ).
2. Connect to the correct targets by connect_
Closes-Bug: #1382440
(cherry picked from commit fb0de106f2f1560 4750bafc318ba06 c41070cc35)
Conflicts:
nova/ tests/unit/ virt/libvirt/ test_volume. py
Change-Id: I488ad0c09bf26a 609e27d67b9ef60 b65bb45e0ad