Configuring MPIO on Server Core - How to identify source NICs to be passed via iSCSIcli?
-
Monday, October 06, 2008 7:42 PM
Our intent was/is to install and configure 2 Windows Server 2008 machines running Server Core to act as nodes in a cluster that would eventually host clustered virtual machines running on Hyper-V. In order to take full advantage of our hardware, we wanted to configure Multipath I/O on the Server Core installs so that the 2 NICs on each Server Core machine which are connected to the iSCSI storage could share the I/O load. We were eventually able to do so using the steps documented below. However, the process we had to use to configure connections from the 2 NICs on each Server Core install to target disks involved guesswork. We would like to know if there is a better way to do it or if what we did might seemingly have worked in the short term but is setting us up for problems later on. The steps in question are noted by the ???????'s in the process outline below. Specific question we have include:
1. In order to identify the correct <Port number> to be passed in the "iSCSIcli LoginTarget" command so that connections were made from a specific NIC on the source machine, we started at 1 and worked our way up until the "iSCSIcli LoginTarget" command reported a successfull connection. We then were able to verify connections using the "iSCSIcli sessionlist" command where the "Initiator Portal" indicated one connection from each of our NICs connected to the iSCSI array. After identifying working ports, we formulated the "iSCSIcli PersistentLoginTarget" command and configured persistent targets - which did reconnect after the system was rebooted. Is there a better way to determine what port numbers should be passed? ...we tried the "netsh interface ipv4 show interfaces" command but the indexes reported did not work when passed via the "iSCSIcli LoginTarget" command.
2. Our thinking was that once we identified values to be passed in the <port number> parameter, the same ports would work when additional disks from the same array needed to be logged on to and added. This assumption proved false - when a new disk was added, we had to repeat the same trial-and-error process as before to identify working port numbers to connect to the new disk. In most cases, the "winning" ports for the new disk were different port numbers than those used to connect to a previous disk. Is there a logical explanation for this?
************ PROCESS TO CONNECT TO iSCSI DISKS AND CONFIGURE MPIO FROM WINDOWS 2008 SERVER CORE ************--- Configure the iSCSI Server to automatically start and start the server -------------
1. sc config msiSCSI start= auto (note the space following the equal sign)2. net start msiSCSI
--- Configure iSCSI Initiator from the Command Line using iSCSIcli ---------------------
3. Enter "iSCSIcli" at the command line to enter iSCSIcli interactive mode - all lettered bulleted items should be run within that context):a. Run "ListInitators" to determine the Initiator Instance Name
b. Run AddTargetPortal command - the 0x2 adds the target portal with "Multipath I/O enabled"
Example:
AddTargetPortal 10.5.103.102 3260 "Root\ISCSIPRT\0000_0" * * 0x2 * * * * * * * *b. ListTargets (Will allow you to see available LUN IQN identifiers)
????????????????????????? START OF PROCESS THAT CONCERNS US ????????????????????????????
--- Login to target by passing the source IP address via a NIC index reference --------
c. Run LoginTarget to connect to the desired target, once from each NIC (Refer to the next step to see how we verify that a connection is being made from each NIC). From what I understand, the way you go about referencing a NIC is by passing the appropriate NIC index in 99 placeholder below. However, we have yet to find a means by which to identify the NIC index that should be passed and likewise had to use trial and error to determine NIC indexes that successfully connected. Trial and Error process: Run the following command multiple times. Modify the 99 placeholder starting at 0 and incrementing by 1 until you receive a "The operation completed successfully." message...twice (once for each NIC). Again, the 0x00000002 parameter logs into the disk with Multipath I/O enabled.
Example:
LoginTarget iqn.2001-05.com.equallogic:0-8a1234-a785b4101-6d8f12914a447abc-vmprototype T * * Root\ISCSIPRT\0000_0 99 * 0x00000002 * * * * * * * * * 0
d. Use the "SessionList" command to verify the active sessions are connecting from the each of the respective source NICs - look at the "Initiator Portal" value.
--- Configure persistent logins (i.e. logins that will work after a restart) ----------
e. Run PersistentLoginTarget - Replace "LoginTarget" with "PersistentLoginTarget" in the command above for the applicable indexes.
PersistentLoginTarget iqn.2001-05.com.equallogic:0-8a1234-a785b4101-6d8f12914a447abc-vmprototype T * * Root\ISCSIPRT\0000_0 99 * 0x00000002 * * * * * * * * * 0
f. ListPersistentTargets
g. Reboot to verify persistent targets reconnect. After the reboot, you can verify disks reconnected by running the "list disks" command from DISKPART (there should be 2 instances of your iSCSI disk - assuming you've never run the "mpclaim -r -i -a "" " command) and/or running "iSCSIcli listsessions" (there should be 2 sessions with "Initiator Portal" values representing your 2 NICS).
????????????????????????? END OF PROCESS THAT CONCERNS US ????????????????????????????
2. Setup MPIO by running (assumes "ocsetup.exe MultipathIo" was run during initial setup steps):
mpclaim -r -i -a ""3. After the restart, verify DISKPART only shows 1 instance of the shared disk.
Answers
-
Friday, October 31, 2008 9:10 PMOwner
Hi,
I would recommend posting this in the file services and storage forum. There should be some MPIO experts there that can help.
Andrew- Marked As Answer by Andrew Mason - MSFTMicrosoft Employee, Owner Wednesday, December 03, 2008 9:00 PM
All Replies
-
Monday, October 20, 2008 4:20 PMOwnerHi,
It sounds like you are trying to determine which id applies to which NIC in a box. On a Server Core installation you can run:
Netsh int ipv4 int
to get the ids for each NIC in the box.
Hope that helps,
Andrew
-
Monday, October 20, 2008 10:50 PMUnfortunately the NIC index reported by the "netsh interface ipv4 show interfaces" command does not work (i.e. produce a successful login) when used in the LoginTarget command. In my testing, I had come across a post on a different forum suggesting using that command to get the index. I tried it a couple of times to no avail. It also wouldn't explain why when adding additional disks, the index which ultimately works is usually (if not always) different than the index that was used successfully to login to disks that were connected prior.
Thanks for the suggestion though. -
Friday, October 31, 2008 9:10 PMOwner
Hi,
I would recommend posting this in the file services and storage forum. There should be some MPIO experts there that can help.
Andrew- Marked As Answer by Andrew Mason - MSFTMicrosoft Employee, Owner Wednesday, December 03, 2008 9:00 PM
-
Monday, December 22, 2008 4:28 PMI am interested in your testing and wondering if you could assist me. My problem is that when i reboot the iscsi drive does not come back up. I am running Hyper-v only with all updates as of yesterday. I have setup my isci with the following:
I did this once and the service logs that it starts
sc file://hyperv01/ config msiSCSI start= auto
net start msiSCSI
I have log off target the connection and target after reboot
iscsicli ReportTargetMappings
'this gives me the log id
Iscsicli logouttarget fffffa800d405208-4000013700000001
Iscsicli removetargetportal iqn.1994-12.com.promise.ec.62.55.55.1.0.0.20
iscsicli AddTargetPortal 172.16.1.68 3260
iscsicli ListTargets
iscsicli QloginTarget iqn.1994-12.com.promise.ec.62.55.55.1.0.0.20
iscsicli PersistentLoginTarget iqn.1994-12.com.promise.ec.62.55.55.1.0.0.20 T * * * * * * * * * * * * * * * 0 (15 *'s)
iscsicli BindPersistentVolumes
iscsicli ListPersistentTargets
iscsicli ReportTargetMappings
The two things i would like to do are specify the NIC to connect to the iscsi... one thing i did do was change the IP of one nic to the same subnet as the iscsi san. that actually made the connection work.
Any help would be appreciated, also as a note... the iscsicli.exe is painful. If MS wants Hyper-v to be the premiere hypervisor, i think they have to come up with something better. :)
Thanks
Adam
adam Lussier -
Sunday, March 01, 2009 11:33 AMadam_Lussier_hotmail.com said:
The two things i would like to do are specify the NIC to connect to the iscsi... one thing i did do was change the IP of one nic to the same subnet as the iscsi san. that actually made the connection work.
Any help would be appreciated, also as a note... the iscsicli.exe is painful. If MS wants Hyper-v to be the premiere hypervisor, i think they have to come up with something better. :)
Thanks
Adam
adam Lussier
Adam,
Were you able to sort out this last part - specifying the NIC to connect to the iSCSI target?
--
James B.
James -
Monday, March 23, 2009 6:58 PM
We use the following powershell script to finx the index value:
param($hostName)
Function Convert-IscsiIpAddress
{Param ($Ipaddr)
if ($ipaddr.ipv4Address) {
$i=$ipaddr.ipv4address
$o1=$i -band 255
$i=($i-$o1) /256
$o2=$i -band 255
$i=($i-$o2) /256
$o3=$i -band 255
$o4=($i-$o3) /256
"$o1.$o2.$o3.$o4"}
elseif ($ipaddr.ipv6address) { $ipaddr.ipv6address | foreach -begin {$text=""} `
-process{$text+="{0:x2}" -f $_
if (($text.length % 5) -eq 4) {$text += ":"} } `
-end {$Text +='%'+$ipaddr.ipv6scopeid
$Text.replace(':%','%') } }}
(get-wmiobject -ComputerName $hostname -namespace root\wmi -class msIscsi_portalinfoclass).portalinformation | format-table -autosize -property index,port,portalType,protocol,portaltag, @{Label="Ip Address"; expression={convert-iscsiipaddress $_.ipaddr}}
- Proposed As Answer by OchoaJP Monday, March 23, 2009 6:59 PM
-
Tuesday, April 07, 2009 2:29 PMI've managed to get iscsicpl (the gui) to work on Hyper-V Server so scripts and indexes are a thing of the past.
-
Monday, October 18, 2010 12:22 PM
I found a powershell script to find the interface number
$query = "select portalinformation from MSiSCSI_PortalInfoClass"
$portalInfo = get-wmiobject -namespace root\wmi -query $query
$eScriptBlock ={([Net.IPAddress]$_.ipaddr.IPV4Address).IPAddressToString}
$customLabel = @{Label="IpAddress"; expression = $eScriptBlock}
$portalInfo.portalInformation | select port,$customlabel

