On 11/25/2010 10:10 AM, SZÉKELYI Szabolcs wrote:
Hi,

I'm trying to figure out how to do discovery with authentication, without
luck. I didn't manage to set up the credentials, tried various ways. Iscsiadm
says:

iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p
ip:port -I ifaceN ... [ -l ] ] | [ -p ip:port ] [ -o operation ] [ -n name ] [
-v value ]

Although:

$ sudo iscsiadm -m discovery -p myiscsistorage:3260 -o new -n \
     discovery.sendtargets.auth.username -v myusername
iscsiadm: discovery mode: option '-n' is not allowed/supported

It looks to me that the above syntax allows these options...


Yeah, the docs were wrong. You can pass the new operator to the discovery command like

iscsiadm -m discovery -t st -p ip -o new

to tell it to only create records for new portals, but you cannot update the discovery db.

It is sort of fixed in this release http://kernel.org/pub/linux/kernel/people/mnc/open-iscsi/releases/open-iscsi-2.0-872.tar.gz
You have to use discoverydb mode

// create a new record
iscsiadm -m discoverydb -p myiscsistorage:3260  -t st -o new
// update username and password
iscsiadm -m discoverydb -p myiscsistorage:3260 -t st -o update -n discovery.sendtargets.auth.username -v myusername

In the old tools you can also just edit iscsid.conf with the iscovery.sendtargets.auth.username and password then run the iscsiadm discovery command and it will use the iscsid.conf values.


So could you tell me how to do this?

Another thing: when I want to delete a discovery record from the database,
iscsiadm tells me

$ sudo iscsiadm -m discovery -o delete
iscsiadm: --record required for delete operation

However, I couldn't find --record anywhere in the man page. What is it
supposed to be?


When you run

iscsiadm -m discovery

it shows the discovery records. The ip:port is the record id that you pass into iscsiadm as the -p argument.

iscsiadm -m discovery
20.15.0.87:3260 via sendtargets
20.15.0.7:3260 via sendtargets
20.15.0.4:3260 via sendtargets


iscsiadm -m discovery -p 20.15.0.7:3260 -o delete

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

Reply via email to