12.8. Using an NPIV Virtual Adapter (vHBA) with SCSI Devices

download PDF
NPIV (N_Port ID Virtualization) is a software technology that allows sharing of a single physical Fibre Channel host bus adapter (HBA).
This allows multiple guests to see the same storage from multiple physical hosts, and thus allows for easier migration paths for the storage. As a result, there is no need for the migration to create or copy storage, as long as the correct storage path is specified.
In virtualization, the virtual host bus adapter, or vHBA, controls the LUNs for virtual machines. Each vHBA is identified by its own WWNN (World Wide Node Name) and WWPN (World Wide Port Name). The path to the storage is determined by the WWNN and WWPN values.
This section provides instructions for configuring a vHBA on a virtual machine. Note that Red Hat Enterprise Linux 6 does not support persistent vHBA configuration across host reboots; verify any vHBA-related settings following a host reboot.

12.8.1. Creating a vHBA

Procedure 12.6. Creating a vHBA

  1. Locate HBAs on the host system

    To locate the HBAs on your host system, examine the SCSI devices on the host system to locate a scsi_host with vport capability.
    Run the following command to retrieve a scsi_host list:
    # virsh nodedev-list --cap scsi_host
    For each scsi_host, run the following command to examine the device XML for the line <capability type='vport_ops'>, which indicates a scsi_host with vport capability.
    # virsh nodedev-dumpxml scsi_hostN
  2. Check the HBA's details

    Use the virsh nodedev-dumpxml HBA_device command to see the HBA's details.
    The XML output from the virsh nodedev-dumpxml command will list the fields <name>, <wwnn>, and <wwpn>, which are used to create a vHBA. The <max_vports> value shows the maximum number of supported vHBAs.
     # virsh nodedev-dumpxml scsi_host3
      <capability type='scsi_host'>
        <capability type='fc_host'>
        <capability type='vport_ops'>
    In this example, the <max_vports> value shows there are a total 127 virtual ports available for use in the HBA configuration. The <vports> value shows the number of virtual ports currently being used. These values update after creating a vHBA.
  3. Create a vHBA host device

    Create an XML file similar to the following (in this example, named vhba_host3.xml) for the vHBA host.
    # cat vhba_host3.xml
         <capability type='scsi_host'>
           <capability type='fc_host'>
    The <parent> field specifies the HBA device to associate with this vHBA device. The details in the <device> tag are used in the next step to create a new vHBA device for the host. See for more information on the nodedev XML format.
  4. Create a new vHBA on the vHBA host device

    To create a vHBA on vhba_host3, use the virsh nodedev-create command:
    # virsh nodedev-create vhba_host3.xml
    Node device scsi_host5 created from vhba_host3.xml
  5. Verify the vHBA

    Verify the new vHBA's details (scsi_host5) with the virsh nodedev-dumpxml command:
    # virsh nodedev-dumpxml scsi_host5
      <capability type='scsi_host'>
        <capability type='fc_host'>
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.