Re: Can you override the iscsid.conf CHAP credentials on the iscsiadm command line?

327 views
Skip to first unread message

Don Williams

unread,
Feb 25, 2013, 1:30:19 PM2/25/13
to open-...@googlegroups.com
Hello,

  In your example, you're not actually discoverying a target, AFAIK, you don't create blank records w/o target info.

 I believe the proper way is to add the update changes during the discovery request.

 -m discovery --type=[type] --interface=iscsi_ifacename \
			--portal=[ip:port] --login --print=[N] \
			--op=[op]=[NEW | UPDATE | DELETE | NONPERSISTENT]
                          perform [type] discovery for target portal with
                          ip-address [ip] and port [port].

			  This command will not use the discovery record
			  settings. It will use the iscsid.conf discovery
			  settings and it will overwrite the discovery
			  record with iscsid.conf discovery settings if it
			  exists. By default, it will then remove records for
			  portals no longer returned. And,
			  if a portal is returned by the target, then the
			  discovery command will create a new record or modify
			  an existing one with values from iscsi.conf and the
			  command line.

			  [op] can be passed in multiple times to this
			  command, and it will alter the DB manipulation.

			  If [op] is passed in and the value is
			  "new", iscsiadm will add records for portals that do
			  not yet have records in the db.

			  If [op] is passed in and the value is
			  "update", iscsiadm will update node records using
			  info from iscsi.conf and the command line for portals
			  that are returned during discovery and have
			  a record in the db.


Regards,

 Don

On 02/22/2013 04: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?

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?

Thanks!

--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+...@googlegroups.com.
To post to this group, send email to open-...@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mike Christie

unread,
Feb 25, 2013, 1:41:33 PM2/25/13
to open-...@googlegroups.com, phu...@solidfire.com
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.
Reply all
Reply to author
Forward
0 new messages