we are using Windows Server 2012 R2 to provide some iSCSI targets for other servers. The server has a storage pool, and there is a virtual disk on top of that, and then an iSCSI target is created on this virtual disk.
However, after server restart, the target is always lost and the initiator cannot connect to this target. If I then restart the Microsoft iSCSI Software Target service (i.e. "WinTarget"), the target is initialized properly and works fine.
Since I believe this is a dependency issue, I tried setting the service startup to "Automatic (Delayed Start)", but it fails with an error ("The delayed start could not be set, parameter is incorrect").
Is this a known issue? I.e. if yes, how do I delay startup of this service?
Yes, this is a known issue. Unfortunately native Microsoft iSCSI Target is not something that can be put in production. It is slow, unstable, has limited performance and no caching etc. There are multiple free tools that a capable to provide you with a fast and reliable iSCSI target. We are using Starwind https://www.starwindsoftware.com/starwind-virtual-san-free for this purposes that provides iSCSI targets for ESX and Windows servers. Will solve your issues for sure.
Delayed Startup workaround (will work for any service/app):
Using the idea from this thread, credit to James Roper, I set the service startup type to Manual (this option works, unlike Delayed Start) and added a startup script (with a delay) to start the service, effectively getting a "delayed startup":
Manual
Create a file named
StartISCSI.CMD
somewhere, containing the following commands (WinTarget
is the name of the iSCSI Target Service):Create a scheduled task to run
StartISCSI.CMD
on startup (configured to start even if nobody is logged in).This is not exactly an answer to my question, but at least it's a workaround so it might be helpful to others until someone gives a better idea of why this isn't working properly.