This chapter provides the steps used to configure N Port ID Virtualization (NPIV) ports, also known as virtual Fibre Channel ports.
NPIV is a Fibre Channel facility that enables one Fibre Channel adapter to have many N Port IDs. Each N Port has a unique identity (port WWN and node WWN) on the SAN and can be used for zoning and LUN masking. Soft zoning, which you can use to group ports together by port WWN, is the preferred method of zoning.
Here is the list of NPIV limitations when used to virtualize Fibre Channel ports:
NPIV ports may not be used for booting.
NPIV ports are best used in SANs with a relatively small number of ports, either virtual or physical. Also, some targets may not have enough resources to process the large number of ports that NPIV can create. This limitation exists because processing state change notifications (SCN) on the SAN takes significant time if there are a large number of ports on the SAN. You can workaround this limitation on a large SAN by using zoning, which can limit the number of visible ports.
MPxIO can be used with NPIV, although you should ensure that different paths are physically redundant.
NPIV is supported only in a Fabric topology. It is not supported in an FC-AL or point-to-point topology.
Not all hardware supports NPIV. Both switches and HBAs (although not targets) must support NPIV in a SAN. By specification, HBAs should support up to 255 virtual ports, although this is defined by the resources on the switch. Switches may have to be updated to the latest firmware levels for NPIV support.
The fcadm(1M) command is available to configure NPIV for non-virtualized environments. For xVM, see the virsh(1M) command documented in the Virtualization System Administration Guide.
The fcinfo(1M) and fcadm(1M) status commands are available to determine the status of NPIV ports, whether the ports are created from fcadm(1M) or by virtualization specific commands, such as xm(1M). The commands also report the relationship between the physical port and the virtual ports hosted on that port.
Other Fibre Channel commands, such as luxadm(1M) and cfgadm(1M), report NPIV information, although there is no distinction made between virtual and physical ports.
 To Create an NPIV Port
To Create an NPIV PortEach virtual port must have a port and node name. The port name must be unique on the SAN. You can assign names manually or use the built-in random WWN generator. If you attempt to register duplicate names, most switches will report an error status on the newly registered WWN, and the switch will not register the new WWN.
For more information on acceptable name formats, refer to the T11 standard: Fibre Channel Framing and Signaling (FC-FS 2).
If you try to create an NPIV port on an HBA that does not support NPIV, an error will occur. If you try to create an NPIV port on an HBA that supports NPIV, but it is attached to a switch which does not support NPIV, the port will be created with an offline status. The status will be reported in the fcinfo(1M) output.
Become superuser.
Create an NPIV port:
| # fcadm create-npiv-port -p Virtual_Port_WWN -n Virtual_Node_WWN PhysicalPort_port_WWN | 
Without the -p and -n options, a random WWN will be assigned for the virtual port and virtual node, respectively.
The following example creates an NPIV port on a physical HBA port with a WWN of 210000e08b170f1c, a virtual port WWN set to 2000000000000001, and a virtual node WWN set to 2100000000000001.
| # fcadm create-npiv-port -p 2000000000000001 -n 2100000000000001 210000e08b170f1c | 
 To Delete an NPIV Port
To Delete an NPIV PortYou can use the fcinfo hba-port command to display the current WWN values for the NPIV ports.
Become superuser.
Delete an NPIV port:
| # fcadm delete-npiv-port -p Virtual_Port_WWN -n Virtual_Node_WWN PhysicalPort_port_WWN | 
The following example deletes an NPIV port on a physical HPA port with a WWN of 210000e08b170f1c.
| # fcadm delete-npiv-port -p 2000000000000001 -n 2100000000000001 210000e08b170f1c | 
 To Report Status on NPIV Ports
To Report Status on NPIV PortsBecome superuser.
Report status on the currently configured NPIV ports:
| # fcinfo hba-port | 
The NPIV Port List shows the lists of currently configured NPIV ports.
The following example shows that HBA port 210000e08b84f7eb has one virtual port.
| # fcinfo hba-port
HBA Port WWN: 210000e08b84f7eb
     Port Mode: Initiator
     Port ID: 10100
     OS Device Name: /dev/cfg/c7
     Manufacturer: QLogic Corp.
     Model: 375-3294-01
     Firmware Version: 04.04.00
     FCode/BIOS Version:  BIOS: 1.4; fcode: 1.11; EFI: 1.0;
     Serial Number: 0402F00-0549112895
     Driver Name: qlc
     Driver Version: 20080430-0.00
     Type: N-port
     State: online
     Supported Speeds: 1Gb 2Gb 4Gb
     Current Speed: 4Gb
     Node WWN: 200000e08b84f7eb
     Max NPIV Ports: 63
     NPIV port list:
       Virtual Port1:
             Node WWN: 1110000000000000
             Port WWN: 1210000000000000 |