Unable to delete old iSCSI target entry - "Target {name} is in use."

cofi-alan

Cadet
Joined
Jul 5, 2021
Messages
2
I have an iSCSI target that's no longer in use and want to remove it. I already deleted the associated target and extent entries, but for some reason I can't remove the target entry itself. I get the generic error "Target {name} is in use." I'm not sure what thinks it's in use, as VMware has been re-scanned and doesn't show a block device at the LUN anymore (and shouldn't since the extent was deleted). I rebooted the entire system during and upgrade and it didn't change. I'm not sure where it's stuck or what to check, nor if there's a way to force it to delete. Any thoughts?

I'm using TrueNAS 12.0-U4, and prior to the upgrade was on 12.0-RELEASE, on a custom server.

Thanks!

2021-07-05_11-25-21.gif
 

vtosevski

Cadet
Joined
Sep 25, 2021
Messages
3
Hi everyone,
Are there any thoughts on the above problem? I seem to have the same, just without any message. I am trying to delete a iSCSI target no longer in use. I could delete the extent associated with it, but can't remove the target itself. No initiator is connected to it. Is there something I can do with it?
OS Version: TrueNAS-12.0-U5.1
Model: ProLiant MicroServer Gen8
Thanks in advance!
 

vtosevski

Cadet
Joined
Sep 25, 2021
Messages
3
Hi everyone,
Are there any thoughts on the above problem? I seem to have the same, just without any message. I am trying to delete a iSCSI target no longer in use. I could delete the extent associated with it, but can't remove the target itself. No initiator is connected to it. Is there something I can do with it?
OS Version: TrueNAS-12.0-U5.1
Model: ProLiant MicroServer Gen8
Thanks in advance!
I was able to remove the target after having disconnected all other clients and switched off the iSCSI service. Not sure if this was expected but some sort of meaningful message while attempting to delete it initially would have been helpful.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Not sure if this was expected but some sort of meaningful message while attempting to delete it initially would have been helpful.

Like a message telling you that the device was still in use? :smile:
 

vtosevski

Cadet
Joined
Sep 25, 2021
Messages
3
Like a message telling you that the device was still in use? :smile:
The original question involved a message, I didn't have any message... :smile: and I am sure no device was using this particular target. I disconnected others just to gracefully kill the iSCSI service on the server. But duly noted :smile:
 

Surge

Cadet
Joined
Oct 26, 2021
Messages
1
For what it is worth, the iscsi service must be turned off in order to remove/delete the target.
 

cofi-alan

Cadet
Joined
Jul 5, 2021
Messages
2
I managed to solve this by accident during some planned major changes.

Even though the Extents and Associated Targets were gone it was true that the Targets were in use. Apparently the targets exist quite independent of the other two, and removing the various configurations doesn't shut down (break/kill) the targets. In the end, our ESXi hosts were still logged in to the targets even though every other piece was deleted and all storage has been rescanned multiple times in the past. I was able to manually remove all of the "old" Static Targets (originally added via dynamic discovery) from each ESXi host and then the TrueNAS targets were properly released and deletable.

tl;dr
If you ever had an iSCSI client connected to the TrueNAS server make sure to examine all of its target/path details to make sure it's totally disconnected from TrueNAS or else the targets will remain locked and in use.
 
Top