Windows Server 2016

Add iSCSI target Windows Server 2016 Hyper-V Core

Let's take a look at how to Add iSCSI target Windows Server 2016 Hyper-V Core. We can do this with PowerShell from the commandline.

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>

hv_iscsi01

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>

hv_iscsi02

To verify you have added the targets, you can then run theย get-iscsitarget command.

hv_iscsi03

Thoughts

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.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.