libvirt: hw-iscsi-device-name-support

Registered by sreedhar

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.

Blueprint information

Status:
Complete
Approver:
Michael Still
Priority:
Low
Drafter:
sreedhar
Direction:
Approved
Assignee:
Anish Bhatt
Definition:
Approved
Series goal:
Accepted for kilo
Implementation:
Implemented
Milestone target:
milestone icon 2015.1.0
Started by
Thierry Carrez
Completed by
Anish Bhatt

Related branches

Sprints

Whiteboard

Does this fix bug 1370226? -- mriedem

Trivial approval at Nova meeting 4 December 2014 -- mikal

Bumping to k-2 -- mikal 9 Dec 2014

Gerrit topic: https://review.openstack.org/#q,topic:bp/hw-iscsi-device-name-support,n,z

Addressed by: https://review.openstack.org/141340
    Add support to search device names starting with pci device id's also apart from device names starting with "ip-" in the "/dev/disk/by-path" directory.

Addressed by: https://review.openstack.org/146233
    libvirt : Add support for --interface option in iscsiadm.

Gerrit topic: https://review.openstack.org/#q,topic:bp/add-open-iscsi-transport-support,n,z

Gerrit topic: https://review.openstack.org/#q,topic:bug/1370226,n,z

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.