Bug 496925 - [Various 5.4 feat] Support NPIV in libvirt
Summary: [Various 5.4 feat] Support NPIV in libvirt
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 5.4
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 459808 460170 461676 543037 713170
TreeView+ depends on / blocked
 
Reported: 2009-04-21 16:36 UTC by Daniel Berrangé
Modified: 2016-04-26 15:40 UTC (History)
24 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of: 431454
: 543037 (view as bug list)
Environment:
Last Closed: 2009-09-02 09:20:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Brief instructions on how to test NPIV (3.35 KB, text/plain)
2009-06-10 15:24 UTC, Dave Allan
no flags Details
Revised NPIV test instructions (3.72 KB, text/plain)
2009-06-19 19:38 UTC, Dave Allan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2009:1269 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2009-09-01 09:31:21 UTC

Comment 1 Daniel Berrangé 2009-04-21 16:37:49 UTC
This bug is to track libvirt support for NPIV which is imminently to be completed upstream...

Comment 2 Daniel Berrangé 2009-06-02 13:28:54 UTC
Final patch ready for use

http://www.redhat.com/archives/libvir-list/2009-June/msg00005.html

Comment 3 Daniel Veillard 2009-06-02 15:23:38 UTC
Patch commited upstream,

Daniel

Comment 5 Andrius Benokraitis 2009-06-03 03:32:32 UTC
QLogic/Emulex/EMC - Can we count on you to test this new functionality?

Comment 6 Daniel Veillard 2009-06-03 16:03:11 UTC
libvirt-0.6.3-4.el5 has been built in dist-5E-qu-candidate with the
patch,

Daniel

Comment 8 Dave Allan 2009-06-10 15:24:55 UTC
Created attachment 347247 [details]
Brief instructions on how to test NPIV

I've attached a short document that describes how to test the NPIV create/destroy operations using virsh.

Comment 9 Andrius Benokraitis 2009-06-10 20:44:50 UTC
*** URGENT ***

This is a call to all partners on this bugzilla - Dave has submitted instructions on how to test the forthcoming functionality of NPIV in Comment #8 above.

When the partner Alpha is released on Friday, please use these bits with the instructions above, and post feedback in this Bugzilla. If you have any questions, please don't hesitate to ask here.

Comment 14 Chris Ward 2009-06-14 23:21:17 UTC
~~ Attention Partners RHEL 5.4 Partner Alpha Released! ~~

RHEL 5.4 Partner Alpha has been released on partners.redhat.com. There should
be a fix present that addresses this particular request. Please test and report back your results here, at your earliest convenience. Our Public Beta release is just around the corner!

If you encounter any issues, please set the bug back to the ASSIGNED state and
describe the issues you encountered. If you have verified the request functions as expected, please set your Partner ID in the Partner field above to indicate successful test results. Do not flip the bug status to VERIFIED. Further questions can be directed to your Red Hat Partner Manager. Thanks!

