iscsiadm -m session
will show the currently connect sessions (iscsiadm -m session -P 3 will
show more info).
iscsiadm -m node -T target -p ip -u
will logout
iscsiadm -m node
will show the targets that have been discovered.
iscsiadm -m node -T target -p ip -l
will log into a target.
The logout command just logs the initiator out of the target which also
removes things like the /dev/sdXs. It does not remove things like node
db records. For that you need to run
iscsiadm -m node -o delete -T target -p ip
> 2) I tried the discovery command like so:
>
> iscsiadm -m discovery -t st -p 192.168.254.65
>
> But I'm not able to discover the iSCSI target. I keep getting the
> following error:
>
> iscsiadm: cannot make connection to 192.168.254.65:3260 (111)
> iscsiadm: connection to discovery address 192.168.254.65 failed
>
111 is connection refused. You probably do not have the initator in some
target ACL to allow access.
Well, not answering your question, but did you remember to change your initiator-ID (/etc/iscsi/initiatorname.iscsi) after cloning as well?
Maybe it's best to cleanup a master template before cloning. For your question something like "iscsiadm --op=delete" should do what you want.
Here (SLES10) it is "/sbin/iscsi-gen-initiatorname" (no manual page, a shell script).
Ulrich
I am not sure. What target are you using? You normally configure this on
the target. It is not a initiator setting.
I was rereading your original mail and did you write that this works for
the original but not the clones? If so then if you did not edit some
target ACL for the original initiator and that worked then you should
not have to do it for the clones.
Can you ping the target portal?
ping 192.168.254.65
Well,
maybe try something like "rpm -ql open-iscsi | grep -i initiator". The script says:
# Copyright (c) 2007 Hannes Reinecke, SUSE Linux Products GmbH.
# All rights reserved.
so it's probably part of SLES only.
The script uses /sbin/iscsi-iname to create a new initiator name unless on already exists. The lines to create that are
ISSUEDATE="1996-04"
INAME=$(/sbin/iscsi-iname -p iqn.$ISSUEDATE.de.suse:01)
printf "InitiatorName=$INAME\n" >>/etc/iscsi/initiatorname.iscsi
chmod 0600 /etc/iscsi/initiatorname.iscsi
I wonder whether the initiator-name is actually confidential (chmod). Also note that the iscsi-iname lacks a manual page and proper usage information (here):
# /sbin/iscsi-iname -h
Displays the iSCSI initiator name
#
Note that the description is actually a lie: It SUGGESTS a initiatorname, as can be seen from trying:
# /sbin/iscsi-iname
iqn.2005-03.org.open-iscsi:d4623acbe55
# /sbin/iscsi-iname
iqn.2005-03.org.open-iscsi:dd2051ef6ad2
Regards,
Ulrich