Search code examples
windowscommandiscsi

Failed to logout of iscsi target using iscsicli TargetLogout in Windows


I used iscsicli commands to configure the iscsi configuration for windows. When i logged out of target, it is happening successfully. But when i am rebooting my system again i can see those previously configure iscsi details. And also i am not able to use the "RemoveTarget" or any "persistant" related commands.


Solution

  • There is a difference between targets that were added manually (addtarget), and those that were added via discovery. For the latter, you need to remove the target portal, then refresh the list of targets. You can see the list of target portals with:

    iscsicli listtargetportals
    

    It's likely your target is listed here. Remove it with the following command (this example is for 172.16.1.1):

    iscsicli RemoveTargetPortal 172.16.1.1 3260
    

    Then rebuild the list of targets (with "t" to force update):

    iscsicli listtargets t
    

    Another possibility: There are also persistent or "favorite targets", which you can view with

    iscsicli listpersistenttargets
    

    The command line to remove these is very complex. You may have better luck using the iSCSI Initiator GUI application (iscsicpl), and removing them manually from under the "Favorite Targets" tab.

    Reference: http://www.mombu.com/microsoft/windows-storage/t-iscsicli-problems-removing-targets-350229.html