Bug 597998

Summary: [NPIV] node device vHBA isn't really destroyed
Product: Red Hat Enterprise Linux 6 Reporter: Nan Zhang <nzhang>
Component: libvirtAssignee: Dave Allan <dallan>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: berrange, hbrock, llim, mjenner, tao, xen-maint, yimwang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0_8_1-10_el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-11 14:49:24 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 Nan Zhang 2010-05-31 08:23:02 UTC
Description of problem:
node device can't be destroyed.

Version-Release number of selected component (if applicable):
libvirt-0.8.1-6.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
# virsh nodedev-dumpxml scsi_host7
<device>
  <name>scsi_host7</name>
  <parent>computer</parent>
  <capability type='scsi_host'>
    <host>7</host>
    <capability type='fc_host'>
      <wwnn>2001001b32a9f25b</wwnn>
      <wwpn>2101001b32a90002</wwpn>
    </capability>
  </capability>
</device>

# virsh nodedev-destroy scsi_host7
Destroyed node device 'scsi_host7'

# ls /sys/class/fc_host/
host4  host5  host6  host7
  
Actual results:
device cannot be destroyed.

Expected results:
device can be destroyed.

Additional info:
Can workaround by following command.
# echo '2101001b32a90002:2001001b32a9f25b' > /sys/class/fc_host/host5/vport_delete 
# ls /sys/class/fc_host/
host4  host5  host6

Comment 2 Daniel Berrangé 2010-06-02 10:41:09 UTC
This is bad because libvirt reported that the device was successfully destroyed, but it didn't actually go away.

Comment 3 Dave Allan 2010-06-02 14:36:05 UTC
There are really two bugs here.  One is the failure to destroy the vHBA, which is a dup of 593995.  The destroy operation goes to look up the parent, finds "computer", realizes that it can't issue a destroy operation to it, and fails.  I have already submitted a patch upstream to fix this problem.

The other bug is that nodeDeviceDestroy does not set its return value correctly on failure.  I have a patch which I will be submitting upstream today.

Comment 4 Dave Allan 2010-06-03 19:38:29 UTC
The upstream patch was ack'd and I pushed it earlier today, commit d3e43bad98e3f95408203859bb4165f3b9b10d5b

Comment 5 RHEL Program Management 2010-06-07 15:55:53 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 7 Dave Allan 2010-06-23 21:30:32 UTC
libvirt-0_8_1-10_el6 has been built in RHEL-6-candidate with the fix.

Dave

Comment 8 wangyimiao 2010-06-25 09:38:05 UTC
Verified this bug PASS with libvirt-0.8.1-10.el6.x86_64
- kernel-2.6.32-36.el6.x86_64
- qemu-img-0.12.1.2-2.80.el6.x86_64
- qemu-kvm-0.12.1.2-2.80.el6.x86_64

Comment 9 Dave Allan 2010-06-29 15:38:07 UTC
*** Bug 608701 has been marked as a duplicate of this bug. ***

Comment 10 Issue Tracker 2010-06-29 17:44:39 UTC
Event posted on 06-29-2010 12:22pm EDT by Glen Johnson

------- Comment From lnx1138.ibm.com 2010-06-29 12:14 EDT-------
Thanks for the update! From the other bug, the upstream change is
http://libvirt.org/git/?p=libvirt.git;a=commit;h=d3e43bad98e3f95408203859bb4165f3b9b10d5b

Can you provide snapshot that the updated libvirt is targeted for please?


This event sent from IssueTracker by jkachuck 
 issue 1068533

Comment 11 Issue Tracker 2010-06-29 20:14:58 UTC
Event posted on 06-29-2010 03:43pm EDT by Glen Johnson

