How to change an iSCSI target

832 views
Skip to first unread message

Mike

unread,
Jul 12, 2010, 10:52:05 AM7/12/10
to open-iscsi
I hope someone can help, I'm very new to Ubuntu 9.04. I currently have
a VM setup with Ubuntu 9.04 and running which is connected to an iSCSI
target. Everything works great on this VM. I've cloned this VM and I'm
trying to disconnect the current iSCSI target and reconnect it to a
new one but I'm having a lot of problems trying to get this to work.
Can someone point me in the right direction to figure out how I can
remove the current iSCSI and add a new one?

Thank you,

Mike

Mike Christie

unread,
Jul 12, 2010, 1:17:59 PM7/12/10
to open-...@googlegroups.com, Mike

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.

Mike

unread,
Jul 12, 2010, 1:18:41 PM7/12/10
to open-iscsi
Hi Mike,

Thank you very much for your reply. What I want to do is remove the
current iSCSI target the I had from my cloned VM and change it to a
new iSCSI target. Is the "logout" option the way to disconnect the
target or is that something else?

Thank you,

Mike

Mike

unread,
Jul 13, 2010, 10:08:24 AM7/13/10
to open-iscsi
Hi Mike,

Thank you for the quick reply. I have 2 questions if you don't mind
clarifying for me:

1) Is the "logout" option what disconnects the previous iSCSI target
or do I have to something else? I need to remove all references etc.
to the previous iSCSI target.

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

I have 2 nic cards setup on this box. One setup for internet access
which is working. The second nic is to the iSCSI. When I run the
command "lshw -c network" it shows that both nics are active and they
have the correct ip address assigned to them. Is there something else
that I need to cleanup or change somewhere to fix this because I
copied this VM from another working one?

Any help is appreciated.

Thank you,

Mike


On Jul 12, 1:17 pm, Mike Christie <micha...@cs.wisc.edu> wrote:

Mike Christie

unread,
Jul 13, 2010, 10:19:17 PM7/13/10
to open-...@googlegroups.com, Mike
On 07/13/2010 09:08 AM, Mike wrote:
> Hi Mike,
>
> Thank you for the quick reply. I have 2 questions if you don't mind
> clarifying for me:
>
> 1) Is the "logout" option what disconnects the previous iSCSI target
> or do I have to something else? I need to remove all references etc.
> to the previous iSCSI 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.

Ulrich Windl

unread,
Jul 14, 2010, 5:04:35 AM7/14/10
to open-iscsi
>>> Mike <michael...@gmail.com> schrieb am 13.07.2010 um 16:08 in Nachricht
<920d464c-9a0c-462c...@r27g2000yqb.googlegroups.com>:

> Hi Mike,
>
> Thank you for the quick reply. I have 2 questions if you don't mind
> clarifying for me:
>
> 1) Is the "logout" option what disconnects the previous iSCSI target
> or do I have to something else? I need to remove all references etc.
> to the previous iSCSI target.

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.

Mike

unread,
Jul 14, 2010, 9:20:41 AM7/14/10
to open-iscsi
Hi Mike/Ulrich,

Thank you for your input.

Mike, sorry I'm very new to all this so I apologize for not understand
what you said above. Where/How do I allow access for the initiator?

Ulrich I did change the initiator-ID manually. Can this be done
automatically after the clone? If so, how do I do that?

I appreciate your help.

Thank you,

Mike


On Jul 14, 5:04 am, "Ulrich Windl" <Ulrich.Wi...@rz.uni-regensburg.de>
wrote:
> >>> Mike <michaelaush...@gmail.com> schrieb am 13.07.2010 um 16:08 in Nachricht
>
> <920d464c-9a0c-462c-9d33-37a967be8...@r27g2000yqb.googlegroups.com>:

Ulrich Windl

unread,
Jul 14, 2010, 10:09:03 AM7/14/10
to open-iscsi
>>> Mike <michael...@gmail.com> schrieb am 14.07.2010 um 15:20 in Nachricht
<f1fcf0ec-8e2b-4a31...@w31g2000yqb.googlegroups.com>:

> Hi Mike/Ulrich,
>
> Thank you for your input.
>
> Mike, sorry I'm very new to all this so I apologize for not understand
> what you said above. Where/How do I allow access for the initiator?
>
> Ulrich I did change the initiator-ID manually. Can this be done
> automatically after the clone? If so, how do I do that?

Here (SLES10) it is "/sbin/iscsi-gen-initiatorname" (no manual page, a shell script).

Ulrich


Mike

unread,
Jul 14, 2010, 10:42:53 AM7/14/10
to open-iscsi
Hi Ulrich,

Thanks for the quick reply. Sorry, is this a script file in the /sbin/
folder? I checked there but I don't see one.

Thank you,

Mike

On Jul 14, 10:09 am, "Ulrich Windl" <Ulrich.Wi...@rz.uni-
regensburg.de> wrote:
> >>> Mike <michaelaush...@gmail.com> schrieb am 14.07.2010 um 15:20 in Nachricht
>
> <f1fcf0ec-8e2b-4a31-90e0-1e2b65ed2...@w31g2000yqb.googlegroups.com>:

Mike Christie

unread,
Jul 14, 2010, 10:57:06 AM7/14/10
to open-...@googlegroups.com, Mike
On 07/14/2010 08:20 AM, Mike wrote:
> Hi Mike/Ulrich,
>
> Thank you for your input.
>
> Mike, sorry I'm very new to all this so I apologize for not understand
> what you said above. Where/How do I allow access for the initiator?
>

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

Mike

unread,
Jul 14, 2010, 2:49:44 PM7/14/10
to open-iscsi
Hi Mike,

Yes, that is correct. The machine I cloned works perfectly with iSCSI
setup. I can ping the IP but just not able to discover it.

Thank you,

Mike

Ulrich Windl

unread,
Jul 15, 2010, 2:14:35 AM7/15/10
to open-iscsi
>>> Mike <michael...@gmail.com> schrieb am 14.07.2010 um 16:42 in Nachricht
<8a973c56-f9c9-4b78...@z8g2000yqz.googlegroups.com>:

> Hi Ulrich,
>
> Thanks for the quick reply. Sorry, is this a script file in the /sbin/
> folder? I checked there but I don't see one.

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

Mike

unread,
Jul 15, 2010, 3:38:24 PM7/15/10
to open-iscsi
Hi Mike/Ulrich,

Thanks for all your help. I've solved the issue. I had the iSCSI IP
address all wrong. That was the whole issue. Now everything works and
I'm able to discover the hardware. Thank you both for all the info
you've provided I really appreciate it.

Thank you,

Mike

On Jul 15, 2:14 am, "Ulrich Windl" <Ulrich.Wi...@rz.uni-regensburg.de>
wrote:
> >>> Mike <michaelaush...@gmail.com> schrieb am 14.07.2010 um 16:42 in Nachricht
>
> <8a973c56-f9c9-4b78-b709-3865ba61b...@z8g2000yqz.googlegroups.com>:
Reply all
Reply to author
Forward
0 new messages