Discovering SCSI Devices

The vhba module cooperates with the vsan module to discover any SCSI devices that are reachable from the vsan module's SCSI Initiator Port.

Each time the shared LDC channel resets, the vhba and vsan modules determine the maximum supported vHBA Protocol version. This version determines which algorithm to use to discover devices.

If the vhba and vsan modules use vHBA protocol Version 1.0, any attempt to replace a device fails so as to prevent data corruption of the new device.

If the vhba and vsan modules both support at least vHBA protocol Version 1.2, the vhba module permits the insertion of a new device at a previously used path. The kernel and the vhba module ensure that I/O sent to the path's old device are gracefully terminated. I/O that is sent to the path's new device successfully complete.

The following example command shows the path and metadata of LUN3 underneath the vhba@1 instance. The worldwide number (WWN) for LUN3 is presented in boldface:

# echo "::vhba -v" | mdb -k
...
vhba_t( 6400b4401900 ) vhba@1
  vhba_iport_t( 6400a6a0ce30 )
      vhba_tport_t( 6400b75cabb8 ) tport_phys(w200000110d211500) flags[COMMON]
...
      vhba_lun_t( 6400b75ca738 ) lun(3) vlun-id(6) wwn(naa.600110D000211500010900009DEB2585) [COMMON]
      devinfo(6400c3c631a8) scsi_device(6400c3c2b0c8) scsi_inquiry(6400c3a96640).inq_dtype(0=disk)
      /virtual-devices@100/channel-devices@200/scsi@1/iport@0/disk@w200000110d211500,3

If you replace the device at LUN3's path with a new device, that new device has a different WWN as shown in the following example command output:

      vhba_lun_t( 6400b75cbdb8 ) lun(3) vlun-id(12) wwn(naa.600110D0002115000109000065106D8A) [NEW]
      devinfo(6400c3c631a8) scsi_device(6400cce2a8e8) scsi_inquiry(6400d2cc3908).inq_dtype(0=disk)
      /virtual-devices@100/channel-devices@200/scsi@1/iport@0/disk@w200000110d211500,3

Note that the scsi@1/iport@0/disk@w200000110d211500,3 device path does not change when you replace the device. Only the WWN identity of the device changes.