On 12-10-07 02:38 PM, Nicholas A. Bellinger wrote: > Hi Brian, Hi Nicholas, > On Sun, 2012-10-07 at 12:37 -0400, Brian J. Murrell wrote: >> I've exported some block devices to my initiators successful and the >> initiators can see their "serial number" as such: >> >> # scsi_id -g /dev/sde >> 3600140515ec87fad11c3d4a79daffbd3 >> # scsi_id -g /dev/sdf >> 3600140581c83070d4e69d4437db4ecdf >> # scsi_id -g /dev/sdd >> 3600140559468582d6b45d4db5d8fb5d5 > This is automatically done via uuid in rtslib/targetcli code at device > creation time, and can be optionally be disabled by passing > generate_wwn=false at creation time as well. I'm guessing rtslib/targetcli currently has no functionality to define this serial_id/wwn, correct? > Note the underlying configfs attribute lives for each backend under > /sys/kernel/config/target/core/$HBA/$DEV/wwn/vpd_unit_serial, so this > typically will be an new UUID to ensure world-wide uniqueness. The values I have under that configfs path don't seem to have any bearing on the value returned by scsi_id though: # cat /sys/kernel/config/target/core/*/*/wwn/vpd_unit_serial T10 VPD Unit Serial Number: 81c83070-4e69-4437-b4ec-f02f7e1a52fe T10 VPD Unit Serial Number: 15ec87fa-11c3-4a79-affb-31ecf91edc31 T10 VPD Unit Serial Number: 59468582-6b45-4db5-8fb5-557e934046b5 Perhaps I am misunderstanding what you are saying though. > One possible scenario to set vpd_unit_serial explicitly is when sharing > a single vpd_unit_serial across multiple target head-nodes representing > the same shared storage device for active/active or active/passive > operation. This is accomplished in rtslib python library code using > rtslib.tcm.StorageObject._set_wwn(), see: > > http://www.risingtidesystems.com/doc/rtslib-gpl/html/rtslib.tcm.StorageObject-class.html Yeah, so looking at this code, it seems that it just writes into the configfs path you mentioned above: if self.is_configured(): path = "%s/wwn/vpd_unit_serial" % self.path fwrite(path, "%s\n" % wwn) else: raise RTSLibError("Cannot write a T10 WWN Unit Serial to " + "an unconfigured StorageObject.") But what confuses me is why the value read from there doesn't seem to correspond to what scsi_id -g is returning on an initiator. Cheers, b.
Attachment:
signature.asc
Description: OpenPGP digital signature