Configure iSCSI on Windows Server 2012 R2
It should be simple to configure iSCSI on Windows Server 2012 R2 right? While it is not rocket science and really not that difficult at all to configure, it’s also not as intuitive as I think it should be. Therefore I decided to create this post on how to configure iSCSI for a Windows Server 2012 R2 Hyper-V cluster using an HP MSA 1040 as the shared storage device.
Equipment
Shared Storage: HP MSA 1040 (4 NICS)
Servers: Quantity of 2 Hyper-V Hosts (each host has 6 NICS)
Network switches: Quantity of 2 network switches (for redundancy)
Operating System: Windows Server 2012 R2
Storage Network: Each Hyper-V host has two NICS dedicated for the storage (1 NIC cabled to MSA Controller A and 1 NIC cabled to MSA Controller B)
Configure HP MSA 1040 Storage Network
The first thing you must do is configure the storage network. This involves configuring the HP MSA 1040. This post will not cover all the aspects involved in configuring the MSA 1040. The screen shots below are just demonstrating the IP configuration so as to better understand how it ties to configuring iSCSI in this environment.
Log into your MSA 1040 shared storage device
The MSA 1040 comes with dual controllers with two NICS on each controller for a total of four network interface cards (NICs). The first thing you will do when you are ready to configure the MSA 1040 is to run the Configuration Wizard. At some point in the configuration wizard you will be asked to assign IP addresses to the MSA NICs. Please consider configuring a separate “private” IP scheme for the storage network. The storage network should always be isolated from your internal network so that the storage traffic doesn’t interfere with your normal network traffic. Normally, your internal network will reside in the 10.0.0.0 network. You will need to VLAN the ports on your network switch in order to do this. That is beyond the scope of this post. In the example below, you’ll notice that the four NICS were configured as such:
MSA Controller A Port 1 (A1) – 192.168.9.7
MSA Controller B Port 1 (B1) – 192.168.9.8
MSA Controller A Port 2 (A2) – 192.168.9.9
MSA Controller B Port 2 (B2) – 192.168.9.10
From a cabling standpoint, on MSA Controller A, we have cabled port A1 to Network Switch 1 and port A2 to Network Switch 2 for redundancy. We’ve done the same for MSA Controller B. On MSA Controller B, we have cabled port B1 to Network Switch 1 and port B2 to Network Switch 2. We have a total of four different paths going through two network switches for maximum resiliency. We can lose a controller AND a network switch and still maintain connectivity to the storage.
Configure Hyper-V Host Storage Network
As stated in the Equipment section at the beginning of this post, each Hyper-V host server has 6 NICs. We are using 2 of those NICs on each host for the storage network. We are also teaming the two storage NICs. Of course, the storage network on the Hyper-V host must reside on the same network as the MSA 1040 storage network. In our example, that is the 192.168.9.0 network. See the example in the figure below. We have configured the storage network for both Hyper-V hosts as such:
Hyper-V Host 1 (MSA Storage Team) – 192.168.9.3
Hyper-V Host 2 (MSA Storage Team) – 192.168.9.4
Configure MPIO on Hyper-V Host/s
Before you continue, you must add the MPIO (Multi-Patch I/O) which is built into the Windows Server 2012 R2 operating system. To do this, just open Server Manager on each Hyper-V host and select Manage, then Roles and Features. Complete the Add Roles and Features wizard to install the MPIO feature to your Hyper-V Host/s. After the MPIO feature is installed, configure MPIO by opening Server Manager, Tools, then MPIO. Select the Discover Multi-Paths tab, check the Add support for iSCSI devices and select OK. This will require a REBOOT of the Hyper-V Host server.
Configure iSCSI Initiator on Hyper-V Host/s
Now it is time to configure the iSCSI Initiator on the Hyper-V host server. To do this, from Server Manager select Tools, then iSCSI Initiator.
On the Targets tab, enter in one of the IP addresses you assigned to the MSA 1040 NICs in Configure HP MSA 1040 Storage Network section at the beginning of this blog post. In the example below, we used the first IP address of 192.168.9.7 and selected Quick Connect. It will discover the iSCSI target and display it in the Discovered Targets box and the status will state “Connected” (see image below).
Once the target is discovered, select Properties for the connected iSCSI target. You will notice the image below. What are we seeing here? Each Identifier represents a NIC or path on the MSA 1040 storage. Remember, in our configuration, we have 4 NIC’s on the HP MSA 1040 (2 on MSA controller A and 2 on MSA Controller B). You must add each Identifier manually by selecting Add Session.
Once you’ve selected Add Session, you will be presented with the Connect to Target screen below. Make sure you check the boxes below, especially the Enable multi-path checkbox and select Advanced.
In the Advanced Settings, for the Local adapter select Microsoft iSCSI Initiator from the drop-down menu. For the Initiator IP, select the Hyper-V Host 1 MSA Storage Team (192.168.9.3 in this example). You configured this in the Configure Hyper-V Host Storage Network section earlier in this blog post. For the Target portal IP, select the first IP address of the MSA 1040 storage (192.168.9.7 in this example). You configured this in the Configure HP MSA 1040 Storage Network section earlier in this blog post.
* You will need to do this for all 4 NICs/paths on each Hyper-V Host.
At this point you are pretty much done if you are OK with all the default settings. However, if you choose to customize the configuration each of the devices you just added above, select Devices from the iSCSI Initiator Properties screen (below).
On the Devices screen, you will notice all the disks or LUNS associated with the devices (sessions) you added. So what are we looking at? Notice the GREEN highlighted areas in the image below for Disk 1 and Disk 2. Don’t worry about LUN 0. Since our example included 4 NICs or paths on the MSA 1040 storage device, you will have 4 disks or LUNS for each device. In the example below, you don’t see the 4th device because you would need to scroll down. So why are there two disks associated with each device (Disk 1 and Disk 2)? The reason for this is because before we configured MPIO and iSCSI on the Hyper-V host, we presented two disks/LUNS from the MSA 1040 storage unit to the Hyper-V host server. We presented a Quorum LUN and a Data LUN. This is not relative to the iSCSI configuration but I thought it was important to understand what you are viewing in the image below.
To configure the MPIO Policy for each disk/LUN, select the disk, then select MPIO. You can configure the MPIO Policy several different ways. The default is Round Robin With Subset. This is what we used in our configuration example.
If you selected the Details for each Path ID, you’d notice that each one with have a different Target Portal IP address (one for each NIC on the MSA 1040).
I wanted to give props to the post below. It definitely helped me wrap my head around the process. Thanks mate!
http://cscmblog.blogspot.com/2012/11/windows-2012-how-to-configure-multi_13.html
Thanks!
Well, that cleared a few things up. Great post! Many thanks!
Glad it helped! Thanks for your comments.
Why did you team an MPIO?
Because I could. I fully admit that it is overkill but I had the NICs so why not? The team is configured in an Active/Passive configuration so I’m only using one NIC of the team at any given point. I know I didn’t have to do this because of the redundant paths but like I said, I had the NICs so why not…. Thanks for commenting!
Hi George, i have a question, i’ve had an older MSA2012i running for about 8 years now, and i have it setup so the two iscsi networks are on 2 separate subnets. have i been doing this all wrong? Networks iscsi-A 10.1.1.0 /24 iscsi-B 10.2.1.0 /24 LAN 192.168.1.0 /24 Controller A target 10.1.1.1 /24 target 10.1.1.6 /24 Controller B target 10.2.1.1 /24 target 10.2.1.6 /24 host 10.1.1.8 /24 10.2.1.8 /24 now i’m setting up a new server 2012 R2 and i’m starting to look at this again and i’m seeing setups being configured where both controllers (and entire iscsi network)… Read more »
Hi George, i have a question, i’ve had an older MSA2012i running for about 8 years now, and i have it setup so the two iscsi networks are on 2 separate subnets. have i been doing this all wrong? Networks iscsi-A 10.1.1.0 /24 iscsi-B 10.2.1.0 /24 LAN 192.168.1.0 /24 Controller A target 10.1.1.1 /24 target 10.1.1.6 /24 Controller B target 10.2.1.1 /24 target 10.2.1.6 /24 host 10.1.1.8 /24 10.2.1.8 /24 now i’m setting up a new server 2012 R2 and i’m starting to look at this again and i’m seeing setups being configured where both controllers (and entire iscsi network)… Read more »
Phill, I’m not sure why you would want to put the two controllers on two separate networks. I did not do that. I did however, keep the storage network on a different subnet from my server network. It is always best to keep your storage on a separate network. As for teaming the storage (iscsi) NICs. Yes, it is OK to do this but it is probably overkill. For the record, I also teamed the storage NICs. Why did I do that? Because they were there. Overall, the way you have it set up, should be fine but I see… Read more »
George, does your configuration pass the Hyper-V cluster “Validate Configuration” test? One of the tests is to “Verify that a node does not have multiple adapters connected to the same subnet”. I have an MSA 2040 connected to two clustered servers on 1 iSCSI subnet. Each server has 2 NIC’s connected to the iSCSI network. I am not teaming the 2 iSCSI NICS as I read it is not supported. The above Validation test fails. Maybe your configuration would pass the Validation test since you teamed your iSCSI NIC’s. I was planning to switch back to a similar configuration to… Read more »
Martin, so sorry for the late response. I performed this work over two years ago so it’s hard for me to remember but I do believe all the validation tests passed. I know that teaming the NIC’s in this cluster environment is probably overkill but we had the NIC’s so why not use them. I’m curious to see if your validation test pass once you reconfigure. Good luck and please let me know if you have any other questions. Thanks for posting!
Hi George,
I configured as your instruction but one time I can ping 2 port (ex: A1 and B1) this mean the first port on server is active and second port is passive. Although, I create NICs teaming with 2 ports active.
I configure on Hyper-V 2012, create NICs Teaming with: Teaming Mode -> Switch Independent; Load balancing -> Hyper-V Port; Standby adapter -> None. I used 2 switch Cisco 2960 and SAN HP MSA1040.
Please help!
Thank you.
Pho, sorry for the late reply. I’m not sure I understand your question. Hopefully you have figured it out by now. If not, you can email me through the Contact form. Thank you.
Thank you. This instruction can apply for Hyper-V 2012?
Sorry for the late reply. Yes. This was done with Hyper-V 2012.
Great post ! I want to ask how can I directly attached the MSA to the server. I have attached HP MSA 1040 directly to the server. However, on the server(windows server 2016), I cannot see anything under the file storage ? Is there some settings to attach it directly as well ?
Hassan, I haven’t tried that yet but it should work just fine for Windows Server 2016. Can you provide some more detail on how you have it connected and cabled? You can just email me at info@georgealmeida.com. Good luck and let me know if you still require assistance. Thank you for posting!