Bug 1170447

Summary: [RFE][nova]: hw-iscsi-device-name-support
Product: Red Hat OpenStack Reporter: RHOS Integration <rhos-integ>
Component: openstack-novaAssignee: RHOS Maint <rhos-maint>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, dasmith, kchamart, markmc, ndipanov, pbrady, sbauza, sferdjao, sgordon, vromanso, yeylon
Target Milestone: Upstream M2Keywords: FutureFeature, OtherQA, Triaged
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/nova/+spec/hw-iscsi-device-name-support
Whiteboard: upstream_milestone_kilo-2 upstream_definition_approved upstream_status_implemented
Fixed In Version: openstack-nova-2015.1.0-10.el7ost Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-05 13:19:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description RHOS Integration 2014-12-04 05:03:15 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/nova/+spec/hw-iscsi-device-name-support.

Description:

LibvirtISCSIVolumeDriver of nova.virt.libvirt.volume.py is hardcoding to use /dev/disk/by-path/ip-%s-iscsi-%s-lun-%s (in self._get_host_device, and disconnect_volume). But when we use h/w iscsi initiators, the filename starts with pci-<hwaddr>-ip-<targetportal>-iscsi-<target>-lun-<lun id>. We would like to modify the code so that pci-<hwaddr> files are also searched to determine if the device exists.

The following algorithm can be used: 

- Perform "ls" of /dev/disk/by-path directory
- Look for a file that contains the ip-<targetportal>-iscsi-<target>-lun-<lun id> in it. Get the complete filename and use this 
to determine if the device exists.

For e.g:
"ls" gives the following output

ip-192.168.2.126:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1
ip-192.168.2.126:3260-iscsi-iqn.2010-10.org.openstack:volume-5fdf6167-ec09-4b0b-acff-b179b415ee4d-lun-1
pci-0000:00:1a.0-usb-0:1.2:1.0-scsi-0:0:0:0
pci-0000:00:1a.0-usb-0:1.2:1.1-scsi-0:0:0:0
pci-0000:00:1a.0-usb-0:1.2:1.1-scsi-0:0:0:1
pci-0000:01:00.2-ip-192.168.10.26:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1
pci-0000:01:00.2-ip-192.168.10.26:3260-iscsi-iqn.2010-10.org.openstack:volume-5fdf6167-ec09-4b0b-acff-b179b415ee4d-lun-1
pci-0000:01:00.3-ip-192.168.11.26:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1
pci-0000:01:00.3-ip-192.168.11.26:3260-iscsi-iqn.2010-10.org.openstack:volume-5fdf6167-ec09-4b0b-acff-b179b415ee4d-lun-1

We will be able to search for 192.168.10.26:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1 in the list of filenames, and we will find pci-0000:01:00.2-ip-192.168.10.26:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1 that contains the search string.

We will then use this filename pci-0000:01:00.2-ip-192.168.10.26:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1 to determine whether the device exists (via os.path.exists). In the current code, because of hardcoding "ip-" as the beginning, the code is searching for ip-192.168.10.26:3260-iscsi-iqn.2010-10.org.openstack:volume-0289c43f-7b32-490c-97a2-6385feb1480f-lun-1 which will not be there.

The same logic will also be used in disconnect_volume to determine the device_prefix.

Specification URL (additional information):

None

Comment 7 errata-xmlrpc 2015-08-05 13:19:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2015:1548