How to remove all iscsi configuration.

4,846 views
Skip to first unread message

Ben Greear

unread,
Mar 9, 2009, 6:29:43 PM3/9/09
to open-...@googlegroups.com

Is there a clean way to remove all iSCSI configuration from
a system configured as initializers?

I was thinking maybe:

# On a Fedora system with the default iscsi rpms installed:
/etc/init.d/iscsi stop
rm -fr /var/lib/iscsi

When I start it again will it recreate directories as needed?

Thanks,
Ben

--
Ben Greear <gre...@candelatech.com>
Candela Technologies Inc http://www.candelatech.com

george joseph

unread,
Mar 9, 2009, 7:40:31 PM3/9/09
to open-...@googlegroups.com
Hi Ben,
 
Please try the following steps.
 
1) Log out from all the connected session.
 
2) Delete the entry using iscsiadm -m discovery --portal=IP address --op=delete
 
Regards
George

Ben Greear

unread,
Mar 9, 2009, 7:51:14 PM3/9/09
to open-...@googlegroups.com
george joseph wrote:
> Hi Ben,
>
> Please try the following steps.
>
> 1) Log out from all the connected session.
>
> 2) Delete the entry using iscsiadm -m discovery --portal=IP address
> --op=delete

Then it's safe to rm -fr the /var/lib/iscsi dir? I want to get
rid of all of the interface config and node config as well.

Something else I just hit: If I try to stop iscsi twice (without running
it in between), iscsiadm hangs trying to log out the second time..probably
because it can't connect to the iscsi daemons. Any clean fix for
this, or maybe just script it to look at the process listing and
don't call iscsiadm if no daemons are running?

Mike Christie

unread,
Mar 10, 2009, 7:13:37 PM3/10/09
to open-...@googlegroups.com
Ben Greear wrote:
>
> Is there a clean way to remove all iSCSI configuration from
> a system configured as initializers?
>

Not really.

> I was thinking maybe:
>
> # On a Fedora system with the default iscsi rpms installed:
> /etc/init.d/iscsi stop
> rm -fr /var/lib/iscsi
>

This is fine.

> When I start it again will it recreate directories as needed?
>

It will.

Mike Christie

unread,
Mar 10, 2009, 7:23:03 PM3/10/09
to open-...@googlegroups.com
Ben Greear wrote:
> george joseph wrote:
>> Hi Ben,
>>
>> Please try the following steps.
>>
>> 1) Log out from all the connected session.
>>
>> 2) Delete the entry using iscsiadm -m discovery --portal=IP address
>> --op=delete
>
> Then it's safe to rm -fr the /var/lib/iscsi dir? I want to get
> rid of all of the interface config and node config as well.
>
> Something else I just hit: If I try to stop iscsi twice (without running

For stop do you mean

service iscsi stop

Is this fedora? What version or what iscsi-initaitor-utils version?

> it in between), iscsiadm hangs trying to log out the second time..probably

It should not hang. I think it waits for a very long time :) (something
like two or four minutes).

This should be fixed in newer versions of open-iscsi so that we fail
quickly. It is in at F10 iscsi-initiator-utils-6.2.0.871-0.0.fc10 and
F9's iscsi-initiator-utils-6.2.0.871-0.0.fc10.

> because it can't connect to the iscsi daemons. Any clean fix for
> this, or maybe just script it to look at the process listing and
> don't call iscsiadm if no daemons are running?
>

Yeah, that would probably be nice to have too. What was happening before
is that iscsiadm would run and if it could not contact iscsid it would
retry for X seconds. Since iscsiadm needed iscsid for the command, we
modified iscsiadm to either start iscsid or have it fail quickly (assume
that you would have started iscsid so there is no need to every wait)
(the fix depends on the version of iscsi you are running).

Ben Greear

unread,
Mar 10, 2009, 7:40:00 PM3/10/09
to open-...@googlegroups.com

Ok. I was testing the initiator on FC8, so it could very well be fixed
already in newer releases. I wasn't waiting a full 2-4 minutes, too
impatient :)

I can work around this in my own code easily enough until we move
to newer OS releases.

Reply all
Reply to author
Forward
0 new messages