On 02/22/2013 03:48 PM,
phu...@solidfire.com wrote:
> Is there a way to override the default CHAP credentials in the
> iscsid.conf file when using iscsiadm to discover and login to an iSCSI
> target?
>
> I'd like to use iscsiadm to discover and login to targets from the same
> target portal as targets that have already been discovered, but with
> different CHAP credentials. I would like to specify a CHAP username for
> discovery and login that is different than the values in iscsid.conf
> (discovery.sendtargets.auth.username and node.session.auth.username).
> Is this possible?
Yes, if you have a newer version of iscsiadm. Does your version of
iscsiadm have a discoverydb mode? If so then for each discovery record
you can set a different discovery username and password.
// see the existing discoverydb records.
iscsiadm -m discoverydb
// See values for that record
iscsiadm -m discoverydb -t st -p ip
// set value
iscsiadm -m discoverydb -t st_or_whatever_discovery_type_it_was -p
ip_of_discovery_address -o update -n discovery.sendtargets.auth.username
-v usernameA
// do discovery using those values.
iscsiadm -m discoverydb -t st -p ip --discover
You can do the same for the password too.
>
> I can use the -u update -n node.session.auth.username -v newChapUsername
> options to update an existing node record but that's not really what I'm
> looking for.
>
> I tried to create a new node record but got the following error:
>
> # iscsiadm -m node -o new -n node.conn[0].address -v 10.10.10.11 -n
> node.conn[0].port -v 3260 -n
node.name -v iqn.2010-01.com.foo:1234
> /*No records added.*/
>
> Is it possible to create a new node record this way?
>
The format is:
iscsiadm -m node -o new -T iqn.2010-01.com.foo:1234 -p
10.10.10.11:3260,YOUR_TPGT_VALUE
See the iSCSI README for more info and examples.