locked
My Windows 2012 ISCSI Target service needs to be restarted every time the server starts. RRS feed

  • Question

  • Every time I restart my Windows 2012 server, the ISCSI Target Service is unavailable to the clients even though it appears to be running.
    I have to restart the service, then the clients can connect to it. 
    I tried to change the startup Type to Delayed, but I get an error 87: parameter is incorrect.
    I've tried to delete and recreate the VHD and ISCSI Target.
    I've tried to uninstall the Role, and reinstall it. 

    Anybody have any additional ideas to try and troubleshoot this?

    Thank you
    James Roper

    Wednesday, May 8, 2013 11:22 PM

Answers

  • So basically the service is starting too soon and somehow is freaking out. For whatever reason, you can not tell the Microsoft iSCSI Software Target to Delay Automatic Start. 

    I got around the problem with the following steps:

    1. Setting the Microsoft iSCSI Software Target Service to Manual
    2. Create a CMD File StartISCSI.CMD
      timeout 60
      net start WinTarget
    3. Created a task to run StartISCSI.CMD on startup
    4. Configured the task to start even if nobody is logged on yet.

    Now the ISCSI Target starts up on its own without any user intervention

    James



    Wednesday, May 15, 2013 9:34 PM

All replies

  • Can you connect in a loopback? Does it reject ALL of the connections or only LAN ones? What's initiator is telling on attempt to connect?

    StarWind iSCSI SAN & NAS

    Thursday, May 9, 2013 12:33 PM
  • The service is not starting correctly, even though it does start. If I restart the service, everything works correctly. Here is the event in the ISCSI Target. 

    Log Name:      Microsoft-Windows-iSCSITarget-Service/Admin
    Source:        Microsoft-Windows-iSCSITarget-Service
    Date:          5/8/2013 3:11:10 PM
    Event ID:      10
    Task Category: None
    Level:         Error
    Keywords:      
    User:          SYSTEM
    Computer:      SRV-ISCSI1
    Description:
    The Microsoft iSCSI Software Target service could not bind to network address 10.5.4.31, port 3260. The operation failed with error code 10049. Ensure that no other application is using this port.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-iSCSITarget-Service" Guid="{13953C6E-C594-414E-8BA7-DEB4BA1878E3}" />
        <EventID>10</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8000000000000000</Keywords>
        <TimeCreated SystemTime="2013-05-08T22:11:10.899843800Z" />
        <EventRecordID>38</EventRecordID>
        <Correlation />
        <Execution ProcessID="976" ThreadID="1448" />
        <Channel>Microsoft-Windows-iSCSITarget-Service/Admin</Channel>
        <Computer>SRV-ISCSI1</Computer>
        <Security UserID="S-1-5-18" />
      </System>
      <EventData>
        <Data Name="IpAddress">10.5.4.31</Data>
        <Data Name="dwPort">3260</Data>
        <Data Name="Error">10049</Data>
      </EventData>
    </Event>

    Thursday, May 9, 2013 4:50 PM
  • I tried to change the port to 3261:

    Set-IscsiTargetServerSetting -IP 10.5.4.31 -Port 3261

    I get the same error with the new port number:

    The Microsoft iSCSI Software Target service could not bind to network address 10.5.4.31, port 3261. The operation failed with error code 10049. Ensure that no other application is using this port.

    Thursday, May 9, 2013 9:46 PM
  • Oh, that's easy. I guess you run multiple software using iSCSI ports. From a combination 3260 and 3261 I'm pretty sure it's my own company one :) You can either make Microsoft use other iSCSI port (say 4000) or check within "Programs" what apps do you have and if you run StarWind you can change default ports for it. Then you'll have all your software co-existing on the same box just fine. Just in case (if it's StarWind):

    http://www.starwindsoftware.com/forums/starwind-f5/change-default-network-port-3260-t2754.html

    Hope this helped :) And sorry for possible confusion...


    StarWind iSCSI SAN & NAS

    Friday, May 10, 2013 12:31 AM
  • Thank you for your response

    I am not running a second ISCSI Target or multiple ports. I just tried a different port and I am getting the same error. 

    I have only 1 Target with 1 Virtual hard disk. 

    The box is 100% Windows Server 2012. No other product has been installed on the box. 

    Monday, May 13, 2013 5:10 PM
  • Thank you for your response

    I am not running a second ISCSI Target or multiple ports. I just tried a different port and I am getting the same error. 

    I have only 1 Target with 1 Virtual hard disk. 

    The box is 100% Windows Server 2012. No other product has been installed on the box. 

    So the port 3261 is used by somebody else. Pick up free one. 

    netstat -anop tcp

    run in a command prompt will list used ports bind to your local IPs. Select free port and configure your Windows built-in iSCSI target using it.


    StarWind iSCSI SAN & NAS

    Monday, May 13, 2013 8:43 PM
  • Both ports are free. The error is wrong.
    Monday, May 13, 2013 10:05 PM
  • So basically the service is starting too soon and somehow is freaking out. For whatever reason, you can not tell the Microsoft iSCSI Software Target to Delay Automatic Start. 

    I got around the problem with the following steps:

    1. Setting the Microsoft iSCSI Software Target Service to Manual
    2. Create a CMD File StartISCSI.CMD
      timeout 60
      net start WinTarget
    3. Created a task to run StartISCSI.CMD on startup
    4. Configured the task to start even if nobody is logged on yet.

    Now the ISCSI Target starts up on its own without any user intervention

    James



    Wednesday, May 15, 2013 9:34 PM
  • Hello!

    I'm experiencing exactly the same issue with my Windows Server 2012 R2 iSCSI target with the only exception: this error ("The Microsoft iSCSI Target Server service could not bind to network address 10.1.1.3, port 3260. The operation failed with error code 10049. Ensure that no other application is using this port.") does NOT prevent users from connecting to VMs deployed on this target.

    I'd like to hear from MS whether this resolution (create a cmd file) is the only way to resolve the issue?

    Thank you in advance,

    Michael

    Wednesday, June 25, 2014 7:39 AM
  • Just as a note, I am still experiencing this issue on various different servers, even on ones I just created. The service appears running, but the clients cannot connect, and I just have to write a script to shutdown the service and start it when starting up. I am surprised this bug has not been addressed. 
    Tuesday, September 9, 2014 10:56 PM
  • So basically the service is starting too soon and somehow is freaking out. For whatever reason, you can not tell the Microsoft iSCSI Software Target to Delay Automatic Start. 

    I got around the problem with the following steps:

    1. Setting the Microsoft iSCSI Software Target Service to Manual
    2. Create a CMD File StartISCSI.CMD
      timeout 60
      net start WinTarget
    3. Created a task to run StartISCSI.CMD on startup
    4. Configured the task to start even if nobody is logged on yet.

    Now the ISCSI Target starts up on its own without any user intervention

    James



    Thanks James for taking away my headache!

    Regards, Ilkin

    Thursday, December 10, 2015 5:28 PM
  • I essentially did the same thing, but I did it without creating and having to worry about a batch file...

    Here is the Export of Scheduled Task:

    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Date>2016-03-11T17:58:47.9924646</Date>
        <Author>%Domain%\%UserName%</Author>
      </RegistrationInfo>
      <Triggers>
        <BootTrigger>
          <ExecutionTimeLimit>PT10M</ExecutionTimeLimit>
          <Enabled>true</Enabled>
          <Delay>PT1M</Delay>
        </BootTrigger>
      </Triggers>
      <Principals>
        <Principal id="Author">
          <UserId>S-1-5-18</UserId>
          <RunLevel>LeastPrivilege</RunLevel>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>false</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>true</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
        <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
        <Priority>7</Priority>
        <RestartOnFailure>
          <Interval>PT5M</Interval>
          <Count>999</Count>
        </RestartOnFailure>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>cmd.exe</Command>
          <Arguments>/c "sc start WinTarget"</Arguments>
        </Exec>
      </Actions>
    </Task>

    Its kind of BS that we have to do this, hope it is improved in 2016... :/ I just put %domain%\%username% in here to pull my info out, you will need to put in your own info..

    Thanks,

    Brian


    • Edited by B Gleason Saturday, March 12, 2016 12:08 AM Minor Note
    Saturday, March 12, 2016 12:06 AM
  • Is this something that Microsoft supports and allows? Why it the Start Mode "Auto (Delayed)" not offered by Microsoft for Storage Server 2012?
    Thursday, February 1, 2018 11:00 AM
  • How can this task be imported to MS Storage Server 2012?
    Thursday, February 1, 2018 11:02 AM