blog header
Subscribe via: (Email / RSS)

VCDX Enterprise Admin Notes: Configure and use NPIV HBAs

by Harley Stagner on November 20, 2009

This VCDX Enterprise Admin exam note is about N-Port ID Virtualization (NPIV). On the exam blueprint this is section 1.1.S.3. According to the VI:3 Fibre Channel SAN Configuration Guide on pg. 86:

NPIV is an ANSI T11 standard that describes how a single Fibre Channel HBA port can register with the fabric using several worldwide port names (WWPNs). This allows a fabric-attached N-port to claim multiple fabric addresses. Each address appears as a unique entity on the Fibre Channel fabric.

So, what does this mean? ;) NPIV allows a single FC HBA port to register multiple unique WWNs with the SAN fabric. Each of these WWNs can be assigned to an individual virtual machine. This allows the SAN administrator to monitor and route storage access on a per VM basis. Pretty cool, huh? Here is my understanding of how the NPIV configuration process works with regards to VMware.

Notes for section 1.1.S.3: Configure and use NPIV HBAs

  • NPIV must be configured on the ports that you will use on your FC switches. (This configuration steps depend on the switch vendor).
  • Your HBAs on the ESX host must support NPIV. You can check to see if they support NPIV using the following command:
    • cat /proc/scsi/qla2300/? | grep NPIV (For Qlogic HBAs)
    • cat /proc/scsi/lpfc/? | grep NPIV (For Emulex HBAs)
  • The physical HBAs on an ESX host must be able to access the same LUNs that you will be presenting to the VM’s through NPIV.
  • When you are configuring an NPIV LUN for access, make sure that the NPIV LUN number and NPIV target ID match the physical LUN and Target ID.
  • Now when you create a VM and want to use NPIV, you need to do the following:
    • Create the VM as normal until you get to the disk portion. The NPIV disk will need to be a Raw Device Map (RDM) disk.
    • If you want to be able to VMotion the VM that uses NPIV, the RDM file needs to be on the same shared datastore where the virtual machine resides.
    • The RDM can be either virtual or physical compatibility mode, depending on your needs after weighing the pros and cons of each choice.
    • When you get to the end of the VM creation process, choose “Edit the virtual machine settings before submitting the creation task” checkbox and click Continue.
    • Select the Options tab, then Fibre Channel NPIV.
    • For a new VM choose the “Generate new WWNs” option. This will generate and assign new WWNs (four pairs: WWPN & WWNN) to the virtual machine.
    • The other two options are “Leave unchanged” and “Remove WWN assignment.”
    • Click OK to save the changes.
  • When the VM powers up, it uses each of the WWN pairs in sequence to try and discover an access path to the storage.
  • The number of VPORTS (virtual ports) that are instantiated is equal to the number of physical HBAs up to 4.
  • A VPORT is created on each physical HBA where a physical access path is found.
  • The physical paths will be used to determine the virtual paths used to access the LUN.

NPIV Confirmation Techniques:

To identify the HBAs (including the HBA #) in a host system, use the following commands:

  • ls /proc/scsi/qla2300 (For Qlogic HBAs)
  • ls /proc/scsi/lpfc (For Emulex HBAs)

Now, to confirm that NPIV traffic is going through an HBA you can check Fibre Channel traffic on the virtual switch port, or on the ESX host you can do the following:

  • cat /proc/scsi/qla2300/HBA# (For Qlogic HBAs)
  • cat /proc/scsi/lpfc/HBA# (For Emulex HBAs)
  • HBA# is the number for the particular HBA you are checking.
  • You can also confirm the creation of a VPORT using the same commands.

Additional Notes / Best Practices

  • The WWN information for an NPIV-enabled virtual machine is stored in the virtual machine’s vmx file.
  • When you clone a virtual machine or template with a WWN assigned to it, the clone does not retain the WWN.
  • Always use the VI Client to manipulate virtual machines with WWNs.

Leave a Comment