IBM / ubiquity

Ubiquity
Apache License 2.0
90 stars 26 forks source link

UB-1835 new rescan and delete method #294

Closed 27149chen closed 5 years ago

27149chen commented 5 years ago

The purpose of this PR is to drop iscan-scsi-bus.sh, including:

Rescan

  1. using systool -c fc_host -v to get all the active fc hbas (host0, host1, ...)
  2. using echo "- - lunid" > /sys/class/scsi_host/host0/scan to scan each hba

Delete

  1. get all the multipath devices (sda, sdb, ...) of a volume from output of command multipath -ll
  2. using echo 1 > /sys/block/sda/device/delete to delete each device

The main change of this PR is adding three files:

  1. fibre_channel.go: The interface to talk with upper level, like RescanSCSI/DisconnectSCSI in blockDeviceUtils
  2. linuxfc.go: An adapter of lunx fc to get/san FC HBAs.
  3. linuxscsi.go: The base of linuxfc, has one common mothod "RemoveSCSIDevice"

It is a very lite version of os_brick.


This change is Reviewable

shay-berman commented 5 years ago

@27149chen - note : chmod-mountpoint branch is not related to this rescan PR, so there is no point to merge it inside this PR.