<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Use IQN string as device name in Linux with multipathing in Array Setup and Networking</title>
    <link>https://community.hpe.com/t5/array-setup-and-networking/use-iqn-string-as-device-name-in-linux-with-multipathing/m-p/6986845#M2067</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes it's difficult to know which device is which under Linux. Even more difficult when adding in the multipathing layer. This can all be remedied with a custom script and a few modifications to the multipath.conf file. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The multipath.conf file has a parameter for creating a custom callout script for naming and grouping devices. The default is to use the SCSI ID of the device. This is how multipathd knows which devices should be grouped together. This custom script will use the unique IQN string of the device which will make identifying the device later through device mapper much easier. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first step is to create a file /usr/local/sbin/iscsi_id.sh with the following content and set it as executable.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_13980911720811034 jive_text_macro jive_macro_code" jivemacro_uid="_13980911720811034"&gt;&lt;BR /&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ls -l /dev/disk/by-path/ | egrep iscsi | egrep "$1$" | sed -e 's/.*:\([a-z0-9.:-]*\).*/\1/'&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then modify the /etc/multipath.conf file with the getuid_callout variable on line 32 to point to the new script.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13980911720746696" jivemacro_uid="_13980911720746696" modifiedtitle="true"&gt;&lt;BR /&gt;&lt;P&gt;defaults {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; path_grouping_policy multibus&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; rr_min_io 20&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;blacklist {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; devnode "^hd[a-z][[0-9]*]"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; device {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor "*"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; product "*"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;blacklist_exceptions {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; device {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor "Nimble"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; product "Server"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;devices {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; device {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor "Nimble"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; product "Server"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path_selector "round-robin 0"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path_grouping_policy group_by_serial&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path_checker tur&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rr_min_io 20&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; failback manual&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rr_weight priorities&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; getuid_callout "/usr/local/sbin/iscsi_id.sh %n"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once these changes are in place listing /dev/mapper makes the time spent making this modification worth all the effort.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13980911720687239" jivemacro_uid="_13980911720687239"&gt;&lt;BR /&gt;&lt;P&gt;ls -l /dev/mapper/&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;total 0&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;crw------- 1 root root 10, 236 Dec 17 08:48 control&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;lrwxrwxrwx 1 root root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 Dec 17 13:28 mysql-clone-v16da9ef36265f874.000001dd.74bf6687-lun-0 -&amp;gt; ../dm-2&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;lrwxrwxrwx 1 root root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 Dec 17 13:28 mysql-clone-v16da9ef36265f874.000001dd.74bf6687-lun-0-part1 -&amp;gt; ../dm-3&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jan 2014 05:47:20 GMT</pubDate>
    <dc:creator>aherbert23</dc:creator>
    <dc:date>2014-01-07T05:47:20Z</dc:date>
    <item>
      <title>Use IQN string as device name in Linux with multipathing</title>
      <link>https://community.hpe.com/t5/array-setup-and-networking/use-iqn-string-as-device-name-in-linux-with-multipathing/m-p/6986845#M2067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes it's difficult to know which device is which under Linux. Even more difficult when adding in the multipathing layer. This can all be remedied with a custom script and a few modifications to the multipath.conf file. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The multipath.conf file has a parameter for creating a custom callout script for naming and grouping devices. The default is to use the SCSI ID of the device. This is how multipathd knows which devices should be grouped together. This custom script will use the unique IQN string of the device which will make identifying the device later through device mapper much easier. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first step is to create a file /usr/local/sbin/iscsi_id.sh with the following content and set it as executable.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_13980911720811034 jive_text_macro jive_macro_code" jivemacro_uid="_13980911720811034"&gt;&lt;BR /&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;ls -l /dev/disk/by-path/ | egrep iscsi | egrep "$1$" | sed -e 's/.*:\([a-z0-9.:-]*\).*/\1/'&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then modify the /etc/multipath.conf file with the getuid_callout variable on line 32 to point to the new script.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13980911720746696" jivemacro_uid="_13980911720746696" modifiedtitle="true"&gt;&lt;BR /&gt;&lt;P&gt;defaults {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; path_grouping_policy multibus&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; rr_min_io 20&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;blacklist {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; devnode "^hd[a-z][[0-9]*]"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; device {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor "*"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; product "*"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;blacklist_exceptions {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; device {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor "Nimble"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; product "Server"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;devices {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; device {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor "Nimble"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; product "Server"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path_selector "round-robin 0"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path_grouping_policy group_by_serial&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; path_checker tur&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rr_min_io 20&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; failback manual&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rr_weight priorities&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; getuid_callout "/usr/local/sbin/iscsi_id.sh %n"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once these changes are in place listing /dev/mapper makes the time spent making this modification worth all the effort.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13980911720687239" jivemacro_uid="_13980911720687239"&gt;&lt;BR /&gt;&lt;P&gt;ls -l /dev/mapper/&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;total 0&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;crw------- 1 root root 10, 236 Dec 17 08:48 control&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;lrwxrwxrwx 1 root root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 Dec 17 13:28 mysql-clone-v16da9ef36265f874.000001dd.74bf6687-lun-0 -&amp;gt; ../dm-2&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;lrwxrwxrwx 1 root root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 Dec 17 13:28 mysql-clone-v16da9ef36265f874.000001dd.74bf6687-lun-0-part1 -&amp;gt; ../dm-3&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 05:47:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/array-setup-and-networking/use-iqn-string-as-device-name-in-linux-with-multipathing/m-p/6986845#M2067</guid>
      <dc:creator>aherbert23</dc:creator>
      <dc:date>2014-01-07T05:47:20Z</dc:date>
    </item>
  </channel>
</rss>

