Coder Social home page Coder Social logo

Comments (3)

Madhan-SWE avatar Madhan-SWE commented on August 29, 2024

/assign

from ibm-powervs-block-csi-driver.

Madhan-SWE avatar Madhan-SWE commented on August 29, 2024

Explored SCSIs, LUNs, Disk Attachment Steps.

Currently we are using two methods to scan the newly attached disks.
Method 1: Rescanning the scsi bus by executing the script /usr/bin/rescan-scsi-bus.sh
Method 2: Rescanning the host scsi adapters one by one ex: echo "- - -" > /sys/class/scsi_host/host0/scan

Both of the above methods are used one after the other on NodeStageVolume Operation.
Rescanning the SCSI bus prints too many logs on the UI and some times hung executing which causes the infinite wait for NodeStageVolume.

Sample output

[root@madhan-1-kube-1-22-2 ~]# /usr/bin/rescan-scsi-bus.sh

Scanning host 0 for  SCSI target IDs  0 1 2 3 4 5 6 7, all LUNs
Scanning host 1 for  all SCSI target IDs, all LUNs
 Scanning for device 1 0 0 0 ...^M Scanning for device 1 0 0 0 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 00
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 1 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 01
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 3 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 03
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 10 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 10
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 11 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 11
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 12 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 12
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 13 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 13
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 14 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 14
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 15 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 15
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 16 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 16
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 17 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 17
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 18 ...
OLD: Host: scsi1 Channel: 00 Id: 00 Lun: 18
      Vendor: IBM      Model: 2145             Rev: 0000
      Type:   Direct-Access                    ANSI SCSI revision: 06
 Scanning for device 1 0 0 19 ...
................
................
................
................
................
................
0 new or changed device(s) found.
0 remapped or resized device(s) found.
0 device(s) removed.

Where as scanning the host adapters is faster and not printing anything on the terminal.
Which also does the same operation of scanning the new device on each host's scsi adapter.

Sample output

[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host3/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host4/scan

Conclusion
RescanSCSIBus can be removed and RescanSCSIHost Adapters can only be used

from ibm-powervs-block-csi-driver.

Madhan-SWE avatar Madhan-SWE commented on August 29, 2024

Created a disk and attached to the node from IBM Cloud.
Disk WWN: 60050768108181D628000000000048D8

Getting the disks by id:

[root@madhan-1-kube-1-22-2 powervs-csi-driver]# ls -lF /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root 10 Nov 20 00:08 dm-name-mpatha -> ../../dm-0
lrwxrwxrwx. 1 root root 11 Nov 20 00:08 dm-name-mpatha1 -> ../../dm-14
...
...
lrwxrwxrwx. 1 root root 10 Nov 20 00:08 dm-uuid-mpath-360050768108181d62800000000004027 -> ../../dm-0
lrwxrwxrwx. 1 root root 10 Nov 20 00:08 dm-uuid-mpath-360050768108181d628000000000044f3 -> ../../dm-8
...
...
lrwxrwxrwx. 1 root root 10 Nov 24 06:54 scsi-360050768108181d62800000000004027 -> ../../dm-0
lrwxrwxrwx. 1 root root 11 Nov 20 00:08 scsi-360050768108181d62800000000004027-part1 -> ../../dm-14
...
...
lrwxrwxrwx. 1 root root 11 Nov 20 00:08 wwn-0x60050768108181d62800000000004027-part1 -> ../../dm-14
lrwxrwxrwx. 1 root root 11 Nov 20 00:08 wwn-0x60050768108181d62800000000004027-part2 -> ../../dm-15

Disk with expected WWN not found.
Scanning the host adapter

[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host3/scan
[root@madhan-1-kube-1-22-2 ~]# echo "- - -" > /sys/class/scsi_host/host4/scan

Expected disk WWN found:

[root@madhan-1-kube-1-22-2 powervs-csi-driver]# ls -lF /dev/disk/by-id/
total 0
...
...
...
lrwxrwxrwx. 1 root root 11 Nov 24 06:54 wwn-0x60050768108181d628000000000048d8 -> ../../dm-41
...
...
...

from ibm-powervs-block-csi-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.