From: Hannes Reinecke <hare@suse.de>
To: dm-devel@redhat.com
Cc: Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [PATCH] multipath: change default configuration parameters
Date: Thu, 17 Jan 2013 08:30:30 +0100 [thread overview]
Message-ID: <50F7A896.9040100@suse.de> (raw)
In-Reply-To: <1358371462.8351.18.camel@lapoo.opensvc.com>
[-- Attachment #1: Type: text/plain, Size: 2142 bytes --]
On 01/16/2013 10:24 PM, Christophe Varoqui wrote:
> On mar., 2013-01-15 at 23:14 +0100, Xose Vazquez Perez wrote:
> ...
>> scsi_id is going to be replaced in systemd(recently udev was
>> included in systemd).
>>
>> See sg_inq(--export option) from sg3_utils.
>
> We will need to patch sg_inq to report a denser id than the documented
> SCSI_IDENT_<assoc>_<type>=<ident>
>
Why? It took me ages to implement that one properly.
And it's only strings, which can be expanded at will.
Plus I have a set of udev rules mangling those into the usual ID_XXX
variables.
I don't see why we need to change that ...
> Time to launch a debate over the pertinence to maintain the '3' prefix
> scsi_id insisted on prepending to the wwids ... Lennart will take the
> blame without flinching I'm sure ;)
>
It's not '3'.
The '3' is the VPD designator ID as defined in the spec. And it's
attached there so that you can differentiate between several IDs,
which might be identical otherwise.
The original idea behind the prefix was that each ID has a different
level of 'uniqueness'.
Basically, there are 5 possible designator IDs for the LUN:
0: Vendor specific
1: T10 Vendor ID based
2: EUI-64 based
3: NAA
8: SCSI Name string
of which 0, 1, and 8 are basically arbitrary. We only have a
guaranteed unique ID when the designator is of type 2 or 3.
So prefixing the designator number allows you to figure out whether
it's a good idea for using that ID.
Mind you, that was when all was encoded in scsi_id.
Now that's all open-coded with udev rules you have different
variables for each ID, so it's easy to figure out.
But sorry, we can't change that.
Upgrade will be _HELL_ if you do that.
Btw, a patch to the udev rules is attached. It's not yet included in
the upstream sources as Kay and I are still discussing whether we
should split the original rule set.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
[-- Attachment #2: use-sg_inq-in-persistent-rules.patch --]
[-- Type: text/x-patch, Size: 3871 bytes --]
diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
index 1c4c2b2..a8377c6 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -38,17 +38,35 @@ KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="ata", IMPORT{program
# ATA devices using the "scsi" subsystem
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $tempnode"
# scsi devices
-KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi"
-KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss"
+KERNEL=="sd*[!0-9]|sr*", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_BUS}="scsi"
+KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="/usr/bin/sg_inq --export $tempnode", ENV{ID_BUS}="cciss"
+# Select which identifier to use per default
+# 1: NAA IEEE Registered Extended identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA}=="6*", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA}"
+# 2: NAA IEEE Registered identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA}=="5*", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA}"
+# 3: Unspecified NAA identfier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAA}=="?*", ENV{ID_SERIAL}="3$env{SCSI_IDENT_LUN_NAA}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAA}"
+# 4: EUI-64 identifer
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_EUI64}=="?*", ENV{ID_SERIAL}="2$env{SCSI_IDENT_LUN_EUI64}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_EUI64}"
+# 5: SCSI name identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_NAME}=="?*", ENV{ID_SERIAL}="8$env{SCSI_IDENT_LUN_NAME}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_NAME}"
+# 6: T10 Vendor identifer
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_T10}=="?*", ENV{ID_SERIAL}="1$env{SCSI_IDENT_LUN_T10}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_T10}"
+# 7: Vendor-specific identifier
+ENV{ID_SERIAL}!="?*", ENV{SCSI_IDENT_LUN_VENDOR}=="?*", ENV{ID_SERIAL}="0$env{SCSI_IDENT_LUN_VENDOR}", ENV{ID_SERIAL_SHORT}="$env{SCSI_IDENT_LUN_VENDOR}"
KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI_SERIAL}!="?*", IMPORT{program}="/usr/bin/sg_inq --export -p 0x80 $tempnode", ENV{ID_SCSI_SERIAL}="$env{SCSI_IDENT_SERIAL}"
+KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SCSI_SERIAL}!="?*", IMPORT{program}="/usr/bin/sg_inq --export -p 0x80 $tempnode", ENV{ID_SCSI_SERIAL}="$env{SCSI_IDENT_SERIAL}"
+
# firewire
KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
# scsi compat links for ATA devices
-KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d$tempnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", ENV{SCSI_IDENT_SERIAL}=="?*", ENV{ID_SCSI_COMPAT}="$env{SCSI_IDENT_SERIAL}", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2013-01-17 7:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-08 5:34 [PATCH] multipath: change default configuration parameters Benjamin Marzinski
2013-01-10 17:33 ` Xose Vazquez Perez
2013-01-15 21:02 ` Christophe Varoqui
2013-01-15 21:48 ` Xose Vazquez Perez
2013-01-16 20:42 ` Christophe Varoqui
2013-01-15 22:14 ` Xose Vazquez Perez
2013-01-16 21:24 ` Christophe Varoqui
2013-01-17 7:30 ` Hannes Reinecke [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F7A896.9040100@suse.de \
--to=hare@suse.de \
--cc=dm-devel@redhat.com \
--cc=kay.sievers@vrfy.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.