UNIX/Redhat

리눅스 WWN 보는..... 확실히 체크하는 방법

99iberty 2014. 4. 22. 08:50

일단 제 자체가 납득이 안 가서, 찾아보고 알려주는데요..ㅎㅎ
그동안은 막연히 fc_host 안에 있는 포트네임을 보내줬었는데..
/sys/class에 보면 scsi_host라고 따로 있어요.
fc_host라는게, 실제로 NIC도 fc통신을 하고, HBA도 저흰 fc통신 을 사용하죠.
전 해당 fc_host 에 PCI슬롯에 꽂혀 있는 NIC도 포함되는 건가 싶어서 헷갈렸었는데..
확실히 눈으로 확인될 수 있는게,
 
[root@XXXX pci0000:00]# lspci -m | grep -i hba
0e:00.0 "Fibre Channel" "QLogic Corp." "ISP2432-based 4Gb Fibre Channel to PCI Express HBA" -r03 "Hewlett-Packard Company" "Unknown device 7040"
15:00.0 "Fibre Channel" "QLogic Corp." "ISP2432-based 4Gb Fibre Channel to PCI Express HBA" -r03 "Hewlett-Packard Company" "Unknown device 7040"
 
일단 lspci 명령어는 pci슬롯에 꽂혀있는 하드웨어 장치를 모니터링하는 내용입니다.
해당 부분을 Ethernet으로 바꾸면 ethernet 카드 정보도 확인 가능해요.
(실제 쳐보면 온보드도 다 같이 뜨긴 뜨네요..)
 
실제 pci 슬롯에는 위와 같이 두개의 HBA가 꽂혀 있고, 앞의 숫자는 버스 번호 이거든요.
 
실제 scsi_host 와 fc_host에서 보이는 host들은.. scsi_host가 fc_host의 내용을 포함하고 있어요.
scsi_host에서 보면 호스트 들이 4개가 보이고 fc_host는 두개가 보이는데,
실제 scsi_host 안에 들어가 보면 심볼릭 링크로 fc_host 쪽으로 걸려 있어요.
 
 
[root@XXXX pci0000:00]# systool -c scsi_host -v
Class = "scsi_host"
  Class Device = "host0"
  Class Device path = "/sys/class/scsi_host/host0"
    cmd_per_lun         = "1"
    host_busy           = "0"
    proc_name           = "ata_piix"
    scan                = <store method only>
    sg_tablesize        = "128"
    state               = "running"
    uevent              = <store method only>
    unchecked_isa_dma   = "0"
    unique_id           = "1"
    Device = "host0"
    Device path = "/sys/devices/pci0000:00/0000:00:1f.2/host0"
      uevent              = <store method only>

  Class Device = "host1"
  Class Device path = "/sys/class/scsi_host/host1"
    cmd_per_lun         = "1"
    host_busy           = "0"
    proc_name           = "ata_piix"
    scan                = <store method only>
    sg_tablesize        = "128"
    state               = "running"
    uevent              = <store method only>
    unchecked_isa_dma   = "0"
    unique_id           = "2"
    Device = "host1"
    Device path = "/sys/devices/pci0000:00/0000:00:1f.2/host1"
      uevent              = <store method only>

  Class Device = "host2"
  Class Device path = "/sys/class/scsi_host/host2"
    84xx_fw_version     = ""
    beacon              = "Disabled"
    cmd_per_lun         = "3"
    driver_version      = "8.03.01.04.05.05-k"
    fabric_param        = "0"
    flash_block_size    = "0x10000"
    fw_state            = "0x4 0x262b 0x3100 0x6 0x0"
    fw_version          = "4.04.09 (486)"
    host_busy           = "0"
    isp_id              = "0000 0000 0000 0000"
    isp_name            = "ISP2432"
    max_npiv_vports     = "127"
    model_desc          = "PCI-Express 4Gb Fibre Channel HBA"
    model_name          = "HPAE311A"
    mpi_version         = ""
    npiv_vports_inuse   = "0"
    optrom_bios_version = "3.13"
    optrom_efi_version  = "2.22"
    optrom_fcode_version= "2.03"
    optrom_fw_version   = "5.03.15 1154"
    pci_info            = "PCIe (2.5Gb/s x4)"
    phy_version         = ""
    proc_name           = "<NULL>"
    scan                = <store method only>
    serial_num          = ""
    sg_tablesize        = "255"
    state               = "Link Down"
    total_isp_aborts    = "0"
    uevent              = <store method only>
    unchecked_isa_dma   = "0"
    unique_id           = "0"
    vlan_id             = ""
    vn_port_mac_address = ""
    vport_create        = <store method only>
    vport_delete        = <store method only>
    zio_timer           = "200 us"
    zio                 = "Disabled"
    Device = "host2"
    Device path = "/sys/devices/pci0000:00/0000:00:05.0/0000:15:00.0/host2"
      ct                  =
      els                 =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = <store method only>
      vpd                 = "‚!"

  Class Device = "host3"
  Class Device path = "/sys/class/scsi_host/host3"
    84xx_fw_version     = ""
    beacon              = "Disabled"
    cmd_per_lun         = "3"
    driver_version      = "8.03.01.04.05.05-k"
    fabric_param        = "0"
    flash_block_size    = "0x10000"
    fw_state            = "0x4 0x25d4 0x9100 0x6 0x0"
    fw_version          = "4.04.09 (486)"
    host_busy           = "0"
    isp_id              = "0000 0000 0000 0000"
    isp_name            = "ISP2432"
    max_npiv_vports     = "127"
    model_desc          = "PCI-Express 4Gb Fibre Channel HBA"
    model_name          = "HPAE311A"
    mpi_version         = ""
    npiv_vports_inuse   = "0"
    optrom_bios_version = "3.13"
    optrom_efi_version  = "2.22"
    optrom_fcode_version= "2.03"
    optrom_fw_version   = "5.03.15 1154"
    pci_info            = "PCIe (2.5Gb/s x4)"
    phy_version         = ""
    proc_name           = "<NULL>"
    scan                = <store method only>
    serial_num          = ""
    sg_tablesize        = "255"
    state               = "Link Down"
    total_isp_aborts    = "0"
    uevent              = <store method only>
    unchecked_isa_dma   = "0"
    unique_id           = "1"
    vlan_id             = ""
    vn_port_mac_address = ""
    vport_create        = <store method only>
    vport_delete        = <store method only>
    zio_timer           = "200 us"
    zio                 = "Disabled"
    Device = "host3"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:0e:00.0/host3"
      ct                  =
      els                 =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = <store method only>
      vpd                 = "‚!"
 
보면 host0, 1은 현재 state가 running 이고(로컬 디스크), 2,3 은 link down이죠.
버스 번호도 같음을 확인 할 수 있습니다..
 
그러므로 fc_host 에 있는 내용이 PCI슬롯에 꽂혀 있는 HBA 이니까... 맘 놓고 써도 되요.
 
참고로 인터넷 카드의 경우에는
/sys/class/net 아래에 정보가 다 있습니다~