{"id":435,"date":"2017-11-28T17:09:54","date_gmt":"2017-11-28T22:09:54","guid":{"rendered":"http:\/\/www.hpux.ws\/?p=435"},"modified":"2017-11-28T17:09:54","modified_gmt":"2017-11-28T22:09:54","slug":"an-xpinfo-that-works-in-hpvm-guests-and-on-non-hitachi-storage","status":"publish","type":"post","link":"https:\/\/www.hpux.ws\/?p=435","title":{"rendered":"An xpinfo that works in hpvm guests and on non Hitachi storage"},"content":{"rendered":"<p>Hitachi shops faced annoyance times two:<br \/>\n1. xpinfo does not work on non-Hitachi storage for example Pure storage<br \/>\n2. xpinfo does not work on hpvm guests depending on how the storage is passed through from the hpvm host<\/p>\n<p>I now present xpinfonew which though raw and unfnished<br \/>\nThe output:<\/p>\n<p>myserv0:root > .\/xpinfonew<br \/>\nDevice path              ldev<br \/>\n==========================================================================<br \/>\n\/dev\/rdisk\/disk111       =:=<br \/>\n\/dev\/rdisk\/disk12        30:86<br \/>\n\/dev\/rdisk\/disk172       03:f3<br \/>\n\/dev\/rdisk\/disk215       46:2c<br \/>\n\/dev\/rdisk\/disk216       46:30<br \/>\n\/dev\/rdisk\/disk217       46:34<br \/>\n\/dev\/rdisk\/disk218       46:38<br \/>\n\/dev\/rdisk\/disk219       46:28<br \/>\n\/dev\/rdisk\/disk220       46:25<br \/>\n\/dev\/rdisk\/disk221       46:27<br \/>\n\/dev\/rdisk\/disk222       46:2a<br \/>\n\/dev\/rdisk\/disk223       46:2e<br \/>\n\/dev\/rdisk\/disk224       46:32<br \/>\n\/dev\/rdisk\/disk225       46:2b<br \/>\n\/dev\/rdisk\/disk226       46:2f<br \/>\n\/dev\/rdisk\/disk227       46:33<br \/>\n\/dev\/rdisk\/disk237       46:37<br \/>\n\/dev\/rdisk\/disk238       46:36<br \/>\n\/dev\/rdisk\/disk239       46:26<br \/>\n\/dev\/rdisk\/disk240       46:29<br \/>\n\/dev\/rdisk\/disk241       46:2d<br \/>\n\/dev\/rdisk\/disk242       46:31<br \/>\n\/dev\/rdisk\/disk243       46:35<br \/>\n\/dev\/rdisk\/disk244       46:39<br \/>\n\/dev\/rdisk\/disk4         aa:bf<br \/>\n\/dev\/rdisk\/disk5         8b:c3<br \/>\n\/dev\/rdisk\/disk6         03:a6<br \/>\n\/dev\/rdisk\/disk9         01:00<\/p>\n<p>myserv0:root > .\/xpinfonew raw<br \/>\nDevice path              ldev<br \/>\n==========================================================================<br \/>\n\/dev\/rdisk\/disk111       =<br \/>\n\/dev\/rdisk\/disk12        3086<br \/>\n\/dev\/rdisk\/disk172       03f3<br \/>\n\/dev\/rdisk\/disk215       462c<br \/>\n\/dev\/rdisk\/disk216       4630<br \/>\n\/dev\/rdisk\/disk217       4634<br \/>\n\/dev\/rdisk\/disk218       4638<br \/>\n\/dev\/rdisk\/disk219       4628<br \/>\n\/dev\/rdisk\/disk220       4625<br \/>\n\/dev\/rdisk\/disk221       4627<br \/>\n\/dev\/rdisk\/disk222       462a<br \/>\n\/dev\/rdisk\/disk223       462e<br \/>\n\/dev\/rdisk\/disk224       4632<br \/>\n\/dev\/rdisk\/disk225       462b<br \/>\n\/dev\/rdisk\/disk226       462f<br \/>\n\/dev\/rdisk\/disk227       4633<br \/>\n\/dev\/rdisk\/disk237       4637<br \/>\n\/dev\/rdisk\/disk238       4636<br \/>\n\/dev\/rdisk\/disk239       4626<br \/>\n\/dev\/rdisk\/disk240       4629<br \/>\n\/dev\/rdisk\/disk241       462d<br \/>\n\/dev\/rdisk\/disk242       4631<br \/>\n\/dev\/rdisk\/disk243       4635<br \/>\n\/dev\/rdisk\/disk244       4639<br \/>\n\/dev\/rdisk\/disk4         aabf<br \/>\n\/dev\/rdisk\/disk5         8bc3<br \/>\n\/dev\/rdisk\/disk6         03a6<br \/>\n\/dev\/rdisk\/disk9         0100<\/p>\n<p>cat xpinfonew<br \/>\n#!\/bin\/ksh<br \/>\n# Get ldev from any disk regardless of storage provider<br \/>\n#<br \/>\n# 10\/26\/2017 Steven &#8220;Shmuel&#8221; Protter steven.protter@hcl.com<br \/>\n#<\/p>\n<p>echo &#8220;Device path \\t\\t ldev &#8221;<br \/>\necho &#8220;==========================================================================&#8221;<\/p>\n<p>ioscan -NfnCdisk | awk &#8216;\/rdisk\/{ print $(NF) }&#8217; | awk -F_ &#8216;{ print $1 }&#8217;  | sort -u |while read -r dv<br \/>\ndo<br \/>\n  ldev=$(\/var\/adm\/bin\/getldev.ksh ${dv} ${1} );<br \/>\n  echo &#8220;${dv} \\t ${ldev}&#8221;<br \/>\ndone<\/p>\n<p>The code:<br \/>\ncat \/var\/adm\/bin\/getldev.ksh<br \/>\n#!\/bin\/ksh<br \/>\n# Get ldev from any disk regardless of storage provider<br \/>\n#<br \/>\n# 10\/26\/2017 Steven &#8220;Shmuel&#8221; Protter steven.protter@hcl.com<br \/>\n#<br \/>\nargies=$#<br \/>\nif [ $argies -eq 0 ]<br \/>\nthen<br \/>\n  echo &#8220;&#8212;&#8212;&#8212;&#8212; 1 argument required  device path ex: \/dev\/rdisk\/disk101 &#8212;&#8212;&#8212;&#8212;-&#8221;<br \/>\n  exit 1<br \/>\nfi<br \/>\ndv=$1<br \/>\nfmt=$2<br \/>\n## \/usr\/sbin\/scsimgr lun_map -D ${dv} | awk &#8216;\/World Wide Identifier\/{ print $(NF) }&#8217;<br \/>\nrldev=$(\/usr\/sbin\/scsimgr lun_map -D ${dv} | awk &#8216;\/World Wide Identifier\/{ print substr ( $NF, length($NF) &#8211; 3, length($NF) )  }&#8217;);<\/p>\n<p>l1=$(echo ${rldev} | awk &#8216;{ print substr ( $NF, length($NF) &#8211; 3, 2 )  }&#8217;);<br \/>\nl2=$(echo ${rldev} | awk &#8216;{ print substr ( $NF, length($NF) &#8211; 1, length($NF) )  }&#8217;);<\/p>\n<p>### echo &#8220;raw: ${rldev}  l1: ${l1} l2: ${l2} &#8230;&#8221;<br \/>\nif [ &#8220;$fmt&#8221; = &#8220;raw&#8221; ]<br \/>\nthen<br \/>\n  echo ${rldev}<br \/>\nelse<br \/>\n  echo &#8220;${l1}:${l2}&#8221;<br \/>\nfi<\/p>\n<p>Should work on any SAN based storage<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hitachi shops faced annoyance times two: 1. xpinfo does not work on non-Hitachi storage for example Pure storage 2. xpinfo does not work on hpvm guests depending on how the storage is passed through from the hpvm host I now present xpinfonew which though raw and unfnished The output: myserv0:root > .\/xpinfonew Device path ldev [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-435","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/435"}],"collection":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=435"}],"version-history":[{"count":0,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/435\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}