X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=input%2Fhowto%2Fexport-iscsi.creole;h=6d3b88ff8a3c577e10a7d703cdb49467aea1164c;hb=4748598a49ca95a8569fb7638db087e00821ddeb;hp=7a302a9700de7826330d564c054095dd543dcd02;hpb=7c590a9bc63e8cea2e0a5788bac01035f97f634e;p=mirror%2Fdsa-wiki.git diff --git a/input/howto/export-iscsi.creole b/input/howto/export-iscsi.creole index 7a302a9..6d3b88f 100644 --- a/input/howto/export-iscsi.creole +++ b/input/howto/export-iscsi.creole @@ -1,3 +1,7 @@ += Export iSCSI with gustini = +This document describes how to add new new volumes on gustini and add them into the OS. + +== via Web-Frontend == {{{ * Log into gustini via webfrontend * Manage @@ -19,5 +23,78 @@ iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --rescan + on dijkstra: add aliases to the wwids (show topology) - + on dijkstra: /etc/init.d/multipath-tools reload + + on dijkstra: service multipath-tools reload +}}} + +== via telnet interface == +{{{ +* Log into gustini via telnet +* create a new volume (eg berlioz-boot) on vdisk giustini-vdisk-1: + + create volume vdisk giustini-vdisk-1 size 256MB berlioz-boot + (there is a 'help create volume' command with lots of informations) +* find the next free LUN numbers on traetta: + + show host-maps traetta +* map the new volume to traetta.debian.org, LUN 12 + + map volume berlioz-boot lun 12 host traetta access rw + (again, there is a 'help map volume' command with lots of informations) + +* Run 'show host-maps $host' again, then, on the host, run: + convert_sn() { + local sn a b c d + sn="$1" + a="${sn%??????????????????????????}"; sn="${sn#??????}" + b="${sn%????????????????????}"; sn="${sn#??????}" + c="${sn%??????????????}"; sn="${sn#??????}" + d="$sn" + + if [ "${c#0000}" = "$c" ]; then + echo >&2 "sn has unexpected value ($1: $a - $b - $c - $d)" + return 1 + fi + + echo "36${a}000${b}${c#0000}${d}" + return 0 + } + + parse_volume() { + host=`hostname` + echo "Paste appropriate 'show host-maps $host' output line:" + read name sn id lun access channels + + if [ "$access" != "rw" ]; then + echo >&2 "Do not have rw access" + return 1 + fi + + if [ "$(echo -n "$sn" | wc -c)" != "32" ]; then + echo >&2 "Unexpected sn length in '$sn' (wanted 32 chars)" + return 1 + fi + + wwid=$(convert_sn "$sn") + + if [ -z "$wwid" ]; then + return 1 + fi + + echo "" + echo " multipath {" + echo " wwid $wwid" + echo " alias $name" + echo " }" + echo "" + + mp="$(multipath -ll $wwid)" + if [ -z "$mp" ]; then + echo >&2 "Warning: multipath does not know about $wwid" + return 1 + fi + + if ! echo "$mp" | grep -q ":$lun "; then + echo >&2 "Warning: Are you sure $wwid is lun $lun? multipath -ll disagrees" + return 1 + fi + } + + parse_volume }}}