1

I have two NIC's that have access to my iSCSI network. I want to specify the initiator IP as well as the Target portal IP and create redundant links and use MPIO.

This is easily done using the Advanced settings in the iSCSI initiator GUI. However, I want to be able to specify the initiator IP using iscsicli.

I am pretty sure the answer is in one of the options for iscsicli persistentlogin where there are 15 "*'s" that represent different options. I am just not sure what * to replace with what.

Andy Schneider
  • 1,543
  • 5
  • 19
  • 28
  • I figured out that you need to use this command: iscsicli addtargetportal 10.33.4.11 3260 ROOT\ISCSIPRT\0000_0 1 * * * * * * * * * * The 1 after ROOT\ISCSIPRT\0000_0 identifies the IP Address. If I specify 2, it will have a different source IP. However, I still need to find a way to programatically associate that number with an IP. It's not the Index that you see when you run netsh int ip sh int Getting closer! – Andy Schneider Sep 06 '09 at 20:34

2 Answers2

1

The trick is set the "port number" parameter in the AddTargetPortal command in iscsicli.

However, the only way I was able to associate this port number with an actual IP address is using WMI. In order to figure this out, I used PowerShell

Function Get-IscsiPortNumber {

$query = "select portalinformation from msIsci_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

}

Once you track down the port number (let's say 2) you can use the following to add the target portal assuming the target has an ip of 10.10.10.10. The port number comes after the initiator name, ROOT\ISCSIPRT\0000_0

iscsicli addtargetportal 10.10.10.10 3260 ROOT\ISCSIPRT\0000_0 2 * * * * * * * * * *
Andy Schneider
  • 1,543
  • 5
  • 19
  • 28
0

I don't have an answer but I want to try and encourage some additional input as I am also very interested in this. Have you exhausted the possibilities demonstrated in the comment by Fulgan in this technet thread.?

There is a specific discussion of the challenges related to your problem in this technet thread but there doesn't seem to be any resolution. The key parameter for the persistentlogin seems to be the fourth default (*) that the iSCSI documentation refers to as the port number.

I assume you have been trawling through the MS iSCSI Initiator documentation but if not you can find it here - it is quite detailed and has an explanation of each parameter unfortunately it doesn't seem to shed light on this particular problem.

Helvick
  • 20,019
  • 4
  • 38
  • 55
  • 1
    @Helvick I have read that article and the userguide and thought I had the answer using the interface index as that fourth option, but it didn't take. – Andy Schneider Jul 20 '09 at 13:32