[Stgt-devel] how to remove a disconnected target?

Tomasz Chmielewski mangoo
Wed May 14 13:59:44 CEST 2008


As mentioned before on the list, removing a target which has any initiators 
connected is currently not supported. Is there a workaround for that?

I tried offlining the target first, which caused the initiator to be 
disconnected, but "tgtadm --op show --mode target" erroneously shows that the 
initiator is connected.

Let's try to remove a target:

# tgtadm --op update --mode target --tid=2 -n state -v offline
# tgtadm --mode target --op delete --tid=2
tgtadm: this target unit is still active


After a while, the initiator will disconnect itself:

  connection52:0: detected conn error (1011)
sd 53:0:0:1: scsi: Device offlined - not ready after error recovery
sd 53:0:0:1: SCSI error: return code = 0x00020000
end_request: I/O error, dev sday, sector 128
Buffer I/O error on device sday, logical block 16
  connection52:0: iscsi conn_destroy(): host_busy 0 host_failed 0
PM: Removing info for No Bus:connection52:0
PM: Removing info for scsi:53:0:0:0
PM: Removing info for scsi:53:0:0:1
PM: Removing info for No Bus:session52
PM: Removing info for No Bus:host53
scsi 53:0:0:1: SCSI error: return code = 0x00010000
end_request: I/O error, dev sday, sector 128
Buffer I/O error on device sday, logical block 16


For about a minute or so, both the target and the initiator will show a 
TIME_WAIT for the connection (in netstat output), but soon, it will be gone.

Despite that, "tgtadm --op show --mode target" shows the initiator on the 
connection list. Why? Will it time out eventually?


-- 
Tomasz Chmielewski
http://wpkg.org



More information about the stgt mailing list