Thursday, July 12, 2018

How to force virtual Fibre to login to SAN

Each vfc-client adapter has a pair of unique WWPNs. The primary WWPN is used initially in all cases. The secondary WWPN is used only when the client LPAR is moved to another physical server using PowerVM Live Partition Mobility.

HMC V7R7.3 and above

HMC V7R7.3 with MH01263 or higher (and VIOS 2.2.0.11-FP24-SP01 or higher) provides the chnportlogin and lsnportlogin commands.
barker@sahmc1:~> lsnportlogin -m Zeus --filter "lpar_names=ams28" -F
ams28,30,default-AME_AMS,4,c050760007590012,0
ams28,30,default-AME_AMS,4,c050760007590013,0
ams28,30,default-AME_AMS,5,c050760007590015,0
ams28,30,default-AME_AMS,5,c050760007590014,0
Note: When run for the first time, lsnportlogin shows all ports logged out, whether true or not.
barker@sahmc1:~> chnportlogin -m Zeus -p ams28 -o login

barker@sahmc1:~> lsnportlogin -m Zeus --filter "lpar_names=ams28" -F
ams28,30,default-AME_AMS,4,c050760007590012,1
ams28,30,default-AME_AMS,4,c050760007590013,1
ams28,30,default-AME_AMS,5,c050760007590015,1
ams28,30,default-AME_AMS,5,c050760007590014,1
Note: Now all ports show 1 (logged in), but not all are in use. Please note that for each vfc-client adapter both WWPNs are logged in.
barker@sahmc1:~> chnportlogin -m Zeus -p ams28 -o logout

barker@sahmc1:~> lsnportlogin -m Zeus --filter "lpar_names=ams28" -F
ams28,30,default-AME_AMS,4,c050760007590012,0
ams28,30,default-AME_AMS,4,c050760007590013,1
ams28,30,default-AME_AMS,5,c050760007590015,0
ams28,30,default-AME_AMS,5,c050760007590014,1
barker@sahmc1:~>
Note: Now ports in use show 1 (logged in) and others show 0 (not logged in).

Below HMC V7R7.3

At software levels below HMC V7.7.3.0 with MH01263 and/or VIOS 2.2.0.11-FP24-SP01, it is still possible to force a virtual Fibre device to login to the SAN, but only the primary WWPN will log in. If a vfc-client device is defined for an LPAR which is already running an operating system, then if/when the operating system opens the vfc-client device, the device will log in to the SAN. But in some cases it is desirable to force a vfc-client device to log in to the SAN before an operating system is installed.
Please note that the WWPNs of a vfc-client device can be displayed from the HMC:
cybroot@sfohmc1:~> lshwres -r virtualio --rsubtype fc --level lpar -m Server-8233-E8B-SN0623B7P -F lpar_name,wwpns --header --filter lpar_names=lpar2
lpar_name,wwpns
lpar2,"c0507602f66f0004,c0507602f66f0005"
lpar2,"c0507602f66f0006,c0507602f66f0007"
cybroot@sfohmc1:~>
so WWPNs can be determined without forcing vfc-client devices to log in to the SAN.
Section 2.4 Virtual Fibre Channel and N_Port ID virtualization in the PowerVM Migration from Physical to Virtual Storage Redbook says that a vfc-client device can be forced to log in to the SAN fabric using SMS mode. However, the method described in the Redbook only works if at least one LUN has been masked so that it can be seen by the vfc-client device, which might be difficult to accomplish without first getting the vfc-client device to log in to the SAN.
A vfc-client device can be forced to log in to the SAN by booting the client LPAR to an Open Firmware (0 >) prompt, running the ioinfo utility, and selecting the FCINFO option, as described on the How to Capture SAN Boot Debug for Virtual I/O Server and AIX on P6 Systems Technote and here:
SSH to an HMC which is managing the LPAR. Use the vtmenu command on the HMC to open a virtual terminal session on the LPAR's system console. On the HMC GUI, select the server on which the LPAR resides, then select the LPAR, and shut the LPAR down if it is running. Then, use Operations -> Activate -> Profile -> Advanced ... to open the Activate Logical Partition - Advanced window. In the window, select Boot mode: Open Firmware OK Prompt. Or start the LPAR using the HMC command line, specifying '-b of' on the chsysstate command.
In the LPAR's system console window, you will see the LPAR start up and present the open firmware prompt ("0 >"). Respond to prompts as shown in blue below:
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

          1 = SMS Menu                          5 = Default Boot List
          8 = Open Firmware Prompt              6 = Stored Boot List


     Memory      Keyboard     Network     SCSI     Speaker  ok
