Bug 1022430 - [RFE] Dump max vports, vports and port state in use for HBA's XML
[RFE] Dump max vports, vports and port state in use for HBA's XML
Status: CLOSED DUPLICATE of bug 997756
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.6
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: John Ferlan
Virtualization Bugs
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 05:28 EDT by Alex Jia
Modified: 2014-04-02 04:52 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-02 04:52:41 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 Alex Jia 2013-10-23 05:28:11 EDT
Description of problem:
The current libvirt upstream commit 448be8f7 has implemented dumping max vports and vports in use for HBA's XML, and it's backported to libvirt rhel7.0 downstream, but the libvirt rhel6.5 is missing the patch. Except this, it will be more convenient to create vHBA for users if they can know connectivity of the port. In addition, if the port state is Linkdown/Offline then users will hit error like "error: Write of 'XXXX:XXXX' to '/sys/class/fc_host/host$NUM/vport_create' during vport create/delete failed: Operation not supported", it's also not friendly for users.

Version-Release number of selected component (if applicable):
rpm -q libvirt kernel
libvirt-0.10.2-29.el6.x86_64
kernel-2.6.32-288.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. # cat /tmp/check_vhba.sh
for i in $(virsh nodedev-list --cap scsi_host); do
    if virsh nodedev-dumpxml $i | grep vport_ops > /dev/null; then
        echo $i;
    fi
done

2. # sh /tmp/check_vhba.sh
scsi_host4
scsi_host5

3. # cat /tmp/vhba.scsi_host4.xml
    <device>
      <parent>scsi_host4</parent>
      <capability type='scsi_host'>
        <capability type='fc_host'>
        </capability>
      </capability>
    </device>

4. # virsh nodedev-create /tmp/vhba.scsi_host4.xml
error: Failed to create node device from /tmp/vhba.scsi_host4.xml
error: Write of '5001a4a94a1c33d0:5001a4ae1b949893' to '/sys/class/fc_host/host4/vport_create' during vport create/delete failed: Operation not supported

Notes, to improve error message and show port state.

5. # cat /tmp/vhba.scsi_host5.xml
    <device>
      <parent>scsi_host5</parent>
      <capability type='scsi_host'>
        <capability type='fc_host'>
        </capability>
      </capability>
    </device>

6. # virsh nodedev-create /tmp/vhba.scsi_host5.xml
Node device scsi_host6 created from /tmp/vhba.scsi_host5.xml


Actual results:
please see above

Expected results:

Can dump max vports, vports and port state and improve error message for creating device on Linkdown/Offline port.


Additional info:

# virsh nodedev-dumpxml scsi_host4
<device>
  <name>scsi_host4</name>
  <parent>pci_0000_04_00_0</parent>
  <capability type='scsi_host'>
    <host>4</host>
    <capability type='fc_host'>
      <wwnn>2000001b3289da4e</wwnn>
      <wwpn>2100001b3289da4e</wwpn>
      <fabric_wwn>ffffffff</fabric_wwn>
    </capability>
    <capability type='vport_ops' />
  </capability>
</device>


# virsh nodedev-dumpxml scsi_host5
<device>
  <name>scsi_host5</name>
  <parent>pci_0000_04_00_1</parent>
  <capability type='scsi_host'>
    <host>5</host>
    <capability type='fc_host'>
      <wwnn>2001001b32a9da4e</wwnn>
      <wwpn>2101001b32a9da4e</wwpn>
      <fabric_wwn>2001000dec9877c1</fabric_wwn>
    </capability>
    <capability type='vport_ops' />
  </capability>
</device>

Notes, to show max_vports, vports and port_state.


# virsh nodedev-dumpxml scsi_host6
<device>
  <name>scsi_host6</name>
  <parent>scsi_host5</parent>
  <capability type='scsi_host'>
    <host>9</host>
    <capability type='fc_host'>
      <wwnn>5001a4a3551abf31</wwnn>
      <wwpn>5001a4a408e2e86b</wwpn>
      <fabric_wwn>ffffffff</fabric_wwn>
    </capability>
  </capability>
</device>

Notes, the fabric_wwn of the scsi_host6 inherits scsi_host4 not scsi_host5, is it an expected result? in addition, the 'ffffffff' means the port isn't available or offline? or we also need to check '/sys/class/fc_host/host$NUM/port_state' to make sure connectivity of the port.



# git show 448be8f7
commit 448be8f706693327d77756fb47aa275edfb14977
Author: Osier Yang <jyang@redhat.com>
Date:   Tue Jan 8 01:05:32 2013 +0800

    nodedev: Dump max vports and vports in use for HBA's XML

    This enrichs HBA's xml by dumping the number of max vports and
    vports in use. Format is like:

      <capability type='vport_ops'>
        <max_vports>164</max_vports>
        <vports>5</vports>
      </capability>

    * docs/formatnode.html.in: (Document the new XML)
    * docs/schemas/nodedev.rng: (Add the schema)
    * src/conf/node_device_conf.h: (New member for data.scsi_host)
    * src/node_device/node_device_linux_sysfs.c: (Collect the value of
      max_vports and vports)
Comment 1 Jiri Denemark 2014-04-02 04:52:41 EDT

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

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