iSCSILogicalUnit uses default scsi sn of "(stdin)= "

Bug #1189643 reported by Sven Arnold
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
resource-agents (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Won't Fix
Undecided
Unassigned

Bug Description

According to its documentation iSCSILogicalUnit should generate a default scsi_id by using the first 8 bytes of an md5 hash of the resource name.

However, every created LUN gets the same id of "(stdin)= ".

Software versions:
================

Ubuntu Precise (12.04.2)

resource-agents 1:3.9.2-5ubuntu4.1
openssl 1.0.1-4ubuntu5.9
tgt 1:1.0.17-1ubuntu2

Steps to reproduce:
================

1) Create an iSCSI Target and one iSCSI LUN with crm
2) Display iSCSITarget configuration (e.g. tgtadm --mode target --op show):
3) Expected behaviour:
        LUN: 1
          Type: disk
          SCSI ID: <resource name>
          SCSI SN: <first 8 bytes of hash code>
3) Encountered behaviour:
        LUN: 1
          Type: disk
          SCSI ID: <resource name>
          SCSI SN: (stdin)=
4) Reason:
The code in /usr/lib/ocf/resource.d/heartbeat/iSCSILogicalUnit is not compatible with the shipped version of openssl:

# To have a reasonably unique default SCSI SN, use the first 8 bytes
# of an MD5 hash of of $OCF_RESOURCE_INSTANCE
sn=`echo -n "${OCF_RESOURCE_INSTANCE}" | openssl md5`
OCF_RESKEY_scsi_sn_default=${sn:0:8}
: ${OCF_RESKEY_scsi_sn=${OCF_RESKEY_scsi_sn_default}}

Recent versions of "openssl md5" have an output of:
"(stdin)= <digest>"

This is fixed in this commit upstream:
https://github.com/ClusterLabs/resource-agents/commit/05119e400fc5aedb8589c7e38dd3cd2d5c748057

I found this bug during testing of iSCSI and multipath failover which lead to filesystem corruptions. While I am not sure if this really is the root cause I would say, that the generation of a static scsi serial number which should be unique justifies a SRU.

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Thank you for taking the time to report this bug. In an effort to keep an
up-to-date and valid list of bugs to work on, I have reviewed this report
to verify it still requires effort and occurs on an Ubuntu release in
standard support, and it does not.

This is already fixed in Focal and Precise is EOL.

It is unfortunate that we were unable to resolve this defect, however
there appears to be no further action possible at this time. I am
therefore moving the bug to 'Won't fix'. If you disagree or have
new information, we would be grateful if you could please add a comment
stating why and then change the status of the bug to 'New'.

Changed in resource-agents (Ubuntu Precise):
status: New → Won't Fix
Changed in resource-agents (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.