0 > ioinfo

!!! IOINFO: FOR IBM INTERNAL USE ONLY !!!
This tool gives you information about SCSI,IDE,SATA,SAS,and USB devices attached to the system

Select a tool from the following

 1. SCSIINFO
 2. IDEINFO
 3. SATAINFO
 4. SASINFO
 5. USBINFO
 6. FCINFO
 7. VSCSIINFO

q - quit/exit

==> 6



FCINFO Main Menu
Select a FC Node from the following list:
  #  Location Code                Pathname
---------------------------------------------------------------
  1. U8233.E8B.0623B7P-V5-C21-T1    /vdevice/vfc-client@30000015
  2. U8233.E8B.0623B7P-V5-C22-T1    /vdevice/vfc-client@30000016

  q - Quit/Exit

==> 1

FC Node Menu
FC Node String: /vdevice/vfc-client@30000015
FC Node WorldWidePortName: c0507602f66f0004
-----------------------------------------------------------------
1. List Attached FC Devices
2. Select a FC Device
3. Enable/Disable FC Adapter Debug flags

q - Quit/Exit

==> 1

NO FC DEVICES FOUND

Hit a key to continue...
Please note that the technique above will cause only one vfc-client device at a time to log in to the SAN using the first WWPN for each device. And please note the text in red which suggests that the IBM Support Center can't provide much help with Open Firmware.
When the vfc-client device is logged in to the SAN, on the VIO Server one should see:
sfvio1:/home/padmin $ lsmap -npiv -vadapter vfchost1
Name          Physloc                            ClntID ClntName       ClntOS
------------- ---------------------------------- ------ -------------- -------
vfchost1      U8233.E8B.0623B7P-V2-C32                5 lpar2          FIRMWARE

Status:LOGGED_IN
FC name:fcs2                    FC loc code:U5802.001.0087365-P1-C2-T1
Ports logged in:1
Flags:a<LOGGED_IN,STRIP_MERGE>
VFC client name:Virtual Fibre Channel - Firmware driverVFC client DRC:U8233.E8B.0623B7P-V5-C21

sfvio1:/home/padmin $
If the SAN is configured so that the vfc-client device can "see" a LUN, then ioinfo will display:
==> 1

NO FC DEVICES FOUND

1. 5005076801101fe0,0                - Unrecognized device type: 3f
2. 5005076801101fe0,4000000000000    - 46080 MB Disk drive
rather than:
==> 1

NO FC DEVICES FOUND

Hit a key to continue...
The 4 in the example above is the number of the LUN which can be accessed via the vfc-client device.

Troubleshooting

For advice, please see the PowerVM NPIV / IBM Switch Configuration: Troubleshooting Technote.
Once vFC adapters are defined as described in the Technote, if the open firmware ioinfo subcommand fails with a message like that in red below:

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

          1 = SMS Menu                          5 = Default Boot List
          8 = Open Firmware Prompt              6 = Stored Boot List


     Memory      Keyboard     Network     SCSI     Speaker  ok
0 > ioinfo

!!! IOINFO: FOR IBM INTERNAL USE ONLY !!!
This tool gives you information about SCSI,IDE,SATA,SAS,and USB devices attached to the system

Select a tool from the following

 1. SCSIINFO
 2. IDEINFO
 3. SATAINFO
 4. SASINFO
 5. USBINFO
 6. FCINFO
 7. VSCSIINFO

q - quit/exit

==> 6



FCINFO Main Menu
Select a FC Node from the following list:
  #  Location Code                Pathname
---------------------------------------------------------------
  1. U8233.E8B.0623B7P-V7-C21-T1    /vdevice/vfc-client@30000015
  2. U8233.E8B.0623B7P-V7-C22-T1    /vdevice/vfc-client@30000016
  3. U8233.E8B.0623B7P-V7-C23-T1    /vdevice/vfc-client@30000017
  4. U8233.E8B.0623B7P-V7-C24-T1    /vdevice/vfc-client@30000018

  q - Quit/Exit

==> 1

FC Node Menu
FC Node String: /vdevice/vfc-client@30000015
FC Node WorldWidePortName: c0507602f66f0004
-----------------------------------------------------------------
1. List Attached FC Devices
2. Select a FC Device
3. Enable/Disable FC Adapter Debug flags

q - Quit/Exit

==> 1

OPEN-FC-NODE: open-dev OF /vdevice/vfc-client@30000017 FAILED
FAILED TO OPEN FC NODE

Hit a key to continue...
then the following approach to troubleshooting is appropriate:
  1. If the VIO client LPAR name is mob77 (for example), determine the vfchost adapter(s) used by the LPAR by issuing the following VIOS padmin command:
    $ lsmap -npiv -all | grep -p mob77
    Name          Physloc                            ClntID ClntName       ClntOS
    ------------- ---------------------------------- ------ -------------- -------
    vfchost6      U9179.MHB.1026D1P-V1-C21               33 mob77          AIX
    
    $
    
  2. Then, determine the physical Fibre Channel adapter to which each vfchost adapter is mapped by issuing the following VIOS padmin command:
    $ lsmap -vadapter vfchost6 -npiv
    Name          Physloc                            ClntID ClntName       ClntOS
    ------------- ---------------------------------- ------ -------------- -------
    vfchost6      U9179.MHB.1026D1P-V1-C21               33 mob77          AIX
    
    Status:LOGGED_IN
    FC name:fcs0                    FC loc code:U78C0.001.DBJ4725-P2-C2-T1
    Ports logged in:3
    Flags:a<LOGGED_IN,STRIP_MERGE>
    VFC client name:fcs0            VFC client DRC:U9179.MHB.1026D1P-V33-C3
    
    $
    
  3. Then, confirm that the physical Fibre Channel adapter port(s) are ready to support NPIV by issuing the following VIOS padmin command:
    $ lsnports
    name             physloc                        fabric tports aports swwpns  awwpns
    fcs0             U78C0.001.DBJ4725-P2-C2-T1          1     64     58   2048    2024
    fcs1             U78C0.001.DBJ4725-P2-C2-T2          1     64     58   2048    2025
    $
    
    • If the fabric attribute of a relevant physical Fibre Channel adapter port is 1, then the adapter is ready to support NPIV.

      One potential reason why the open firmware ioinfo subcommand might fail even though the adapter is ready to support NPIV is that two or more vfc-client devices are using the same slot on a VIO server. In the example below, the vfc-client devices at locations U8233.E8B.0623B7P-V7-C21-T1 and U8233.E8B.0623B7P-V7-C23-T1 are using the same slot number (34) on vio1:
      hscroot@sfohmc1:~> lshwres -r virtualio --rsubtype fc --level lpar -m Server-8233-E8B-SN0623B7P
      lpar_name=vio1,lpar_id=2,slot_num=31,adapter_type=server,state=1,is_required=0,remote_lpar_id=4,remote_lpar_name=lpar1,remote_slot_num=21
      lpar_name=vio1,lpar_id=2,slot_num=32,adapter_type=server,state=1,is_required=0,remote_lpar_id=5,remote_lpar_name=lpar2,remote_slot_num=21
      lpar_name=vio1,lpar_id=2,slot_num=33,adapter_type=server,state=1,is_required=0,remote_lpar_id=6,remote_lpar_name=lpar3,remote_slot_num=21
      lpar_name=vio1,lpar_id=2,slot_num=34,adapter_type=server,state=1,is_required=0,remote_lpar_id=7,remote_lpar_name=lpar4,remote_slot_num=21
      lpar_name=vio2,lpar_id=3,slot_num=31,adapter_type=server,state=1,is_required=0,remote_lpar_id=4,remote_lpar_name=lpar1,remote_slot_num=22
      lpar_name=vio2,lpar_id=3,slot_num=32,adapter_type=server,state=1,is_required=0,remote_lpar_id=5,remote_lpar_name=lpar2,remote_slot_num=22
      lpar_name=vio2,lpar_id=3,slot_num=33,adapter_type=server,state=1,is_required=0,remote_lpar_id=6,remote_lpar_name=lpar3,remote_slot_num=22
      lpar_name=vio2,lpar_id=3,slot_num=34,adapter_type=server,state=1,is_required=0,remote_lpar_id=7,remote_lpar_name=lpar4,remote_slot_num=22
      lpar_name=lpar1,lpar_id=4,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=31,"wwpns=c0507602f66f0000,c0507602f66f0001"
      lpar_name=lpar1,lpar_id=4,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=31,"wwpns=c0507602f66f0002,c0507602f66f0003"
      lpar_name=lpar2,lpar_id=5,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=32,"wwpns=c0507602f66f0004,c0507602f66f0005"
      lpar_name=lpar2,lpar_id=5,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=32,"wwpns=c0507602f66f0006,c0507602f66f0007"
      lpar_name=lpar3,lpar_id=6,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=33,"wwpns=c0507602f66f0008,c0507602f66f0009"
      lpar_name=lpar3,lpar_id=6,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=33,"wwpns=c0507602f66f000a,c0507602f66f000b"
      lpar_name=lpar4,lpar_id=7,slot_num=21,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=34,"wwpns=c0507602f66f000c,c0507602f66f000d"
      lpar_name=lpar4,lpar_id=7,slot_num=22,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=34,"wwpns=c0507602f66f000e,c0507602f66f000f"
      lpar_name=lpar4,lpar_id=7,slot_num=23,adapter_type=client,state=1,is_required=0,remote_lpar_id=2,remote_lpar_name=vio1,remote_slot_num=34,"wwpns=c0507602f66f0010,c0507602f66f0011"
      lpar_name=lpar4,lpar_id=7,slot_num=24,adapter_type=client,state=1,is_required=0,remote_lpar_id=3,remote_lpar_name=vio2,remote_slot_num=34,"wwpns=c0507602f66f0012,c0507602f66f0013"
      hscroot@sfohmc1:~>
      
    • If the fabric attribute of a relevant physical Fibre Channel adapter port is 0, then the adapter is not ready to support NPIV.

      One potential reason why the adapter might not be ready to support NPIV is that the fscsi child of the adapter port is not attached in switch mode:
      $ lsdev -dev fcs0 -child
      name             status      description
      fcnet0           Defined     Fibre Channel Network Protocol Device
      fscsi0           Available   FC SCSI I/O Controller Protocol Device
      $ lsdev -dev fscsi0 -attr
      attribute    value        description                           user_settable
      
      attach       switch       How this adapter is CONNECTED         False
      dyntrk       no           Dynamic Tracking of FC Devices        True
      fc_err_recov delayed_fail FC Fabric Event Error RECOVERY Policy True
      scsi_id      0x620c00     Adapter SCSI ID                       False
      sw_fc_class  3            FC Class for Fabric                   True
      $
      
      If the fscsi child of the adapter port is not attached in switch mode, please note that since user_settable = False for that attribute, the attach attribute must have been changed by the Fibre Channel device driver as a result of changes external to the Power Systems server and can not be corrected using a chdev command. Rather, the external cause must be discovered and remedied. Once that is done, the setting of the attach attribute must be corrected using the following VIOS padmin command:
      cfgdev -dev fcs0
      

No comments:

Post a Comment