iSCSI: how to remove and add host target

There are times at certain environment that the supposed to be fixed IP Address
of the shared storage have to change.
Althought ,am having difficulties to contemplate the reality that it actually changed twice!

so, from the earlier on, the factory setting is something like
then goes to another set of “fixed” IP Address.
And now the third round of this..

the result, whenever this one changed.. all the client trying to attach to this
particular iSCSI storage, it need to probe for new IP.
And as past IP setting .. it was saying “portal unreachable”..
in this case only one out of two setting is up.
resulting a failure in status.. the storage not mounted..

[root@node1~]# /etc/init.d/iscsi restart
Stopping iSCSI daemon: 
iscsid dead but pid file exists                            [  OK  ]
Starting iSCSI daemon:                                     [  OK  ]
                                                           [  OK  ]
Setting up iSCSI targets: Logging in to [iface: default, target:, portal:,3260]
Login to [iface: default, target:, portal:,3260]: successful
 Logging in to [iface: default, target:, portal:,3260]
Login to [iface: default, target:, portal:,3260]: failure
                                                           [  FAILED  ]

so, the question.. how to remove those invalid target ?
Here is how to delete old target.
replace the ip with the old IP setting.

iscsiadm -m node -p --op=delete

to add the new one ..

iscsiadm -m discovery -t sendtargets -p

after that tweak the udev rules ..

vi /etc/udev/rules.d/buffalo.rules

type the following content to it..

  KERNEL=="sd*", SUBSYSTEMS=="scsi", ATTRS{model}=="VIRTUAL-DISK", SYMLINK+="usbhd%n

so.. it would sym-link the iSCSI drive to

udevcontrol reload_rules
# restart iscsi..
/etc/init.d/iscsi restart 

see the new dev ..

shall had something like this..

ll /dev
lrwxrwxrwx 1 root root          3 Dec 22 23:02 usbhd -> sdb
lrwxrwxrwx 1 root root          4 Dec 22 23:02 usbhd1 -> sdb1

which later can be used by cluster suite to mount /dev/usbhd1 to something like /data
which is transparent/similar on both nodes regardless it had the USB drive/dongle or anything connected to its
system at the same time.

Related Post

2 Responses

  1. namran says:

    this would then make this app as ..

    the best yahoo messenger for centos

    .. after pidgin.. hehehe 😎

    as it had supersede the pidgin capabilities to perform
    some additional task which is not available in pidgin..

    may be you had been using other messenger..
    kindly post your comment in the form below ..

    p/s : don’t shoot the messenger..

  2. arlie_bcx says:

    I did the steps above but got this message while installing:

    warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6

    GPG key retrieval failed: [Errno 5] OSError: [Errno 2] No such file or directory: ‘/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL’

    I’m using CentOS 5.6


Leave a Reply

Your email address will not be published. Required fields are marked *