Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iSCSILogicalUnit don't set the correct sn #1256

Open
colttt opened this issue Oct 25, 2018 · 1 comment · May be fixed by #1476
Open

iSCSILogicalUnit don't set the correct sn #1256

colttt opened this issue Oct 25, 2018 · 1 comment · May be fixed by #1476

Comments

@colttt
Copy link
Contributor

colttt commented Oct 25, 2018

Hello,
when I've multiple LUNs, the iSCSILogicalUnit-agent set only for the first LUN the correct sn, all others get a different one, I guess something is wrong in Line 419 or so. It looks like that only the first sn will be set correct, I add some echo's output to the iSCSILogicalUnit script:

diff /usr/lib/ocf/resource.d/heartbeat/iSCSILogicalUnit iSCSILogicalUnit.org
49,51d48
< echo "" >> /tmp/iscsilun_debug.log
< echo date >> /tmp/iscsilun_debug.log
< 
62d58
< echo ${OCF_RESOURCE_INSTANCE} >> /tmp/iscsilun_debug.log
64,65d59
< echo -n "die sn:  " >> /tmp/iscsilun_debug.log
< echo $sn >> /tmp/iscsilun_debug.log
68,69d61
< echo -n "die ocf_sn:  " >> /tmp/iscsilun_debug.log
< echo $OCF_RESKEY_scsi_sn >> /tmp/iscsilun_debug.log
417,418d408
<               echo -n "vor if reskey_sn:  " >> /tmp/iscsilun_debug.log
<               echo ${OCF_RESKEY_scsi_sn} >> /tmp/iscsilun_debug.log
421,422d410
<                       echo -n "in if schleife:  " >> /tmp/iscsilun_debug.log
<                       cat /sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial  >> /tmp/iscsilun_debug.log
447d434
<               echo "fertig ........................" >> /tmp/iscsilun_debug.log

the output is:

date
iscsi-lun0
die sn:  d0e5396557d77dc7ba590376f1bf5b0f
die ocf_sn:  d0e53965
vor if reskey_sn:  d0e53965
in if schleife:  T10 VPD Unit Serial Number: d0e53965
fertig ........................

date
iscsi-lun1
die sn:  db01ac2635d5fd02aa628af69b9542fc
die ocf_sn:  db01ac26
vor if reskey_sn:  db01ac26
in if schleife:  fertig ........................

date
iscsi-lun2
die sn:  0acb0780261a5de6f191831f74a13a80
die ocf_sn:  0acb0780
vor if reskey_sn:  0acb0780
in if schleife:  fertig ........................

(some other errors here but for quick and dirty its ok)
so I will look deeper into it

@colttt
Copy link
Contributor Author

colttt commented Oct 25, 2018

a new diff:

diff /usr/lib/ocf/resource.d/heartbeat/iSCSILogicalUnit iSCSILogicalUnit.org
49,51d48
< echo "" >> /tmp/iscsilun_debug.log
< date >> /tmp/iscsilun_debug.log
< 
62d58
< echo ${OCF_RESOURCE_INSTANCE} >> /tmp/iscsilun_debug.log
64,65d59
< echo -n "die sn:  " >> /tmp/iscsilun_debug.log
< echo $sn >> /tmp/iscsilun_debug.log
68,69d61
< echo -n "die ocf_sn:  " >> /tmp/iscsilun_debug.log
< echo $OCF_RESKEY_scsi_sn >> /tmp/iscsilun_debug.log
417,418d408
<               echo -n "vor if reskey_sn:  " >> /tmp/iscsilun_debug.log
<               echo ${OCF_RESKEY_scsi_sn} >> /tmp/iscsilun_debug.log
420,425c410
<                       echo -n "path is:   " >> /tmp/iscsilun_debug.log
<                       echo "/sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial" >> /tmp/iscsilun_debug.log
<                       ls /sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial >> /tmp/iscsilun_debug.log 2>&1
<                       echo ${OCF_RESKEY_scsi_sn} > /sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial >> /tmp/iscsilun_debug.log 2>&1
<                       echo -n "in if schleife:  " >> /tmp/iscsilun_debug.log
<                       cat /sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial  >> /tmp/iscsilun_debug.log
---
>                       echo ${OCF_RESKEY_scsi_sn} > /sys/kernel/config/target/core/iblock_${OCF_RESKEY_lio_iblock}/${OCF_RESOURCE_INSTANCE}/wwn/vpd_unit_serial
450d434
<               echo "fertig ........................" >> /tmp/iscsilun_debug.log

output:

Thu Oct 25 08:39:23 CEST 2018
iscsi-lun0
die sn:  d0e5396557d77dc7ba590376f1bf5b0f
die ocf_sn:  d0e53965
vor if reskey_sn:  d0e53965
path is:   /sys/kernel/config/target/core/iblock_0/iscsi-lun0/wwn/vpd_unit_serial
/sys/kernel/config/target/core/iblock_0/iscsi-lun0/wwn/vpd_unit_serial
d0e53965
in if schleife:  T10 VPD Unit Serial Number: b8133fc2-cebb-4455-8a33-1337b178bad3
fertig ........................

Thu Oct 25 08:39:24 CEST 2018
iscsi-lun1
die sn:  db01ac2635d5fd02aa628af69b9542fc
die ocf_sn:  db01ac26
vor if reskey_sn:  db01ac26
path is:   /sys/kernel/config/target/core/iblock_0/iscsi-lun1/wwn/vpd_unit_serial
ls: cannot access '/sys/kernel/config/target/core/iblock_0/iscsi-lun1/wwn/vpd_unit_serial': No such file or directory
in if schleife:  fertig ........................

Thu Oct 25 08:39:25 CEST 2018
iscsi-lun2
die sn:  0acb0780261a5de6f191831f74a13a80
die ocf_sn:  0acb0780
vor if reskey_sn:  0acb0780
path is:   /sys/kernel/config/target/core/iblock_0/iscsi-lun2/wwn/vpd_unit_serial
ls: cannot access '/sys/kernel/config/target/core/iblock_0/iscsi-lun2/wwn/vpd_unit_serial': No such file or directory
in if schleife:  fertig ........................

he dont use the correct iblock_number, so the variable ${OCF_RESKEY_lio_iblock} is wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant