Problem:
OS-Brick doesn't recognise transport type from command "iscsiadm -m session" other than TCP,
for example if [cinder.conf]iscsi_ptotocol=iser, OS-Brick will not be able to see the created
iscsi sessions and will always try to log into iscsi, at that point iscsi already has session
open so each login attempt will be rejected and volume will be in Attaching status.
$iscsiadm -m session
iser: [9] 1.1.1.1:3260,1 iqn.2010-10.org.openstack:volume-38b2e6bb-30e1-46c1-b02f-102b129e3be3 (non-flash)
Reproduce:
1. create VM that uses image as volume source.
2. change iscsi_ptotocol to iser in /cinder.conf
3. create volume
5. attach it to the VM
Cinder log:
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo.privsep.daemon [-] privsep: request[140297724561200]: (3, 'os_brick.privileged.rootwrap.execute_root', ('iscsiadm', '-m', 'session'), {'check_exit_code': (0, 1, 21, 255)}) {{(pid=18057) loop /usr/local/lib/python2.7/dist-packages/oslo_privsep/daemon.py:443}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo_concurrency.processutils [-] Running cmd (subprocess): iscsiadm -m session {{(pid=18057) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo_concurrency.processutils [-] CMD "iscsiadm -m session" returned: 0 in 0.006s {{(pid=18057) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG os_brick.initiator.connectors.iscsi [None req-35a4bf00-7056-457a-8371-e6dc9024165e admin admin] iscsiadm ('-m', 'session'): stdout=iser: [9] 1.1.1.1:3260,1 iqn.2010-10.org.openstack:volume-38b2e6bb-30e1-46c1-b02f-102b129e3be3 (non-flash)
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: stderr= {{(pid=16882) _run_iscsiadm_bare /usr/local/lib/python2.7/dist-packages/os_brick/initiator/connectors/iscsi.py:1077}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo.privsep.daemon [-] privsep: request[140297724561200]: (3, 'os_brick.privileged.rootwrap.execute_root', ('iscsiadm', '-m', 'node', '-T', u'iqn.2010-10.org.openstack:volume-38b2e6bb-30e1-46c1-b02f-102b129e3be3', '-p', u'1.1.1.1:3260', '--login'), {'attempts': 1, 'check_exit_code': (0, 15, 255), 'delay_on_retry': True}) {{(pid=18057) loop /usr/local/lib/python2.7/dist-packages/oslo_privsep/daemon.py:443}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo_concurrency.processutils [-] Running cmd (subprocess): iscsiadm -m node -T iqn.2010-10.org.openstack:volume-38b2e6bb-30e1-46c1-b02f-102b129e3be3 -p 1.1.1.1:3260 --login {{(pid=18057) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo_concurrency.processutils [-] CMD "iscsiadm -m node -T iqn.2010-10.org.openstack:volume-38b2e6bb-30e1-46c1-b02f-102b129e3be3 -p 1.1.1.1:3260 --login" returned: 15 in 0.005s {{(pid=18057) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG oslo.privsep.daemon [-] privsep: reply[140297724561200]: (4, ('', 'iscsiadm: iser: 1 session requested, but 1 already present.\niscsiadm: Could not log into all portals\n')) {{(pid=18057) loop /usr/local/lib/python2.7/dist-packages/oslo_privsep/daemon.py:456}}
Aug 14 04:06:47 hamdyk-X9DRFR nova-compute[16882]: DEBUG os_brick.initiator.connectors.iscsi [None req-35a4bf00-7056-457a-8371-e6dc9024165e admin admin] iscsiadm ('--login',): stdout= stderr=iscsiadm: iser: 1 session requested, but 1 already present.
Fix proposed to branch: stable/pike /review. openstack. org/496737
Review: https:/