Recently we provisioned a Windows Server 2016 to be a Windows File Server using Nimble Storage Volumes with iSCSI as the storage.
On a reboot I noticed that all the file shares disappeared. After Googling the problem I came up with this KB https://support.microsoft.com/en-us/kb/870964. The problem seemed to be that the `Server` service had come up before the `Microsoft iSCSI Initiator Service` and it was unable to see the files to share.
To confirm that this was the problem, the first thing was to restart the `Server` service. After a few seconds all the shares reappeared correctly.
Now to make the solution permanent I had to make the `Server` service be dependent on the `Microsoft iSCSI Initiator Service`, but since I use `Nimble Connection Manager` to establish connections to iscsi the solution was to make the `Server` service dependent on `Nimble Connection Manager`
Here are the steps:
Find the dependencies for `LanManServer` service using :
C:\Users\administrator>sc qc lanmanserver [SC] QueryServiceConfig SUCCESS SERVICE_NAME: lanmanserver TYPE : 20 WIN32_SHARE_PROCESS START_TYPE : 2 AUTO_START ERROR_CONTROL : 1 NORMAL BINARY_PATH_NAME : C:\Windows\System32\svchost.exe -k smbsvcs LOAD_ORDER_GROUP : TAG : 0 DISPLAY_NAME : Server DEPENDENCIES : SamSS : Srv2 SERVICE_START_NAME : LocalSystem
Under dependencies we have 2 services `SamSS`(Security Accounts Manager) and `Srv2`(Server SMB 2.xxx Driver). We need to add the `Nimble Connection Manager` to the dependencies. for that we use the command `sc config LanManServer depend=SamSS/Srv2/"Nimble Connection Service"` SamSS and Srv2 were already part of the dependencies, we just added the Nimble Connection Service.
C:\Users\administrator>sc config LanManServer depend=SamSS/Srv2/"Nimble Connection Service" [SC] ChangeServiceConfig SUCCESS
And that is it. You can reboot your server and confirm that the shares are available upon reboot.