Working with Windows Server 2016 Server Core is a bit more difficult than working with the GUI enabled version of Windows Server. Also, with Windows Server 2016 Microsoft has removed the ability to go back from GUI to Server Core, so you must stick with one or the other, which means we are either installing Core or GUI and not thinking about switching between. In thinking about a production Hyper-V environment, Server Core minimizes footprint and increases on the security posture of your infrastructure. Let’s take a look at how to Add iSCSI target Windows Server 2016 Hyper-V Core.
Add iSCSI target Windows Server 2016 Hyper-V Core
To begin with, we need to set the Microsoft Windows iSCSI service to automatic and then start the service. To do that we run the following commands:
set-service -name msiscsi -startuptype automatic start-service msiscsi
Now with the iSCSI service up and running and configured to start automatically, let’s add our portal address and then we can add our iSCSI targets. To add a new target portal address from a PowerShell command prompt, we run the new-iscsitargetportal command.
new-iscsitargetportal -TargetPortalAddress <targetIP>
Next, we can add the target iqn names for the target portal. For that we run the connect-iscsitarget command.
Connect-IscsiTarget -nodeaddress iqn.2005-10.org.freenas.ctl:hvvol1 -IsPersistent $true -IsMultipathEnabled $true -InitiatorPortalAddress <InitiatorIPAddress> -TargetPortalAddress <targetportalIP>
To verify you have added the targets, you can then run the get-iscsitarget command.
Windows Server 2016 Server Core is trickier to work with as everything for the most part is done via the commandline or PowerShell code. When thinking about how to Add iSCSI target Windows Server 2016 Hyper-V Core it might strike fear in your mind, however, it is doable with the command shown above and really isn’t that difficult.