rhel7: How can NPIV HBAs be handled by libvirt, so they are not addressed in "hostX" style but with identifiers which are not subject to change?

Solution Unverified - Updated -

Issue

When defining a NPIV HBA the parent needs to be given as a host number for example:

# vi vhba_host3.xml
<device>
    <parent>scsi_host3</parent>
    <capability type='scsi_host'>
        <capability type='fc_host'>
        </capability>
    </capability>
</device>

In the customers case they had the the actual HBAs change over a reboot from this:

lrwxrwxrwx. 1 root root 0 Jun  7 16:12 host0 -> ../../devices/pci0000:00/0000:00:01.0/0000:03:00.0/host0/scsi_host/host0
lrwxrwxrwx. 1 root root 0 Jun  7 16:12 host1 -> ../../devices/pci0000:00/0000:00:02.0/0000:05:00.0/host1/scsi_host/host1
lrwxrwxrwx. 1 root root 0 Jun  7 16:12 host2 -> ../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1:1.0/host2/scsi_host/host2
lrwxrwxrwx. 1 root root 0 Jun  7 16:12 host3 -> ../../devices/pci0000:00/0000:00:03.2/0000:0b:00.0/host3/scsi_host/host3

To this:

lrwxrwxrwx. 1 root root 0 Jun  9 23:17 host0 -> ../../devices/pci0000:00/0000:00:01.0/0000:03:00.0/host0/scsi_host/host0
lrwxrwxrwx. 1 root root 0 Jun  9 23:17 host1 -> ../../devices/pci0000:00/0000:00:02.0/0000:05:00.0/host1/scsi_host/host1
lrwxrwxrwx. 1 root root 0 Jun  9 23:17 host2 -> ../../devices/pci0000:00/0000:00:03.2/0000:0b:00.0/host2/scsi_host/host2
lrwxrwxrwx. 1 root root 0 Jun  9 23:17 host3 -> ../../devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1:1.0/host3/scsi_host/host3

The NPIV HBAs changed from:

lrwxrwxrwx. 1 root root 0 Jun 9 23:04 host6 -> ../../devices/pci0000:00/0000:00:03.2/0000:0b:00.0/host3/vport-3:0-0/host6/scsi_host/host6
lrwxrwxrwx. 1 root root 0 Jun 9 23:04 host7 -> ../../devices/pci0000:00/0000:00:03.2/0000:0b:00.0/host3/vport-3:0-1/host7/scsi_host/host7

To:

lrwxrwxrwx. 1 root root 0 Jun 9 23:18 host6 -> ../../devices/pci0000:00/0000:00:02.0/0000:05:00.0/host1/vport-1:0-2/host6/scsi_host/host6
lrwxrwxrwx. 1 root root 0 Jun 9 23:18 host7 -> ../../devices/pci0000:00/0000:00:02.0/0000:05:00.0/host1/vport-1:0-3/host7/scsi_host/host7

Could instead of "hostX" an identifier be used that does not change?

Environment

  • Red Hat Enterprise Linux (RHEL)
  • libvirt
  • NPIV

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.