[CentOS] working with multiple password protected iSCSI targets on one host

Fri Feb 18 02:20:16 UTC 2011
Dr. Ed Morbius <dredmorbius at gmail.com>

on 17:11 Tue 15 Feb, Santi Saez (santisaez at woop.es) wrote:
> El 15/02/2011 14:54, Rudi Ahlers escribió:
> 
> Hi Rudi,
> 
> > How do I setup multiple password protected iSCSI targets on Linux?
> >
> > (..)
> >
> > But, now I need to mount another iSCSI target, from a different SAN
> > that has a different username&  password than whan I have configured
> > here for the one already mounted.
> >
> > How do I tell iscsiadm which CHAP settings to use with which iSCSI target?
> 
> I think there is not elegant way to do this.. I follow those steps:

Only if all CHAP auth is the same for all targets, in which case you can
specify the user/pass pairs in /etc/iscsi/iscsid.conf

Otherwise, you have to configure individual targets via iscsiadm.

I like your use of environment variables to specify targets and portals
(though I believe the default port is used if unspecified).  I'd arrived
at the same convention myself.

And though I'd turned up the authmethod assignment method somewhere, I
can't for the life of me remember where -- neither the
iscsi-initiator-utils document (README) nor the iscsiadm manpage seem to
address this -- they're otherwise pretty good.

Nice docs.
 
> 1) Set discovery.sendtargets.{auth,password} in iscsid.conf for target-1 
> + restart iscsid service.
> 
> 2) Set CHAP settings for target-1 + connect:
> 
> # iscsiadm -m node --targetname ${TARGETNAME1} -p ${PORTAL1} -o update 
> -n node.session.auth.username -v ${USERNAME}
> # iscsiadm -m node --targetname ${TARGETNAME1} -p ${PORTAL1} -o update 
> -n node.session.auth.password -v ${PASSWORD}
> # iscsiadm -m node --targetname ${TARGETNAME1} -p ${PORTAL1} -l
> 
> 3) Disconnect from target-1:
> 
> # iscsiadm -m node --logoutall all
> 
> 4) Set discovery.sendtargets.{auth,password} in iscsid.conf for target-2 
> + restart iscsid service.
> 
> 5) Set CHAP settings for target-2 + connect:
> 
> # iscsiadm -m node --targetname ${TARGETNAME2} -p ${PORTAL2} -o update 
> -n node.session.auth.username -v ${USERNAME}
> # iscsiadm -m node --targetname ${TARGETNAME2} -p ${PORTAL2} -o update 
> -n node.session.auth.password -v ${PASSWORD}
> # iscsiadm -m node --targetname ${TARGETNAME2} -p ${PORTAL2} -l
> 
> It works! Now you can login/logout in both iSCSI targets:
> 
> # iscsiadm -m node --logoutall all
> # iscsiadm -m node --loginall all
> 
> Cheers,
> 
> --
> Santi Saez
> http://woop.es
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

-- 
Dr. Ed Morbius, Chief Scientist /            |
  Robot Wrangler / Staff Psychologist        | When you seek unlimited power
Krell Power Systems Unlimited                |                  Go to Krell!