2012 R2 ISCSI (MSFT Virtual HD SCSI Disk Device) still visible after ISCSI Disconnected

justin pease 1 Reputation point
2021-04-15T13:16:16.507+00:00

Hi there i hope someone can help with this as its driving me crazy

i have a server with 3 ISCSI drives located on 3 different 2012 r2 servers

if i disconnect the first 2 drives by disabling the ISCSI target on the relevant storage servers the connection drops and the drives disappear from the server.

Our last drive for some reason always stays visible even after we have disabled the ISCSI target.

the drives are listed in windows as basic disks (GPT) and all have drive letters assigned to them, the first 2 the drive letters will disappear almost instantly yet the third stays visible.

All the servers are setup pretty much identical from what i can tell so i cannot work out why this last drive will not disconnect when the ISCSI is stopped

some background, we are trying to prevent issues in the future with data being written to the disks, what we want is for the drive to drop straight away so we can stop a third party service to prevent any further data attempting to be written to the disks. currently, because the drive doesn't drop Windows still thinks its there and tries to write to it but this then causes the system to hang until it times out, this will continuously keep happening for as long as Windows can see the disk.

i have noticed that on the first two drives, caching appears to be disabled and the third drive it is enabled, i assume this is the issue but i cannot disable caching, windows will not allow me but will not explain why or how to get round the issue.

this is being done on a test server at the moment but we hope to migrate this over to our live server one we have figured out how to resolve the issue.

if we run a disk rescan in disk manager when the connection has been disabled Windows will drop the connection straight away but i cant constantly keep rescanning the disks on the off chance a failure may occur so we really need to find a way to get Windows to disconnect the drive like it does with the other drives.

I have read so many different pages but none seem to help answer the issue.

Has anyone had this issue before or have any tricks in order to get windows to drop the drive if the ISCSI connection drops.

Any help would be greatly appreciated.

Jay

**Udpate - running a rescan with diskpart does not drop the drive afterall, it simply hangs the screen for an eternity

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. JiayaoZhu 3,926 Reputation points
    2021-04-16T07:47:56.827+00:00

    Hi,

    Thank you for your posting!

    Based on your descriptions, I suggest you to follow the next steps to troubleshoot your issue:

    1) Try to run the PowerShell command for disconnecting your target to see what will happen:

    https://learn.microsoft.com/en-us/powershell/module/iscsi/disconnect-iscsitarget?view=windowsserver2019-ps

    -- is there any error maeesges or codes coming up? If so, you can provide us with them to let us better help you troubleshoot your issue.

    2) Taking the disk offline in Disk Management first before disabling your target

    3) Disabling the Microsoft iSCSI Initiator device in Device Manager (requires a reboot)

    4) Check if you have removed the third target from 'Favorite Targets' and target portals in the iSCSI properties dialoge

    5) Stop the "MICROSOFT ISCSI INITIATOR SERVICE" from services MMC and make sure you're logged in as admin

    6) You can try to turn the computer off and on again you should be able to click disconnect and it may be work

    Thank you for your time!

    Best regards
    Joan


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. justin pease 1 Reputation point
    2021-04-16T09:00:45.847+00:00

    Hi Joan

    Thanks for your reply

    The issue we have here is we need this to disconnect automatically when the ISCSI Target drops.

    This is not a case of us just trying to remove it from Windows when we need to as we know we can do this via the ISCSI Initiator etc.

    The problem we have is if the ISCSI Target drops we have no way of knowing straight away so Windows will keep trying to write to the Targets but its unable to do so which causes lots of issues with the software we are using.

    We have a script that has been designed for us that checks the drives and stops a service if they become unavailable, this works on the majority of our ISCSI targets but this last one it cannot work out it has dropped as Windows still lists its connects for a very long time after the incident, this can then cause issues with the data thats trying to be written to the disks via the software we use.

    What we need is a way that the drive can be disconnected as soon or as very close as possible to when the target fails.

    In normal operation everything is running ok we just need to be able to take steps of a ISCSI Target fails at any point.

    I ran the PowerShell command against the target we need to disconnect after we had disabled it on the san and the PowerShell command just hangs until we re enable the target on the SAN, then drops the drive without issues, this doesn't help if the SAN or the Iscsi Target was to go offline that's our main problem.

    Jay

    0 comments No comments

  3. JiayaoZhu 3,926 Reputation points
    2021-04-16T09:34:00.873+00:00

    Hi,

    Thank you for your reply!

    1) I am getting a little confused that how could Windows keeps trying to write to the targets if there are no such targets? Can you provide me with more details such as error codes or messages in Event Viewer?

    2) I suppose your issue is kind of equivalent to that the deleted iscsi target remains on the list. It's possible you have multiple targets defined for the same target. Disconnecting from the target tab is not enough. Are you removing them from the favorite targets tab as well?

    Thank you for your time!

    Best regards
    Joan


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. justin pease 1 Reputation point
    2021-04-16T09:53:05.94+00:00

    Hi Joan

    ill try and explain a little further to see if this helps

    We have 4 2012 r2 servers.

    3 servers are storage servers and uses the Microsoft Iscsi Target to allow our 4th server to connect to the storage using Iscsi.

    On the 4th server we have Iscsi connections to each of the 3 storage servers ,1 iscsi drive on each server.

    The first 2 servers do not have caching enabled on the drives yet the third one does have it enabled, but we cannot turn it off, this may solve the issue if we could.

    Currently, if one of the first 2 servers goes offline the drives drop straight away from the 4th server, yet the 3rd server the drive stays "connected" in the 4th server even though the connection cannot be made, because it was connected before the server went offline it stays visible in the 4th server, if we try to write to the 3rd server drive it tries to write and hangs the system for a long time. the drive never drops.

    We only have one target listed for each connection to each of the storage servers, this is a test setup so we have only ever had a single connection to each server.

    ive reconnected the drive and made sure its not listed as a favourite but we have the same issue.

    Jay


  5. JiayaoZhu 3,926 Reputation points
    2021-04-21T07:41:47.05+00:00

    Hi,

    Thank you for your waiting!

    After our research, we suppose you have figured out the possible cause:

    "The first 2 servers do not have caching enabled on the drives yet the third one does have it enabled, but we cannot turn it off, this may solve the issue if we could."

    So, can you tell us more information about this caching issue? Why you cannot turn it off and was there any error messages or codes that appeared when you were trying to turn it off?

    Best regards
    Joan

    --------------------------------------------------------------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.