Bug 1274055 - When using a FCoE adapter instead of a FC adapter, volumes will fail to attach to the VM
When using a FCoE adapter instead of a FC adapter, volumes will fail to attac...
Status: CLOSED DUPLICATE of bug 1274054
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova (Show other bugs)
6.0 (Juno)
Unspecified Unspecified
unspecified Severity high
: ---
: 8.0 (Liberty)
Assigned To: Eoghan Glynn
nlevinki
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-21 15:10 EDT by David Hill
Modified: 2015-10-30 12:48 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-30 12:48:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Hill 2015-10-21 15:10:47 EDT
Description of problem:
When using a FCoE adapter instead of a FC adapter, volumes will fail to attach to the VM .  The issue has been pinpointed to the way the libvirt drivers are handling the path of the created device in order to extract the PCI location of the device .   In order to support FCoE, the following patch needs to be applied:

[root@picompute02 libvirt]# diff -u volume.py.old volume.py
--- volume.py.old	2015-10-21 14:47:28.744189152 -0400
+++ volume.py	2015-10-21 14:07:18.317114439 -0400
@@ -997,6 +997,7 @@
         # NOTE(walter-boring)
         # device path is in format of
         # /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.3/host2/fc_host/host2
+        # /sys/devices/pci0000:20/0000:20:03.0/0000:21:00.2/net/ens2f2/ctlr_2/host3/fc_host/host3
         # sometimes an extra entry exists before the host2 value
         # we always want the value prior to the host2 value
         pci_num = None
@@ -1010,7 +1011,7 @@
                     index = index + 1
 
                 if index > 0:
-                    pci_num = device_path[index - 1]
+                    pci_num = device_path[index - 4]
 
         return pci_num


This is still an ugly patch because it breaks support for regular FC adapters.  For what it worths, I think this patch might be better:

--- a/nova/virt/libvirt/volume.py
+++ b/nova/virt/libvirt/volume.py
@@ -990,12 +990,12 @@ class LibvirtFibreChannelVolumeDriver(LibvirtBaseVolumeDriver):
                 index = 0
                 device_path = hba['device_path'].split('/')
                 for value in device_path:
-                    if value.startswith('host'):
+                    if value.startswith('pci'):
                         break
                     index = index + 1
 
                 if index > 0:
-                    pci_num = device_path[index - 1]
+                    pci_num = device_path[index + 3]
 
         return pci_num


Version-Release number of selected component (if applicable):
Latest

How reproducible:
Always

Steps to Reproduce:
1. Configure 3PAR storage
2. Add computes with FCoE adapters
3. Try to attach a volume

Actual results:
Will fail to attach

Expected results:
Should attach


Additional info:

This is due to the device path being different when added through FCoE instead of regular FC devices

FC:
 /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.3/host2/fc_host/host2
FCoE:
 /sys/devices/pci0000:20/0000:20:03.0/0000:21:00.2/net/ens2f2/ctlr_2/host3/fc_host/host3
Comment 2 Lee Yarwood 2015-10-30 12:48:24 EDT

*** This bug has been marked as a duplicate of bug 1274054 ***

Note You need to log in before you can comment on or make changes to this bug.