Creating NPIV Ports

por | 1 enero, 2017

You can configure NPIV for non-virtualized environments by using the fcadm command.

The fcinfo and fcadm status commands are available to determine the status of NPIV ports, whether the ports are created from fcadm. 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 and cfgadm, report NPIV information, although there is no distinction made between virtual and physical ports.

How to Create an NPIV Port

Before You Begin

Each 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.

  1. Become an administrator.
  2. 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.

Example 6-1 Creating an NPIV Port

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

How to Delete an NPIV Port

Before You Begin

You can use the fcinfo hba-port command to display the current WWN values for the NPIV ports.

  1. Become an administrator.
  2. Delete an NPIV port.
    # fcadm delete-npiv-port -p  Virtual_Port_WWN -n Virtual_Node_WWN 
    PhysicalPort_port_WWN

Example 6-2 Deleting an NPIV Port

The following example deletes an NPIV port on a physical HBA port with a WWN of 210000e08b170f1c.

# fcadm delete-npiv-port -p 2000000000000001 -n 2100000000000001 210000e08b170f1c

How to Display NPIV Port Status

  1. Become an administrator.
  2. Display the currently configured NPIV ports.
    # fcinfo hba-port

    The NPIV Port List shows the lists of currently configured NPIV ports.

Example 6-3 Displaying Status on 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