On 05/12/2011 05:36 AM, Yuri Arabadji wrote:
Hi, maillist.

Newbie here. I'm struggling with open-iscsi automation tasks and got a
couple of questions I hope this maillist will be able to answer.

First of all, discovery&  co.

 From what I understood by digging available sparse docs, the proper
discovery and log in process should look like this:

==========================================
# get exported targets and portal's IP thingie
iscsiadm --mode discovery -p portal.com -t st
# update auth params
iscsiadm --mode node --targetname iqn.2011-04.com.portal:iscsi.target
--portal 1.2.3.4:3260,1  --op update -n node.session.auth.authmethod -
v CHAP
iscsiadm --mode node --targetname iqn.2011-04.com.portal:iscsi.target
--portal 1.2.3.4:3260,1  --op update -n node.session.auth.username -v
user
iscsiadm --mode node --targetname iqn.2011-04.com.portal:iscsi.target
--portal 1.2.3.4:3260,1  --op update -n node.session.auth.password -v
pass
# login
iscsiadm --mode node --targetname iqn.2011-04.com.portal:iscsi.target
--portal 1.2.3.4:3260,1  --login
# search for /successful/ in output
...
# logout&  delete discovered record
iscsiadm --mode node --targetname iqn.2011-04.com.portal:iscsi.target
--portal 1.2.3.4:3260,1  --logout
iscsiadm --mode discovery  -p portal.com --op delete
==========================================

Am I doing the right thing here, does this needs any adjustment?  It's

Yes. You can just add the auth settings to iscsid.conf if you just have one set of values for all sessions.

a pity the utility doesn't return proper exit code when it fails, for
ex. when auth is wrong and login fails - have to parse the output.

This is fixed in the git code and should be fixed in centos whevenever rhel 5.7 is released and centos clones it.


Next comes "working with disks" section. After successful initiator
login, blockdevs get attached and it's possible to work with them. But
the big question is: how do I map the established  session to specific
blockdevs?

For docs have you seen /usr/share/docs/iscsi-initiator-utils-%VERSION/README?

You can do

iscsiadm -m session -P 3


Right now, my solution is:
==========================================
# on target side
tgtadm  --op update --mode logicalunit --tid 1 --lun 1 --params
product_id="iSCSI DISK"
# on initiator side
devpath=$(ls -d $(dirname $(grep -l 'iSCSI DISK' /sys/class/scsi_disk/
*/device/model))/block*)
echo /dev/${devpath##*:}
==========================================
But this doesn't take into account multi-lun setups. Do I get it right
that LUN numbers are "mirrored" to initiator except for the channel
and IDs?

Will ask more questions as I move forward with this task. I'm on
centos 5.x latest and I'm trying to automate a couple of disk-related
things here which are needed for our virtualization, live migrations,
backups and such ;)

Thanks.


--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

  • automation Yuri Arabadji
    • Re: automation Mike Christie

Reply via email to