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
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