------- Comment From maknayak.com 2010-06-29 15:35 EDT-------
(In reply to comment #19)
(In reply to comment #20)

Hi All,
I downloaded following libvirt-0.8.1-11.el6.x86_64 rpms from the link
"people.redhat.com/~dallan" mentioned on comment# 19 ,installed on one
of the pre-beta2 x86_64 system , verified by virsh command
from command line and did not reproduce the error again.

--- Installed libvirt components ----
libvirt-0.8.1-11.el6.x86_64.rpm
libvirt-client-0.8.1-11.el6.x86_64.rpm
libvirt-debuginfo-0.8.1-11.el6.x86_64.rpm
libvirt-devel-0.8.1-11.el6.x86_64.rpm
libvirt-python-0.8.1-11.el6.x86_64.rpm

--- Here is the testing output ---

Before vport creation:

[root@elm3c93 manas]# lsscsi
[2:0:0:0]    enclosu IBM      SAS SES-2 DEVICE 2.06  -
[2:2:0:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sda
[2:2:1:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdb
[2:2:2:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdc
[2:2:3:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdd
[3:0:0:0]    disk    IBM      1726-4xx  FAStT  0617  -
[4:0:1:0]    disk    IBM      1726-4xx  FAStT  0617  /dev/sde
[4:0:1:1]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdf
[4:0:1:2]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdg
[4:0:1:3]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdh
[4:0:1:4]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdi
[4:0:1:5]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdj
[4:0:1:6]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdk
[4:0:1:7]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdl

[root@elm3c93 manas]# virsh nodedev-create virtualhba.xml
Node device scsi_host15 created from virtualhba.xml

--- output from /var/log/messages ---
Jun 29 16:18:30 elm3c93 kernel: qla2xxx 0000:0c:00.0: VP entry id 1
assigned.
Jun 29 16:18:30 elm3c93 kernel: scsi15 : qla2xxx
Jun 29 16:18:30 elm3c93 kernel: scsi host3: vport-3:0-9 created via shost3
channel 0
Jun 29 16:18:32 elm3c93 kernel: scsi 15:0:0:0: Direct-Access   IBM
1726-4xx  FAStT  0617 PQ: 0 ANSI: 5
Jun 29 16:18:32 elm3c93 kernel: sd 15:0:0:0: [sdm] 16777216 512-byte
logical blocks: (8.58 GB/8.00 GiB)
Jun 29 16:18:32 elm3c93 kernel: sd 15:0:0:1: [sdn] 16777216 512-byte
logical blocks: (8.58 GB/8.00 GiB)
Jun 29 16:18:32 elm3c93 kernel: sd 15:0:0:2: [sdo] 16777216 512-byte
logical blocks: (8.58 GB/8.00 GiB)
Jun 29 16:18:32 elm3c93 kernel: sd 15:0:0:3: [sdp] 16777216 512-byte
logical blocks: (8.58 GB/8.00 GiB)

[root@elm3c93 manas]# lsscsi
[2:0:0:0]    enclosu IBM      SAS SES-2 DEVICE 2.06  -
[2:2:0:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sda
[2:2:1:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdb
[2:2:2:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdc
[2:2:3:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdd
[3:0:0:0]    disk    IBM      1726-4xx  FAStT  0617  -
[4:0:1:0]    disk    IBM      1726-4xx  FAStT  0617  /dev/sde
[4:0:1:1]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdf
[4:0:1:2]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdg
[4:0:1:3]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdh
[4:0:1:4]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdi
[4:0:1:5]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdj
[4:0:1:6]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdk
[4:0:1:7]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdl
[15:0:0:0]   disk    IBM      1726-4xx  FAStT  0617  /dev/sdm
[15:0:0:1]   disk    IBM      1726-4xx  FAStT  0617  /dev/sdn
[15:0:0:2]   disk    IBM      1726-4xx  FAStT  0617  /dev/sdo
[15:0:0:3]   disk    IBM      1726-4xx  FAStT  0617  /dev/sdp

[root@elm3c93 manas]# virsh nodedev-destroy scsi_host15
Destroyed node device 'scsi_host15'

--- output from /var/log/messages ---
Jun 29 16:18:53 elm3c93 kernel: qla2xxx 0000:0c:00.0: vport 1 deleted
Jun 29 16:19:02 elm3c93 kernel: rport-3:0-5: blocked FC remote port time
out: removing rport

[root@elm3c93 manas]# lsscsi
[2:0:0:0]    enclosu IBM      SAS SES-2 DEVICE 2.06  -
[2:2:0:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sda
[2:2:1:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdb
[2:2:2:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdc
[2:2:3:0]    disk    IBM      ServeRAID-MR10k  1.12  /dev/sdd
[3:0:0:0]    disk    IBM      1726-4xx  FAStT  0617  -
[4:0:1:0]    disk    IBM      1726-4xx  FAStT  0617  /dev/sde
[4:0:1:1]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdf
[4:0:1:2]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdg
[4:0:1:3]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdh
[4:0:1:4]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdi
[4:0:1:5]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdj
[4:0:1:6]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdk
[4:0:1:7]    disk    IBM      1726-4xx  FAStT  0617  /dev/sdl

I repeated above execution several times and it worked perfectly without
any issue.
libvirt-0.8.1-11.el6 has fix for this issue.

Thanks...
Manas


This event sent from IssueTracker by jkachuck 
 issue 1068533

Comment 12 Dave Allan 2010-06-30 02:36:48 UTC
Thanks for the verification; this fix should be in snap 7.

Comment 14 releng-rhel@redhat.com 2010-11-11 14:49:24 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.