Comment 15 Jamie Wellnitz 2009-06-16 15:02:21 UTC
(In reply to comment #8)
> Created an attachment (id=347247) [details]
> Brief instructions on how to test NPIV
> 
> I've attached a short document that describes how to test the NPIV
> create/destroy operations using virsh.  

We tried these instructions on a RHEL 5.4 alpha system here, but ran into a couple of difficulties.

virsh doesn't show the correct WWPN/WWNNs for the FC adapters, instead it shows all 'f's for all adapter WWNs:

# virsh nodedev-dumpxml pci_10df_fd00_scsi_host
<device>
  <name>pci_10df_fd00_scsi_host</name>
  <parent>pci_10df_fd00</parent>
  <capability type='scsi_host'>
    <host>7</host>
    <capability type='fc_host'>
      <wwnn>ffffffffffffffff</wwnn>
      <wwpn>ffffffffffffffff</wwpn>
    </capability>
  </capability>
</device>

Also, virsh does not show <capability type='vport_ops' />
for any of the NPIV-capable adapters in this test system.

# virsh nodedev-create new.xml

generates a Segmentation fault.  The new.xml file I'm using is:

<device>
  <parent>pci_10df_fd00_0_scsi_host</parent>
  <capability type='scsi_host'>
    <capability type='fc_host'>
      <wwpn>2000000033334444</wwpn>
      <wwnn>1000000077778888</wwnn>
    </capability>
  </capability>
</device>

I think these items are probably related to differences between RHEL 5.4 and the current upstream layout of virtual port information in sysfs (scsi_host vs. fc_host).

With respect to the instructions themselves, this example command:

echo '1111222233334444:5555666677778888' > /sys/class/fc_host/host5/vport_create

has 2 issues.  First the vport_create sysfs entry is under the scsi_host, not the fc_host, e.g. /sys/class/scsi_host/host5/vport_create (this is an upstream vs RHEL 5.4 kernel difference).  Second, the WWN format given in this example is invalid and gets rejected by the lpfc driver.

This should work though:

echo '2000000033334444:1000000077778888' > /sys/class/scsi_host/host5/vport_create

Comment 16 Dave Allan 2009-06-16 18:27:14 UTC
I believe you are correct that the problems are due to differing locations of information in sysfs.  I'm fixing that, and the segfault now.  I didn't specify a valid WWN in the example because I want people to use WWNs that are valid for their environments.  I'll update the doc to note that the example WWN is bogus.  Please hold off further testing until I have a patch ready.

Comment 19 Dave Allan 2009-06-18 17:22:41 UTC
Jamie,

The lack of vport capability on your system makes sense to me, as the vport_create and vport_delete moved from /sys/class/scsi_host/hostN to /sys/class/fc_host/hostN, and I'm just about finished with the fix for that.  I'm not sure, though, why the WWNs aren't being discovered correctly.  Do /sys/class/fc_host/host7/node_name and port_name exist on your system?  Those two files are in the same places on my RHEL 5.4 and Fedora 10 systems.

Dave

Comment 20 Jamie Wellnitz 2009-06-19 14:34:17 UTC
Dave,

virsh shows the correct WWNs if lpfc is loaded with lpfc_enable_npiv=0 (the default).  virsh shows all f's for all WWNNs/WWPNs when lpfc  is loaded with lpfc_enable_npiv=1.  The /sys/class/fc_host/hostN/node_name and /sys/.../port_name files exist and contain the correct numbers in both cases (with and without npiv enabled).

Jamie

Comment 21 Daniel Veillard 2009-06-19 16:54:07 UTC
libvirt-0.6.3-11.el5 has been built in dist-5E-qu-candidate with the fix
for the 2 different /sys paths.

Daniel

Comment 22 Jamie Wellnitz 2009-06-19 17:13:15 UTC
(In reply to comment #21)
> libvirt-0.6.3-11.el5 has been built in dist-5E-qu-candidate with the fix
> for the 2 different /sys paths.
> 
> Daniel  

Does this build fix the all f's WWN display?

Comment 23 Dave Allan 2009-06-19 17:23:56 UTC
Yes, however, I was not seeing that particular problem (or the segfault) on my test system, so I am very interested in your experience.

Comment 24 Daniel Veillard 2009-06-19 19:06:22 UTC
To speed up testing I have uploaded libvirt-0.6.3-11.el5 I have put the
built packages in http://veillard.com/libvirt/5.4/ repo,

Daniel

Comment 25 Dave Allan 2009-06-19 19:19:42 UTC
I just installed that package and was able to create and destroy an adapter.

Comment 26 Dave Allan 2009-06-19 19:38:33 UTC
Created attachment 348700 [details]
Revised NPIV test instructions

Here's a revised test instructions document with updates as suggested by Jamie.

Comment 27 Jamie Wellnitz 2009-06-19 20:37:10 UTC
With libvirt-0.6.3-11.el5, the vport_ops capability shows up correctly in the nodedev-dumpxml output and I can create and destroy vports with virsh.

The WWNs show up correctly when the system first boots, but if I rmmod and insmod lpfc (to change lpfc_enable_npiv, for instance), then "virsh nodedev-dumpxml" shows all f's for the WWNs.  service libvirtd restart fixes that until the next time I reload lpfc.  I imagine this is the same behavior as the old package - I just didn't figure out the causal relationship.

Comment 28 Dave Allan 2009-06-19 20:46:53 UTC
Ugh.  I've reproduced that on my system as well.  I'm looking into it now.

Comment 29 Dave Allan 2009-06-19 21:14:43 UTC
The problem isn't limited to RHEL5.4, it also exists in the head on Fedora 10.

Comment 31 Dave Allan 2009-06-19 21:56:34 UTC
I have found out what's going on, although I don't have a fix yet.  The WWN of ffffffffffffffff is actually being reported by the module itself in sysfs as it's loading.  Once the module has initialized completely, it reports the correct WWN in sysfs, but by then libvirt has already read the wrong names.  I am thinking that the code should just pause for a while if it sees a WWN of ffffffffffffffff and retry.  The wrong WWN does not affect the creation/deletion of virtual adapters on my system.

Comment 33 Marcus Barrow 2009-06-19 22:19:19 UTC
The driver might be busy talking to storage for awhile after loading. The amount of storage on a SAN is somewhat open ended, and the storage units might also be doing other things. So the time here might be hard to define...

Comment 34 Daniel Berrangé 2009-06-20 13:28:32 UTC
Perhaps it'll be beneficial to refresh the WWN at the time of the libvirt virNodeDeviceDumpXML call, so we always have the most up2date info. This would avoid having to sleep/retry when the device initially appears.

Comment 35 Dave Allan 2009-06-20 17:46:44 UTC
Refreshing the WWN at dumpxml time is a reasonable solution.  It's certainly more deterministic than trying to figure out when the module has completed initializing.

Comment 36 Dave Allan 2009-06-23 20:50:06 UTC
I have a fix for the WWN problem.  Would it be acceptable to open a separate bug against that problem as it does not affect create/destroy operations?

Comment 37 Jamie Wellnitz 2009-06-23 21:46:48 UTC
A separate bug for the WWN problem is find with me - I'm not sure you're asking me, though :)

Comment 39 Daniel Veillard 2009-06-26 14:48:00 UTC
libvirt-0.6.3-12.el5 has been built in dist-5E-qu-candidate with the fix for
the bogus WWN on reload.
To fasten the tests on this bug fix I have updated the repo at 
http://veillard.com/libvirt/5.4/ to include the new build,
please give it a try and report, then if positive I will update that
build as a candidate for release and internal QA,

  thanks in advance,

Daniel

Comment 40 Chris Ward 2009-07-03 18:42:25 UTC
~~ Attention - RHEL 5.4 Beta Released! ~~

RHEL 5.4 Beta has been released! There should be a fix present in the Beta release that addresses this particular request. Please test and report back results here, at your earliest convenience. RHEL 5.4 General Availability release is just around the corner!

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Please do not flip the bug status to VERIFIED. Only post your verification results, and if available, update Verified field with the appropriate value.

Questions can be posted to this bug or your customer or partner representative.

Comment 41 Chris Ward 2009-07-10 19:12:45 UTC
~~ Attention Partners - RHEL 5.4 Snapshot 1 Released! ~~

RHEL 5.4 Snapshot 1 has been released on partners.redhat.com. If you have already reported your test results, you can safely ignore this request. Otherwise, please notice that there should be a fix available now that addresses this particular request. Please test and report back your results here, at your earliest convenience. The RHEL 5.4 exception freeze is quickly approaching.

If you encounter any issues while testing Beta, please describe the issues you have encountered and set the bug into NEED_INFO. If you encounter new issues, please clone this bug to open a new issue and request it be reviewed for inclusion in RHEL 5.4 or a later update, if it is not of urgent severity.

Do not flip the bug status to VERIFIED. Instead, please set your Partner ID in the Verified field above if you have successfully verified the resolution of this issue. 

Further questions can be directed to your Red Hat Partner Manager or other appropriate customer representative.

Comment 42 Lawrence Lim 2009-07-28 04:32:12 UTC
Moved to VERIFIED based on #comment 27, QE please create a new bug for the WWN issue and leave a comment with the bug number in this bug once its done.

Thanks.

Comment 43 Nan Zhang 2009-07-29 03:08:56 UTC
Bug 514408 is created for the WWN issue.

Comment 44 Andrius Benokraitis 2009-07-29 14:30:07 UTC
I'm assuming based on all feedback that all partners have completed NPIV testing on 5.4. Let me know if this isn't true.

Comment 46 errata-xmlrpc 2009-09-02 09:20:29 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1269.html


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