@@ -4,7 +4,7 @@ description: Learn how to connect to an Azure Elastic SAN (preview) volume from
4
4
author : roygara
5
5
ms.service : storage
6
6
ms.topic : how-to
7
- ms.date : 11/07/2022
7
+ ms.date : 02/17/2023
8
8
ms.author : rogarana
9
9
ms.subservice : elastic-san
10
10
ms.custom : references_regions, ignite-2022
@@ -122,7 +122,7 @@ Install Multipath I/O, enable multipath support for iSCSI devices, and set a def
122
122
123
123
``` powershell
124
124
# Install Multipath-IO
125
- Add-WindowsFeature -Name 'Multipath-IO'
125
+ Add-WindowsFeature -Name 'Multipath-IO'
126
126
127
127
# Verify if the installation was successful
128
128
Get-WindowsFeature -Name 'Multipath-IO'
@@ -168,62 +168,62 @@ To script multi-session configurations, use two files. An XML configuration file
168
168
The following example shows you how to format your XML file for the script, for each volume, create a new ` <Target> ` section:
169
169
170
170
``` xml
171
- <?xml version=" 1.0" encoding=" utf-8" ?>
171
+ <?xml version =" 1.0" encoding =" utf-8" ?>
172
172
<Targets >
173
- <Target >
174
- <Iqn >Volume 1 Storage Target Iqn</Iqn >
175
- <Hostname >Volume 1 Storage Target Portal Hostname</Hostname >
176
- <Port >Volume 1 Storage Target Portal Port</Port >
177
- <NumSessions >Number of sessions</NumSessions >
178
- <EnableMultipath >true</EnableMultipath >
179
- </Target >
180
- <Target >
181
- <Iqn >Volume 2 Storage Target Iqn</Iqn >
182
- <Hostname >Volume 2 Storage Target Portal Hostname</Hostname >
183
- <Port >Volume 2 Storage Target Portal Port</Port >
184
- <NumSessions >Number of sessions</NumSessions >
185
- <EnableMultipath >true</EnableMultipath >
186
- </Target >
173
+ <Target >
174
+ <Iqn >Volume 1 Storage Target Iqn</Iqn >
175
+ <Hostname >Volume 1 Storage Target Portal Hostname</Hostname >
176
+ <Port >Volume 1 Storage Target Portal Port</Port >
177
+ <NumSessions >Number of sessions</NumSessions >
178
+ <EnableMultipath >true</EnableMultipath >
179
+ </Target >
180
+ <Target >
181
+ <Iqn >Volume 2 Storage Target Iqn</Iqn >
182
+ <Hostname >Volume 2 Storage Target Portal Hostname</Hostname >
183
+ <Port >Volume 2 Storage Target Portal Port</Port >
184
+ <NumSessions >Number of sessions</NumSessions >
185
+ <EnableMultipath >true</EnableMultipath >
186
+ </Target >
187
187
</Targets >
188
188
```
189
189
190
190
Use the following script to create the connections, to run the script use ` .\LoginTarget.ps1 -TargetConfigPath [path to config.xml] ` :
191
191
192
192
```
193
193
param(
194
- [string] $TargetConfigPath
194
+ [string] $TargetConfigPath
195
195
)
196
- $TargetConfig = New-Object XML
196
+ $TargetConfig = New-Object XML
197
197
$TargetConfig.Load($TargetConfigPath)
198
- foreach ($Target in $TargetConfig.Targets.Target)
198
+ foreach ($Target in $TargetConfig.Targets.Target)
199
199
{
200
- $TargetIqn = $Target.Iqn
201
- $TargetHostname = $Target.Hostname
202
- $TargetPort = $Target.Port
203
- $NumSessions = $Target.NumSessions
204
- $succeeded = 1
205
- iscsicli AddTarget $TargetIqn * $TargetHostname $TargetPort * 0 * * * * * * * * * 0
206
- while ($succeeded -le $NumSessions)
207
- {
208
- Write-Host "Logging session ${succeeded}/${NumSessions} into ${TargetIqn}"
209
- $LoginOptions = '*'
210
- if ($Target.EnableMultipath)
211
- {
212
- Write-Host "Enabled Multipath"
213
- $LoginOptions = '0x00000002'
214
- }
215
- # PersistentLoginTarget will not establish login to the target until after the system is rebooted.
216
- # Use LoginTarget if the target is needed before rebooting. Using just LoginTarget will not persist the
217
- # session(s).
218
- iscsicli PersistentLoginTarget $TargetIqn t $TargetHostname $TargetPort Root\ISCSIPRT\0000_0 -1 * $LoginOptions * * * * * * * * * 0
219
- #iscsicli LoginTarget $TargetIqn t $TargetHostname $TargetPort Root\ISCSIPRT\0000_0 -1 * $LoginOptions * * * * * * * * * 0
220
- if ($LASTEXITCODE -eq 0)
221
- {
222
- $succeeded += 1
223
- }
224
- Start-Sleep -s 1
225
- Write-Host ""
226
- }
200
+ $TargetIqn = $Target.Iqn
201
+ $TargetHostname = $Target.Hostname
202
+ $TargetPort = $Target.Port
203
+ $NumSessions = $Target.NumSessions
204
+ $succeeded = 1
205
+ iscsicli AddTarget $TargetIqn * $TargetHostname $TargetPort * 0 * * * * * * * * * 0
206
+ while ($succeeded -le $NumSessions)
207
+ {
208
+ Write-Host "Logging session ${succeeded}/${NumSessions} into ${TargetIqn}"
209
+ $LoginOptions = '*'
210
+ if ($Target.EnableMultipath)
211
+ {
212
+ Write-Host "Enabled Multipath"
213
+ $LoginOptions = '0x00000002'
214
+ }
215
+ # PersistentLoginTarget will not establish login to the target until after the system is rebooted.
216
+ # Use LoginTarget if the target is needed before rebooting. Using just LoginTarget will not persist the
217
+ # session(s).
218
+ iscsicli PersistentLoginTarget $TargetIqn t $TargetHostname $TargetPort Root\ISCSIPRT\0000_0 -1 * $LoginOptions * * * * * * * * * 0
219
+ #iscsicli LoginTarget $TargetIqn t $TargetHostname $TargetPort Root\ISCSIPRT\0000_0 -1 * $LoginOptions * * * * * * * * * 0
220
+ if ($LASTEXITCODE -eq 0)
221
+ {
222
+ $succeeded += 1
223
+ }
224
+ Start-Sleep -s 1
225
+ Write-Host ""
226
+ }
227
227
}
228
228
```
229
229
0 commit comments